fix(libstore/build/derivation-goal): don't assert on partially valid outputs#14137
fix(libstore/build/derivation-goal): don't assert on partially valid outputs#14137Ericson2314 merged 1 commit intoNixOS:masterfrom
Conversation
|
@lovesegfault there is a second issue (duplicate for this). Is there a reason that this is still a draft? |
|
@xokdvium can you tell me how much verbosity i need to activate, which does not output too much but still answers ericsons question in my ticket. I may be able to provide this once i reproduce it again (was not able to reproduce it locally but within a CI&CD)
|
|
|
@xokdvium @lovesegfault this PR solves my problem, i cherry picked this change into 2.32.1 and the problem does not happen anymore. In addition I posted the code dump here: #14130 (comment) |
|
@h0nIg see what i wrote on the issue. I am hesitant to do this except for as a last resort, it is as a real "shove the problem underneath the rug" fix. |
0605cb5 to
76d9f5d
Compare
|
We've started hitting this internally after I updated to 2.32, so I'm going to open this as it does seem to solve the problem. Me and @xokdvium talked a bit about it today, and our best theory is that somehow there is a race to create the output, such as substitution vs building when only some outputs are cached, and then drv building races for that output. |
8c7830b to
c0534d7
Compare
c0534d7 to
9eecee3
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughIn the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Comment |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.31-maintenance
git worktree add -d .worktree/backport-14137-to-2.31-maintenance origin/2.31-maintenance
cd .worktree/backport-14137-to-2.31-maintenance
git switch --create backport-14137-to-2.31-maintenance
git cherry-pick -x 9eecee3d4e28634ef11d0044bb2e84bd8b13f2c7 |
|
Successfully created backport PR for |
## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
Changelog of fixes: ## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
Changelog of fixes: ## Bug fixes (crashes) - Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154) - Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086) - Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137) - Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729) - Fix crash on flakerefs containing newlines (NixOS/nix#14450) ## Bug fixes (functionality) - Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150) - Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515) - Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531) - Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792) - Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729) - `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861) - Fix filesystem ops in store optimization (NixOS/nix#14676) ## Bug fixes (output) - Fix double-quoting of paths in logs (NixOS/nix#14210) - Include path in world-writable error messages (NixOS/nix#14785) ## Improvements - Better git refnames validation (NixOS/nix#14253) - Use pure/restricted eval for help pages (NixOS/nix#14156) - Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134) - Correct `build-dir` error in manual (NixOS/nix#14745) ## Build system - Add mdbook 0.5 support (NixOS/nix#14690) - Drop legacy Apple SDK pattern (NixOS/nix#13976) https://github.com/NixOS/nix/releases/tag/2.31.3
Motivation
Fixes: #14130 (maybe?)
Context
Claude-aided debugging:
outanddev)out) is already valid in the storedev) is NOT validout)DerivationGoalcannot return early—it must proceed with the buildDerivationGoaldelegates toDerivationBuildingGoalto rebuild the entire derivationregisterOutputs()(derivation-builder.cc:1383-1388), already-valid outputs are skipped to avoid unnecessary re-registrationwantedOutput(out) is skipped, so it's NOT added tobuiltOutputsDerivationGoal, the code tries to filterbuiltOutputsto only containwantedOutputwantedOutputis not inbuiltOutputsI'm still trying to write a reproducer to validate...
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.