-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allowSubstitutes is an anti-feature #4442
Comments
I think I would rather keep |
the |
The problem I have with removing |
It's a great power feature that hits Nix beginners really had and given that it's used in nixpkgs there no opt-out. Of course all expirienced Nix users will say they have no problem with it, but it makes behavior with substituters and remove builders hard to debug and reason about. |
I use |
I often (need to start tracking how often) get Cachix support request why is something not being substituted and I have templated an answer, but the response from Nix beginners is usually: wow This probably can be fixed with better logging/messaging and fixing all the bugs, but I feel like that's one of those things that will never materialize. |
Maybe it would help to make this clear in at least the new progress bar that's currently under development: #4296 |
I understand that For |
|
From the discussion here, it seems there is a majority in favor of keeping |
|
|
That seems like a bug to me rather than a use case for allowSubstitutes. |
As described in #5358 this lends itself to some very frustrating user experiences. It is very disappointing to me that I can't even really begin to even account for how much time I wasted on this, I've invested hours here and there over months to try to figure out why the ideal (per-my-understanding-before-now) CI flow for Nix kept rebuilding unnecessarily. |
I think it is important that we split the question here: I personally see very good reasons for having |
NixOS' top-level Some interesting history: I think we have some different options for improving this situation:
|
@rickynils perhaps another option:
*: all dependencies, perhaps excluding dependencies that have I'd have to read up on the updated 2.4 realisation logic tbh. |
Has there been any proposal for finer-grained (per-derivation/flake) substituter lists? It seems like |
Interesting. I suggested this a long time ago in #3019 as a way to make adding substituters guaranteed to never slow things down, I think you're right that it would also make |
See, e.g., NixOS/nix#4442 for wider discussions.
See, e.g., NixOS/nix#4442 for wider discussions.
See, e.g., NixOS/nix#4442 for wider discussions.
`runCommandLocal` sets both `preferLocalBuild=true` and `allowSubstitutes=false`. There's an [argument](NixOS/nix#4442) that the latter is a misfeature. There's really no reason not to download something from a substitutor if it's actually been built already. We can get the effect that we want easily enough by just setting `preferLocalBuild=true` alone.
`runCommandLocal` sets both `preferLocalBuild=true` and `allowSubstitutes=false`. There's an [argument](NixOS/nix#4442) that the latter is a misfeature. There's really no reason not to download something from a substitutor if it's actually been built already. We can get the effect that we want easily enough by just setting `preferLocalBuild=true` alone.
`runCommandLocal` sets both `preferLocalBuild=true` and `allowSubstitutes=false`. There's an [argument](NixOS/nix#4442) that the latter is a misfeature. There's really no reason not to download something from a substitutor if it's actually been built already. We can get the effect that we want easily enough by just setting `preferLocalBuild=true` alone.
Any news here? This issue still is relevant. |
some derivations with What I would prefer is if |
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.
I have a PR in It's not a perfect solution, since it causes rebuilds, but it does help. |
It also breaks horribly if your local system doesn't match the one you're substituting, as Nix will try to build and fails because it can't. |
Just to pile on here, I spent quite a bit of time debugging due to Now that I know it exists, it means I can't trust I think over the years this was also the source of a lot of mysterious rebuilds I never understood, that went away when we stopped using nixpkgs |
Folks, I'm happy to report that #8047 has been merged! In the next release, you'll be able to completely disable |
Nice, just slightly disappointed it wasn't named |
Closed by #8047 |
I can't describe how many hours I and people I have helped have lost to save a few miliseconds of machine time.
For example
preferLocalBuild
ignores builders and--max-jobs
per #3810 giving the user the impression that flags are being ignored.Having such exceptions completely change the way Nix works makes it also really hard to debug binary cache issues - I've gotten lots of reports of why is binary cache not substituting.
Refs #3686
The text was updated successfully, but these errors were encountered: