Skip to content

Commit

Permalink
[PDT] Apply the pdtnix-substituters-allowed patch
Browse files Browse the repository at this point in the history
This resolves the problems detailed here:
NixOS#4442
The `allowSubstitute=false` "feature" wreaks havoc on CI / AWS / container
type builds, because we *cannot* cache hit on AWS pkgs, and further features
like `nix-build-if-changed` do not work without really ugly wrapper hacks:
NixOS#4364
Seen in the wild, in addition to the above, we've hit two problems at PDT specifically:
1. User buildEnv results can't be substituted out of S3. This means that in
   pdtnix, we can't push them to S3 from CA and have hosts like mtsync pull
   them. This then results in mtsync failing, because it tries to build, but it
   doesn't have DTS-8 installed.
2. On AWS, there are >10,000 pkgs in texlive that say
   allowSubstitutes=false. These are all in S3, but if you cold start a host it
   will rebuild them all!

Moreover, our buildPDTEnv calls are sometimes very expensive (20,000+ symlinks
in turnover-tool style bundles!), so the whole notion that this is faster to
build locally than substitute out of S3 is flawed. We also run pytest
suites, which involve starting tests on NFS, etc., and do a bunch of `find`
filtering to find tests.

Per comment upstream, this is a controversial change and unlikely to be
accepted upstream without more discussion (currently underway in the
community), so we'll keep it internal for now.
  • Loading branch information
srpdt authored and gbpdt committed Nov 21, 2022
1 parent 9ed30cf commit 0a52c43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libstore/parsed-derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool ParsedDerivation::willBuildLocally(Store & localStore) const

bool ParsedDerivation::substitutesAllowed() const
{
return getBoolAttr("allowSubstitutes", true);
return true;
}

static std::regex shVarName("[A-Za-z_][A-Za-z0-9_]*");
Expand Down
3 changes: 1 addition & 2 deletions src/nix-env/buildenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ derivation {
# network traffic, so don't do that.
preferLocalBuild = true;

# Also don't bother substituting.
allowSubstitutes = false;
allowSubstitutes = true;
}

0 comments on commit 0a52c43

Please sign in to comment.