mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Make nix-shell
support content-addressed derivations
Resolve the derivation before trying to load its environment − essentially reproducing what the build loop does − so that we can effectively access our dependencies (and not just their placeholders). Fix #4821
This commit is contained in:
parent
8e6ee1b9e9
commit
56605b4688
5 changed files with 42 additions and 6 deletions
|
@ -387,6 +387,13 @@ static void main_nix_build(int argc, char * * argv)
|
|||
|
||||
if (dryRun) return;
|
||||
|
||||
if (settings.isExperimentalFeatureEnabled("ca-derivations")) {
|
||||
auto resolvedDrv = drv.tryResolve(*store);
|
||||
if (!resolvedDrv)
|
||||
throw Error("unable to resolve the derivation '%s'. nix-shell can’t continue", drvInfo.queryDrvPath());
|
||||
drv = *resolvedDrv;
|
||||
}
|
||||
|
||||
// Set the environment.
|
||||
auto env = getEnv();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue