mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Fix misleading error messages for missing NARs due to stale cache
When Nix's SQLite narinfo cache indicates a NAR exists, but the NAR has been garbage collected from the binary cache, Nix displays error messages even though the operation succeeds via fallback. This is misleading because the cached narinfo is simply outdated. This changes SubstituteGone exceptions to produce warnings instead of errors, accurately reflecting that this is an expected cache coherency issue, not an actual failure. Fixes #11411 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7e8db2eb59
commit
459f9e0185
2 changed files with 12 additions and 4 deletions
|
|
@ -111,7 +111,13 @@ clearStore
|
|||
|
||||
mv "$cacheDir/nar" "$cacheDir/nar2"
|
||||
|
||||
nix-build --substituters "file://$cacheDir" --no-require-sigs dependencies.nix -o "$TEST_ROOT/result"
|
||||
nix-build --substituters "file://$cacheDir" --no-require-sigs dependencies.nix -o "$TEST_ROOT/result" 2>&1 | tee "$TEST_ROOT/log"
|
||||
|
||||
# Verify that missing NARs produce warnings, not errors
|
||||
# The build should succeed despite the warnings
|
||||
grepQuiet "does not exist in binary cache" "$TEST_ROOT/log"
|
||||
# Ensure the message is not at error level by checking that the command succeeded
|
||||
[ -e "$TEST_ROOT/result" ]
|
||||
|
||||
mv "$cacheDir/nar2" "$cacheDir/nar"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue