1
1
Fork 0
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:
Sergei Zimmerman 2025-10-15 00:48:39 +03:00
parent 918a3cebaa
commit 0347958dd2
No known key found for this signature in database

View file

@ -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};
}
};