Skip to content

Commit 0347958

Browse files
committed
nix/develop: Remove usage of toRealPath, replace with SourceAccessor
1 parent 918a3ce commit 0347958

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/nix/develop.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,9 @@ static StorePath getDerivationEnvironment(ref<Store> store, ref<Store> evalStore
299299

300300
for (auto & [_0, optPath] : evalStore->queryPartialDerivationOutputMap(shellDrvPath)) {
301301
assert(optPath);
302-
auto & outPath = *optPath;
303-
assert(store->isValidPath(outPath));
304-
auto outPathS = store->toRealPath(outPath);
305-
if (lstat(outPathS).st_size)
306-
return outPath;
302+
auto accessor = evalStore->requireStoreObjectAccessor(*optPath);
303+
if (auto st = accessor->maybeLstat(CanonPath::root); st && st->fileSize.value_or(0))
304+
return *optPath;
307305
}
308306

309307
throw Error("get-env.sh failed to produce an environment");
@@ -502,7 +500,9 @@ struct Common : InstallableCommand, MixProfile
502500

503501
debug("reading environment file '%s'", strPath);
504502

505-
return {BuildEnvironment::parseJSON(readFile(store->toRealPath(shellOutPath))), strPath};
503+
return {
504+
BuildEnvironment::parseJSON(store->requireStoreObjectAccessor(shellOutPath)->readFile(CanonPath::root)),
505+
strPath};
506506
}
507507
};
508508

0 commit comments

Comments
 (0)