-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug #6383 #6484
debug #6383 #6484
Conversation
7a19904
to
0075fa9
Compare
@@ -988,13 +988,28 @@ void DerivationGoal::resolvedFinished() | |||
auto resolvedHash = get(resolvedHashes, wantedOutput); | |||
if ((!initialOutput) || (!resolvedHash)) | |||
throw Error( | |||
"derivation '%s' doesn't have expected output '%s' (derivation-goal.cc/resolvedFinished,resolve)", | |||
"derivation '%s' doesn't have expected output '%s'", | |||
worker.store.printStorePath(drvPath), wantedOutput); | |||
auto realisation = get(resolvedResult.builtOutputs, DrvOutput { *resolvedHash, wantedOutput }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example failure (reported by @trofi):
error: derivation '/nix/store/g7q24qrdzdcvsirxw8aw0alc9s0qsl77-shared-mime-info-unstable-2021-12-03.drv' doesn't have expected output 'dev @ sha256:094p4p14vbmqhhd2g4nr08phln6hr789rzqnjwll9q79kisc7n7g'
builtOutputs:
out @ sha256:094p4p14vbmqhhd2g4nr08phln6hr789rzqnjwll9q79kisc7n7g (key) = /nix/store/98f30ch5mldzkw0zznx2s2ll6r940jv3-shared-mime-info-unstable-2021-12-03
=> hash matches, but the wanted output is not part of the built outputs.
I am a little confused what is going with all the explicit construction; are you thinking what we did before is more unsafe than we think? |
Most of the explicit construction is to make sure that strings are still valid when used, and that the types used are correct (the only important cases are |
This PR inserts the missing debug output to better diagnose what went wrong in #6383; and fixes a potential use-after-free via
getOr
.The main problem is that the error might take a long time to appear, but once it appears is reproducible if the build output is really required (and not just because the output got pulled in by a full build, but is not used by any other derivation)