cachix icon indicating copy to clipboard operation
cachix copied to clipboard

bug: cache is not used as substituter in Github

Open gabyx opened this issue 1 year ago • 1 comments

Describe the bug

On Github it seems that the following does not work inside this container: https://github.com/sdsc-ordes/tripsu/blob/51a1e823d776f499997669dc81afb5a60d0de0ba/tools/ci/images/Containerfile docker.nix-community.org/nixpkgs/cachix-flake

cachix watch-exec "$CACHIX_CACHE_NAME" -- \
        nix develop ./tools/nix#ci --command "$@"

the nix.conf contains:

bash-5.2# cat ~/.config/nix/nix.conf
experimental-features = nix-command flakes
accept-flake-config = true
substituters = https://cache.nixos.org https://tripsu.cachix.org

I tried to add : echo "extra-trusted-substituters = https://$CACHIX_CACHE_NAME.cachix.org" >>~/.config/nix/nix.conf

But although the store tripsu.cachix.org contains e.g. /nix/store/qzqafi1jk15qnsxgy1j8frkjpggwdj5g-rust-default-1.81.0-nightly-2024-06-17.drv

on any of the above command:

cachix watch-exec "$CACHIX_CACHE_NAME" -- \
        nix develop ./tools/nix#ci --command true

will not download for the path again, but builds the derivation: See here: https://github.com/sdsc-ordes/tripsu/actions/runs/9980192094/job/27581254470#step:6:134

The narinfo exists:

curl https://tripsu.cachix.org/qzqafi1jk15qnsxgy1j8frkjpggwdj5g.narinfo

What is wrong here?

Version

Paste the output of $ cachix version.

cachix 1.7.4

gabyx avatar Jul 17 '24 19:07 gabyx

Are you able to verify that substitution works without wrapping the command in cachix watch-exec?

The following needs to be satisfied for substitution to work:

  1. The cache has been added to substituters.
  2. The cache's public key has been added to trusted-public-keys.
  3. The user adding the cache is a trusted-user.

sandydoo avatar Jul 17 '24 21:07 sandydoo