Merged
Conversation
pmbittner
reviewed
Oct 7, 2025
pmbittner
approved these changes
Oct 7, 2025
After a cache hit, there are no channels installed. When running
`nix-shell`, it tries to execute bash from a nixpkgs in a channel, fails
to do so and falls back to the bash in the environment. Unfortunately,
the warning message is quite misleading:
```
warning: Nix search path entry 'channel:' cannot be downloaded, ignoring
error:
… while calling the 'import' builtin
at «string»:1:2:
1| (import <nixpkgs> {}).bashInteractive
| ^
… while realising the context of a path
… while calling the 'findFile' builtin
at «string»:1:9:
1| (import <nixpkgs> {}).bashInteractive
| ^
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
will use bash from your environment
```
As there is no further output it looks like a failed CI run although the exit code was zero and thus the CI is considered successful (which is indeed correct).
This fix explicitly uses the environment if no channels are installed.
Note that channels are still used if available. In particular, the shell
used when the cache hits is the pre-installed one but on cache misses
the shell is taken from nixpkgs. Both shells are bash but the versions
might differ.
Member
|
Feel free to merge when you are ready. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a cache hit, there are no channels installed. When running
nix-shell, it tries to execute bash from a nixpkgs in a channel, fails to do so and falls back to the bash in the environment. Unfortunately, the warning message is quite misleading:As there is no further output it looks like a failed CI run although the exit code was zero and thus the CI is considered successful (which is indeed correct).
This fix explicitly uses the environment if no channels are installed. Note that channels are still used if available. In particular, the shell used when the cache hits is the pre-installed one but on cache misses the shell is taken from nixpkgs. Both shells are bash but the versions might differ.