Also pass unwanted outputs to post-build-hook#7721
Conversation
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
What does the Yes, this fixes a practical problem, but if the semantics of the hook differ based on how the store object was obtained, I feel a bit uncomfortable about that. |
|
Is this likely the underlying bug for my observation that only a single output from a multi-output derivation is uploaded to s3 cache? post-hook is #!/bin/sh
set -eu
set -f # disable globbing
export IFS=' '
exec nix copy --to "s3://<store-uri>?endpoint=https://storage.googleapis.com" $OUT_PATHSI'm using nix 2.8.1 |
|
@Ericson2314 the post-build-hook was never called for substituted paths, and doing so wouldn't really fit common usage (uploading everything you build to a cache somewhere). @ollie-etl the difference comes because, before this bug, a build of |
|
@yorickvP Here i'm building |
f4aaefb to
0096153
Compare
|
Refactored it quite a bit, moved the |
0249983 to
afa1b32
Compare
|
I spent a while debugging the test, but copying only the outputs doesn't seem to be sufficient for the CA test in any case (without my patch aswell). @thufschmitt do you know if that's correct and supposed to be the case? |
Yes, it is. It's explained a bit more in https://www.tweag.io/blog/2021-02-17-derivation-outputs-and-output-paths/, but the gist of it is that with CA derivations there's a split between the output path and the information “this Derivation built this output path”. So if you want to be able to fetch “the output of this derivation” then you must copy exactly that ( |
|
Okay, in that case this will have to suffice |
|
Any news here? |
69fc5ec to
d0ad022
Compare
d0ad022 to
4620d92
Compare
|
@thufschmitt rebased, please review |
|
@thufschmitt @yorickvP Is this dead? |
thufschmitt
left a comment
There was a problem hiding this comment.
Sorry for taking so long at reaching here.
I'm still a bit sad this can't be a more local change, but it does fix the problem while making the code marginally more sensible. So let's roll!
There was a problem hiding this comment.
That's unrelated to this PR, but this file is weird 🤔
|
@yorickvP can I let you rebase one last time? The conflicts seem mostly benign |
fe5509d caused only wanted outputs to be passed to the post-build-hook, which resulted in paths being built without ever going into the hook. This commit adds a (currently failing) test for this.
|
Rebased, but the DrvOutputs -> SingleDrvOutputs thing was not entirely trivial. Let's see if the tests pass. |
thufschmitt
left a comment
There was a problem hiding this comment.
It's all passing, and looking good 🚀
thufschmitt
left a comment
There was a problem hiding this comment.
It's all passing, and looking good 🚀
Motivation
#6311 caused only wanted outputs to be passed to the post-build-hook, causing #6960.
Context
Fixes #6960
For a long time, the post-build-hook was passed all built store paths. This changed, causing some breakage.
DerivationGoal::checkPathValidity,DerivationGoal::registerOutputs,DerivationGoal::assertPathValidity.Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.shsrc/*/teststests/nixos/*