-
-
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
LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed builds #8053
LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed builds #8053
Conversation
@@ -1154,10 +1154,10 @@ void LocalDerivationGoal::writeStructuredAttrs() | |||
|
|||
writeFile(tmpDir + "/.attrs.sh", rewriteStrings(jsonSh, inputRewrites)); | |||
chownToBuilder(tmpDir + "/.attrs.sh"); | |||
env["NIX_ATTRS_SH_FILE"] = tmpDir + "/.attrs.sh"; | |||
env["NIX_ATTRS_SH_FILE"] = env["NIX_BUILD_TOP"] + "/.attrs.sh"; |
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.
env["NIX_ATTRS_SH_FILE"] = env["NIX_BUILD_TOP"] + "/.attrs.sh"; | |
env["NIX_ATTRS_SH_FILE"] = tmpDirInSandbox + "/.attrs.sh"; |
writeFile(tmpDir + "/.attrs.json", rewriteStrings(json.dump(), inputRewrites)); | ||
chownToBuilder(tmpDir + "/.attrs.json"); | ||
env["NIX_ATTRS_JSON_FILE"] = tmpDir + "/.attrs.json"; | ||
env["NIX_ATTRS_JSON_FILE"] = env["NIX_BUILD_TOP"] + "/.attrs.json"; |
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.
env["NIX_ATTRS_JSON_FILE"] = env["NIX_BUILD_TOP"] + "/.attrs.json"; | |
env["NIX_ATTRS_JSON_FILE"] = tmpDirInSandbox + "/.attrs.json"; |
bf7e34e
to
af4cbda
Compare
It'd be great to get a test in place for this behavior, too. |
Successfully created backport PR for |
Successfully created backport PR for |
Motivation
NIX_ATTRS_JSON_FILE
was set to the out-of-sandbox path even in sandboxed builds.Context
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.