Conversation
1a6755c to
6e6df58
Compare
|
Can someone help me with writing the test? I can't seem to figure out how to make the file substituter fail in the right way, if I duplicate the corrupt NAR test and add and extra substituter it also succeeds on master |
Can't you just add a substituter that doesn't exist as the first one? That's what's currently preventing me from updating one of my machines, which is how I found this PR xD |
|
@Ericson2314 sending that one over to you as you were trying to push the previous attempt forward |
|
I tried making a test for this, but I had a hard time. I tried doing this: I ran into 2 different problems:
Is there a better way to force it to use substitution for a test like this?
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-09-22-nix-team-meeting-minutes-88/33343/1 |
|
So if a single substituter is down and a derivation is not cached on any of the other subsituters, it will still fail right? Just making sure because allowing failing substituters by falling back to building from source would break our workflow. We host the Nix binary cache under a VPN, so if a substituter fails, it's a good reminder to re-connect to the VPN. |
|
I don't have time to continue on this unfortunately, so I will close it |
… are still enabled (#13301) ## Motivation Nix currently hard fails if a substituter is inaccessible, even when they are other substituters available, unless `fallback = true`. This breaks nix build, run, shell et al entirely. This would modify the default behaviour so that nix would actually use the other available substituters and not hard error. Here is an example before vs after when using dotenv where I have manually stopped my own cache to trigger this issue, before and after the patch. The initial error is really frustrating because there is other caches available.   ## Context #3514 (comment) is the earliest issue I could find, but there are many duplicates. There is an initial PR at #7188, but this appears to have been abandoned - over 2 years with no activity, then a no comment review in jan. There was a subsequent PR at #8983 but this was closed without merge - over a year without activity. <!-- Non-trivial change: Briefly outline the implementation strategy. --> I have visualised the current and proposed flows. I believe my logic flows line up with what is suggested in #7188 (comment) but correct me if I am wrong. Current behaviour:  Proposed behaviour:  [Charts in lucid](https://lucid.app/lucidchart/1b51b08d-6c4f-40e0-bf54-480df322cccf/view) <!-- Invasive change: Discuss alternative designs or approaches you considered. --> Possible issues to think about: - I could not figure out where the curl error is created... I can't figure out how to swallow it and turn it into a warn or better yet, a debug log. - Unfortunately, in contrast with the previous point, I'm not sure how verbose we want to warns/traces to be - personally I think that the warn that a substituter has been disabled (when it happens) is sufficient, and that the next one is being used, but this is personal preference.
… are still enabled (NixOS#13301) Nix currently hard fails if a substituter is inaccessible, even when they are other substituters available, unless `fallback = true`. This breaks nix build, run, shell et al entirely. This would modify the default behaviour so that nix would actually use the other available substituters and not hard error. Here is an example before vs after when using dotenv where I have manually stopped my own cache to trigger this issue, before and after the patch. The initial error is really frustrating because there is other caches available.   There is an initial PR at NixOS#7188, but this appears to have been abandoned - over 2 years with no activity, then a no comment review in jan. There was a subsequent PR at NixOS#8983 but this was closed without merge - over a year without activity. <!-- Non-trivial change: Briefly outline the implementation strategy. --> I have visualised the current and proposed flows. I believe my logic flows line up with what is suggested in NixOS#7188 (comment) but correct me if I am wrong. Current behaviour:  Proposed behaviour:  [Charts in lucid](https://lucid.app/lucidchart/1b51b08d-6c4f-40e0-bf54-480df322cccf/view) <!-- Invasive change: Discuss alternative designs or approaches you considered. --> Possible issues to think about: - I could not figure out where the curl error is created... I can't figure out how to swallow it and turn it into a warn or better yet, a debug log. - Unfortunately, in contrast with the previous point, I'm not sure how verbose we want to warns/traces to be - personally I think that the warn that a substituter has been disabled (when it happens) is sufficient, and that the next one is being used, but this is personal preference.
Motivation
Currently any failing substituter causes nix to fail a build. Here I'm changing it so it will try all subs before failing, even when
fallback = false@Ericson2314 @SuperSandro2000 this replaces #7188, and I really need this myself so I'll make sure to get it over the line.
I still need to work on a test, I think I can modify
binary-cache.shtest to make this work.Priorities
Add 👍 to pull requests you find important.