mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
buildenv: support very long paths
This commit is contained in:
parent
7fb7fafe0f
commit
d49140f3e4
@ -117,10 +117,20 @@ sub addPkg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Read packages list.
|
||||||
|
my $pkgs;
|
||||||
|
|
||||||
|
if (exists $ENV{"pkgsPath"}) {
|
||||||
|
open FILE, $ENV{"pkgsPath"};
|
||||||
|
$pkgs = <FILE>;
|
||||||
|
close FILE;
|
||||||
|
} else {
|
||||||
|
$pkgs = $ENV{"pkgs"}
|
||||||
|
}
|
||||||
|
|
||||||
# Symlink to the packages that have been installed explicitly by the
|
# Symlink to the packages that have been installed explicitly by the
|
||||||
# user.
|
# user.
|
||||||
for my $pkg (@{decode_json $ENV{"pkgs"}}) {
|
for my $pkg (@{decode_json $pkgs}) {
|
||||||
for my $path (@{$pkg->{paths}}) {
|
for my $path (@{$pkg->{paths}}) {
|
||||||
addPkg($path, $ENV{"ignoreCollisions"} eq "1", $pkg->{priority}) if -e $path;
|
addPkg($path, $ENV{"ignoreCollisions"} eq "1", $pkg->{priority}) if -e $path;
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,14 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
runCommand name
|
runCommand name
|
||||||
{ inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
|
rec { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
|
||||||
pkgs = builtins.toJSON (map (drv: {
|
pkgs = builtins.toJSON (map (drv: {
|
||||||
paths = [ drv ]; # FIXME: handle multiple outputs
|
paths = [ drv ]; # FIXME: handle multiple outputs
|
||||||
priority = drv.meta.priority or 5;
|
priority = drv.meta.priority or 5;
|
||||||
}) paths);
|
}) paths);
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
# XXX: The size is somewhat arbitrary
|
||||||
|
passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else null;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
${perl}/bin/perl -w ${./builder.pl}
|
${perl}/bin/perl -w ${./builder.pl}
|
||||||
|
Loading…
Reference in New Issue
Block a user