cache-nix-action
cache-nix-action copied to clipboard
[BUG] Restoring cache appears to be missing files (e.g. libgcc_s.so.1)
Describe the bug
When building in a restored cache, the builder is unable to find libgcc_s.so.1.
This leads to various errors, such as:
/nix/store/00mg4vlhzmm7gi9bd5v5ydjlgrywpc3n-go-1.22.3/share/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/nix/store/bgcaxhhxswzvmxjbbgvvaximm5hwghz1-binutils-2.41/bin/ld: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
when building a go service via gomod2nix or
closure-paths> python3: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
error: builder for '/nix/store/gyb8h4dps65bbk6x6is9mxhg2akdv7vv-closure-paths.drv' failed with exit code 127
when building a docker image via dockerTools.buildLayeredImage.
To Reproduce
(Currently the error occurs in a private repo. I plan on re-creating it in a public repo for easier reproduction, but I wanted to report the issue first nonetheless)
Steps to reproduce would include:
- Run workflow successful with caching enabled (
auto-optimize-store = false,sandbox = true), observe that all build targets get built successfully. - Run the exact same workflow again with minor modifications to the source code or docker image contents, this time restoring the newly created crash.
- Observe one of the errors above, depending on which workflow was triggered.
Expected behavior
Restoring the cache should restore all files; to nix, it should not make a difference.
Additional context
A workaround is simply disabling the cache for now, but I want to understand what is going on… :wink: