mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
nix/develop: Remove usage of toRealPath, replace with SourceAccessor
This commit is contained in:
parent
918a3cebaa
commit
0347958dd2
1 changed files with 6 additions and 6 deletions
|
|
@ -299,11 +299,9 @@ static StorePath getDerivationEnvironment(ref<Store> store, ref<Store> evalStore
|
||||||
|
|
||||||
for (auto & [_0, optPath] : evalStore->queryPartialDerivationOutputMap(shellDrvPath)) {
|
for (auto & [_0, optPath] : evalStore->queryPartialDerivationOutputMap(shellDrvPath)) {
|
||||||
assert(optPath);
|
assert(optPath);
|
||||||
auto & outPath = *optPath;
|
auto accessor = evalStore->requireStoreObjectAccessor(*optPath);
|
||||||
assert(store->isValidPath(outPath));
|
if (auto st = accessor->maybeLstat(CanonPath::root); st && st->fileSize.value_or(0))
|
||||||
auto outPathS = store->toRealPath(outPath);
|
return *optPath;
|
||||||
if (lstat(outPathS).st_size)
|
|
||||||
return outPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Error("get-env.sh failed to produce an environment");
|
throw Error("get-env.sh failed to produce an environment");
|
||||||
|
|
@ -502,7 +500,9 @@ struct Common : InstallableCommand, MixProfile
|
||||||
|
|
||||||
debug("reading environment file '%s'", strPath);
|
debug("reading environment file '%s'", strPath);
|
||||||
|
|
||||||
return {BuildEnvironment::parseJSON(readFile(store->toRealPath(shellOutPath))), strPath};
|
return {
|
||||||
|
BuildEnvironment::parseJSON(store->requireStoreObjectAccessor(shellOutPath)->readFile(CanonPath::root)),
|
||||||
|
strPath};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue