1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00
Nix, the purely functional package manager
Find a file
Philip Wilk aef431fbd1
bugfix/3514: do not throw on substituter errors if other substituters 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.
![image](https://github.com/user-attachments/assets/b4aec474-52d1-497d-b4e8-6f5737d6acc7)
![image](https://github.com/user-attachments/assets/ee91fcd4-4a1a-4c33-bf88-3aee67ad3cc9)

## Context

https://github.com/NixOS/nix/issues/3514#issuecomment-2905056198 is the earliest issue I could find, but there are many duplicates.

There is an initial PR at https://github.com/NixOS/nix/pull/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 https://github.com/NixOS/nix/pull/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 https://github.com/NixOS/nix/pull/7188#issuecomment-1375652870 but correct me if I am wrong.
Current behaviour:
![current](https://github.com/user-attachments/assets/d9501b34-274c-4eb3-88c3-9021a482e364)
Proposed behaviour:
![proposed](https://github.com/user-attachments/assets/8236e4f4-21ef-45d7-87e1-6c8d416e8c1c)

[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.
2025-09-12 17:29:34 -04:00
.github build(deps): bump actions/labeler from 5 to 6 2025-09-08 22:00:58 +00:00
ci/gha flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
contrib function-trace: always show the trace 2019-09-18 23:23:21 +02:00
doc/manual Add release note 2025-09-10 10:20:37 +02:00
maintainers Update work meeting time in README 2025-08-26 00:50:12 +02:00
misc add rc.d script for the nix-daemon 2025-08-08 09:09:58 +02:00
nix-meson-build-support meson: link to libatomic on powerpc-linux 2025-09-10 18:50:35 +02:00
packaging Reapply "Merge pull request #13741 from xokdvium/toml-timestamps" 2025-09-01 01:26:14 +03:00
scripts add freebsd multi-user installer 2025-08-08 09:10:35 +02:00
src bugfix/3514: do not throw on substituter errors if other substituters are still enabled (#13301) 2025-09-12 17:29:34 -04:00
tests Test that using --inputs-from with a flakeref that has a dir works 2025-09-08 09:00:59 +02:00
.clang-format Update clang-format with fixing namespace coments, and separate definition blocks 2025-07-18 12:46:51 -04:00
.clang-tidy Add .clang-tidy 2024-02-01 01:01:39 +01:00
.dir-locals.el .dir-locals.el: Set c-block-comment-prefix 2020-07-10 11:21:06 +02:00
.editorconfig No global eval settings in libnixexpr 2024-06-24 12:15:16 -04:00
.git-blame-ignore-revs git-blame-ignore-revs: Add nixfmt 1.0.0 reformat 2025-08-18 20:30:54 +03:00
.gitignore Overriding gtest with gmock 2025-05-31 07:41:27 -07:00
.mergify.yml Update mergify.yml 2025-08-25 10:28:47 +02:00
.shellcheckrc housekeeping: shellcheck for tests/functional/ca/build-cache.sh 2024-06-12 17:41:16 -04:00
.version Bump version 2025-08-25 10:27:46 +02:00
CITATION.cff chore: PhD thesis as reference in CITATION.cff 2024-05-18 20:05:22 +02:00
CONTRIBUTING.md Update developer facing links to nix.dev 2025-07-25 10:59:44 +02:00
COPYING * Change this to LGPL to keep the government happy. 2006-04-25 16:41:06 +00:00
default.nix Format .nix files 2025-01-24 17:04:02 +01:00
docker.nix Merge pull request #13524 from gmarti/fix_cacertificate 2025-08-28 23:28:53 +03:00
flake.lock flake: Update nixpkgs 2025-08-27 02:23:05 +03:00
flake.nix flake: nixpkgs: nixos-unstable -> nixos-25.05-small 2025-08-18 20:04:57 +03:00
HACKING.md Rename doc/manual{src -> source} 2024-10-14 11:21:24 -04:00
meson.build meson: Get rid of multiline array formatting hack 2025-08-07 02:57:02 +03:00
meson.format flake: Add meson formatter 2025-06-11 22:08:03 +00:00
meson.options add derivation parser benchmark 2025-07-29 16:51:55 +02:00
README.md fix(docs): update Matrix channel links 2025-05-04 12:17:48 +02:00
shell.nix Remove url literals 2022-01-24 13:28:21 +01:00

Nix

Open Collective supporters CI

Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.

Installation and first steps

Visit nix.dev for installation instructions and beginner tutorials.

Full reference documentation can be found in the Nix manual.

Building and developing

Follow instructions in the Nix reference manual to set up a development environment and build Nix from source.

Contributing

Check the contributing guide if you want to get involved with developing Nix.

Additional resources

Nix was created by Eelco Dolstra and developed as the subject of his PhD thesis The Purely Functional Software Deployment Model, published 2006. Today, a world-wide developer community contributes to Nix and the ecosystem that has grown around it.

License

Nix is released under the LGPL v2.1.