Skip to content

Fix CI warning#94

Merged
ibbem merged 1 commit intodevelopfrom
fix-ci-warning
Oct 7, 2025
Merged

Fix CI warning#94
ibbem merged 1 commit intodevelopfrom
fix-ci-warning

Conversation

@ibbem
Copy link
Collaborator

@ibbem ibbem commented 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.

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.
@pmbittner
Copy link
Member

Feel free to merge when you are ready.

@ibbem ibbem merged commit 9f3ea74 into develop Oct 7, 2025
1 check passed
@ibbem ibbem deleted the fix-ci-warning branch October 7, 2025 13:32
@pmbittner pmbittner mentioned this pull request Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants