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)) {
|
||||
assert(optPath);
|
||||
auto & outPath = *optPath;
|
||||
assert(store->isValidPath(outPath));
|
||||
auto outPathS = store->toRealPath(outPath);
|
||||
if (lstat(outPathS).st_size)
|
||||
return outPath;
|
||||
auto accessor = evalStore->requireStoreObjectAccessor(*optPath);
|
||||
if (auto st = accessor->maybeLstat(CanonPath::root); st && st->fileSize.value_or(0))
|
||||
return *optPath;
|
||||
}
|
||||
|
||||
throw Error("get-env.sh failed to produce an environment");
|
||||
|
|
@ -502,7 +500,9 @@ struct Common : InstallableCommand, MixProfile
|
|||
|
||||
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