fix(3p/nix): passAsFile: leave out the hash prefix
Having a colon in the path may cause issues, and having the hash function indicated isn't actually necessary. We now verify the path format in the tests to prevent regressions. (cherry picked from commit c65a6fa86aef7bdf51fb4fba7bd31d265619ba3f)
This commit is contained in:
parent
7cc7fdacbe
commit
48f08e8cc0
2 changed files with 2 additions and 1 deletions
2
third_party/nix/src/libstore/build.cc
vendored
2
third_party/nix/src/libstore/build.cc
vendored
|
@ -2490,7 +2490,7 @@ void DerivationGoal::initTmpDir() {
|
|||
env[i.first] = i.second;
|
||||
} else {
|
||||
auto hash = hashString(htSHA256, i.first);
|
||||
std::string fn = ".attr-" + hash.to_string();
|
||||
std::string fn = ".attr-" + hash.to_string(Base32, false);
|
||||
Path p = tmpDir + "/" + fn;
|
||||
writeFile(p, rewriteStrings(i.second, inputRewrites));
|
||||
chownToBuilder(p);
|
||||
|
|
1
third_party/nix/tests/pass-as-file.sh
vendored
1
third_party/nix/tests/pass-as-file.sh
vendored
|
@ -10,6 +10,7 @@ mkDerivation {
|
|||
passAsFile = [ \"foo\" ];
|
||||
foo = [ \"xyzzy\" ];
|
||||
builder = builtins.toFile \"builder.sh\" ''
|
||||
[ \"\$(basename \$fooPath)\" = .attr-1bp7cri8hplaz6hbz0v4f0nl44rl84q1sg25kgwqzipzd1mv89ic ]
|
||||
[ \"\$(cat \$fooPath)\" = xyzzy ]
|
||||
touch \$out
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue