nix build --rebuild on an unbuilt derivation fails with "some outputs of '...' are not valid, so checking is not possible" #485
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#485
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
If you use
nix build --rebuildornix-build --checkon a derivation that has not been built locally yet, Nix will fail with an inscrutable error message that does not indicate you should remove the--rebuildflag.Steps To Reproduce
With
unbuilt.nix:Note that this derivation will fail to build, but for a different reason:
Expected behavior
Really it should just go ahead and build the derivation, but I would settle for it telling me to remove the
--rebuildflag.nix --versionoutputAdditional context
#66 looks very similar, but it's emitted from a different code path.
dupe #281, but your report is better, so im going to close the other one.
💭 i'm going to get a good grade in bug reports, something that's normal to want & possible to achieve
This is the context where this occurs:
My view is that this check is critical to perform a check over non-locally-rebuildable derivations that exist locally in your store but are only available via substitution.
So it needs to stay. If we want to make a
bmNormalbuild take place because the original path does not exist, we need to determine earlier if we are inbmCheckand the target original path simply is unregistered (and not in an unknown state wrt corruption) then schedule a normal goal to build this and wait until its completion then resume operations including this code.This could take place in
haveDerivationaround here:Alas, this naive implementation deadlocks and I surmise this is because we are ALREADY realizing that derivation in
bmCheckmode and the goal loop is like "nah, wait for the other".correct, your
makeDerivationGoalwill return the goal you're calling this from because goals are cached with the derivation path as the cache key. building an output we don't have only to build it again directly after is arguably not even what--rebuildand--checkexpress as intent, so maybe we should just change the error message to something more meaningful?we could do that as a first thing to close this issue here then we can open a new bug for making the UX of --rebuild/--check nicer I'd say because having to build yourself once then run it again looks needlessly painful to me.
This issue was mentioned on Gerrit on the following CLs:
--checkor--rebuildshould automate recovery when feasible #1067