3
0
Fork 0
forked from mirrors/nixpkgs

Move stdenv bootstrap binaries out of the tree

Commit 986f361946 started to use
<nix/fetchurl.nix> to "download" the bootstrap binaries from the
Nixpkgs tree, using the file:/// scheme. This has really bad
consequences:

* It makes any derivation depend on the path of the Nixpkgs tree. So
  evaluating a package will produce a different .drv file when run
  from different locations. No wonder Hydra evaluation has been so
  slow lately: for every Nixpkgs evaluation, it had to create tens of
  thousands of .drv files, even if nothing had changed.

* It requires the builder to have file system access to the Nixpkgs
  tree. So if your tree is in your home directory, the stdenv
  bootstrap would probably fail.

So now the binaries are downloaded from tarballs.nixos.org.

Also dropped PowerPC "support".
This commit is contained in:
Eelco Dolstra 2014-04-20 01:16:12 +02:00
parent c49404547b
commit d4f44d6db3
28 changed files with 17 additions and 175 deletions

View file

@ -1,35 +1,11 @@
let fetch = { file, sha256 }:
let
nixFetchurl = import <nix/fetchurl.nix>;
args = {
url = "file://${builtins.toString ./.}/${file}";
inherit sha256;
executable = true;
};
in if (builtins.functionArgs nixFetchurl) ? executable
then nixFetchurl args
else derivation {
name = file;
builder = "/bin/sh";
let
system = builtins.currentSystem;
fetch = { file, sha256 }: import <nix/fetchurl.nix> {
url = "http://tarballs.nixos.org/stdenv-linux/armv5tel/r18744/${file}";
inherit sha256;
executable = true;
};
args = [ "-c" "echo $message; exit 1" ];
message = ''
Sorry, this version of nix cannot download all of the bootstrap tools.
Please download ${args.url}, make it executable, add it to the store
with `nix-store --add', and try again.
'';
outputHashAlgo = "sha256";
outputHash = args.sha256;
outputHashMode = "recursive";
preferLocalBuild = true;
};
in {
sh = fetch {
file = "sh";

View file

@ -1,36 +1,11 @@
let
fetch = { file, sha256 }:
let
nixFetchurl = import <nix/fetchurl.nix>;
args = {
url = "file://${builtins.toString ./.}/${file}";
inherit sha256;
executable = true;
};
in if (builtins.functionArgs nixFetchurl) ? executable
then nixFetchurl args
else derivation {
name = file;
builder = "/bin/sh";
system = builtins.currentSystem;
fetch = { file, sha256 }: import <nix/fetchurl.nix> {
url = "http://tarballs.nixos.org/stdenv-linux/i686/r24519/${file}";
inherit sha256;
executable = true;
};
args = [ "-c" "echo $message; exit 1" ];
message = ''
Sorry, this version of nix cannot download all of the bootstrap tools.
Please download ${args.url}, make it executable, add it to the store
with `nix-store --add', and try again.
'';
outputHashAlgo = "sha256";
outputHash = args.sha256;
outputHashMode = "recursive";
preferLocalBuild = true;
};
in {
sh = fetch {
file = "sh";
@ -52,11 +27,6 @@ in {
sha256 = "046if3aqqramyhrn2yxrjf4bfkl8x1bcqxhvi7ml9nrv9smx8irg";
};
ln = fetch {
file = "ln";
sha256 = "06vr474i3x55p0rnqa87yx7dzf4qdfpfg201mks39id43cjm9f8j";
};
curl = fetch {
file = "curl.bz2";
sha256 = "1v0yfb4gcdyqpl2fxlxjh337r28c23iqm7vwck4p4643xd55di7q";

Binary file not shown.

Binary file not shown.

View file

@ -1,36 +1,11 @@
let
fetch = { file, sha256 }:
let
nixFetchurl = import <nix/fetchurl.nix>;
args = {
url = "file://${builtins.toString ./.}/${file}";
inherit sha256;
executable = true;
};
in if (builtins.functionArgs nixFetchurl) ? executable
then nixFetchurl args
else derivation {
name = file;
builder = "/bin/sh";
system = builtins.currentSystem;
fetch = { file, sha256 }: import <nix/fetchurl.nix> {
url = "http://tarballs.nixos.org/stdenv-linux/loongson2f/r22849/${file}";
inherit sha256;
executable = true;
};
args = [ "-c" "echo $message; exit 1" ];
message = ''
Sorry, this version of nix cannot download all of the bootstrap tools.
Please download ${args.url}, make it executable, add it to the store
with `nix-store --add', and try again.
'';
outputHashAlgo = "sha256";
outputHash = args.sha256;
outputHashMode = "recursive";
preferLocalBuild = true;
};
in {
sh = fetch {
file = "sh";

View file

@ -1,79 +0,0 @@
let
fetch = { file, sha256 }:
let
nixFetchurl = import <nix/fetchurl.nix>;
args = {
url = "file://${builtins.toString ./.}/${file}";
inherit sha256;
executable = true;
};
in if (builtins.functionArgs nixFetchurl) ? executable
then nixFetchurl args
else derivation {
name = file;
builder = "/bin/sh";
system = builtins.currentSystem;
args = [ "-c" "echo $message; exit 1" ];
message = ''
Sorry, this version of nix cannot download all of the bootstrap tools.
Please download ${args.url}, make it executable, add it to the store
with `nix-store --add', and try again.
'';
outputHashAlgo = "sha256";
outputHash = args.sha256;
outputHashMode = "recursive";
preferLocalBuild = true;
};
in {
bash = fetch {
file = "bash";
sha256 = "0zss8im6hbx6z2i2wxn1554kd7ggdqdli4xk39cy5fchlnz9bqpp";
};
bzip2 = fetch {
file = "bzip2";
sha256 = "01ylj8x7albv6k9sqx2h1prsazh4d8y22nga0pwai2bnns0q9qdg";
};
cp = fetch {
file = "cp";
sha256 = "0d7xbzrv22bxgw7w9b03rakirna5zfvr9gzwm7ichd2fh634hvgl";
};
curl = fetch {
file = "curl.bz2";
sha256 = "17c25dfslw3qkjlcmihpbhn3x4kj9pgkslizv89ggnki7iiy4jgh";
};
tar = fetch {
file = "tar.bz2";
sha256 = "132ylqwz02hw5njqx7wvj4sxpcrllx8b8b3a00rlv6iad671ayyr";
};
staticToolsURL = {
url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/static-tools.tar.bz2;
sha1 = "e4d1680e3dfa752e49a996a31140db53b10061cb";
};
binutilsURL = {
url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/binutils.tar.bz2;
sha1 = "2609f4d9277a60fcd178395d3d49911190e08f36";
};
gccURL = {
url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/gcc.tar.bz2;
sha1 = "71d79d736bfef6252208fe6239e528a591becbed";
};
glibcURL = {
url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/glibc.tar.bz2;
sha1 = "bf0245e16235800c8aa9c6a5de6565583a66e46d";
};
}

View file

@ -16,7 +16,6 @@ rec {
bootstrapFiles =
if system == "i686-linux" then import ./bootstrap/i686
else if system == "x86_64-linux" then import ./bootstrap/x86_64
else if system == "powerpc-linux" then import ./bootstrap/powerpc
else if system == "armv5tel-linux" then import ./bootstrap/armv5tel
else if system == "armv6l-linux" then import ./bootstrap/armv6l
else if system == "armv7l-linux" then import ./bootstrap/armv6l
@ -52,6 +51,7 @@ rec {
then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
else [ ./scripts/unpack-bootstrap-tools.sh ];
# FIXME: get rid of curl.
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
tarball = import <nix/fetchurl.nix> {