Skip to content

rust: update to 0.10 release#2398

Merged
thoughtpolice merged 1 commit intoNixOS:masterfrom
cstrahan:rust-update
May 18, 2014
Merged

rust: update to 0.10 release#2398
thoughtpolice merged 1 commit intoNixOS:masterfrom
cstrahan:rust-update

Conversation

@cstrahan
Copy link
Contributor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to update the version here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! :D

@madjar
Copy link
Member

madjar commented Apr 30, 2014

Thanks a lot for updating this!

I can't build it on my nixos x86_64: it tries to download the snapshot rust-stage0-2014-03-28-b8601a3-linux-x86_64-a7b2af1076d48e4a687a71a21478293e834349bd.tar.bz2, which is not the one specified in the expression.

Do you build it in a chroot to make sure it doesn't download the snapshot during the build?

@cstrahan
Copy link
Contributor Author

cstrahan commented May 1, 2014

Sure thing!

I'll double check everything and follow up shortly.

@cstrahan
Copy link
Contributor Author

Ok, I've pushed some changes. The snapshot now uses mkDerivation like any other software, and a couple configure options are passed along to make the build system use the snapshot. I've set useChroot = true in my config.nix, and it's in the process of being built.

@cstrahan
Copy link
Contributor Author

Well, that didn't work:

make[1]: Leaving directory `/private/var/folders/ll/jzfpr6bj6px5ln438v15ngk80000gn/T/nix-build-rust-0.10.drv-0/rust-0.10/src/compiler-rt'
building x86_64-apple-darwin/rt/libbacktrace.a
touch x86_64-apple-darwin/rt/libbacktrace.a
building x86_64-apple-darwin/stage0/bin/rustc
fetch: x86_64-apple-darwin/stage0/bin/rustc
cp: cannot stat '/nix/store/dpcfcxl6ayh70sryb9331dq7iqn8c1jr-rust-stage0/lib/rustlib/x86_64-apple-darwin/lib/*': No such file or directory
cp: cannot stat '/nix/store/dpcfcxl6ayh70sryb9331dq7iqn8c1jr-rust-stage0/lib/libextra*.dylib': No such file or directory
cp: cannot stat '/nix/store/dpcfcxl6ayh70sryb9331dq7iqn8c1jr-rust-stage0/lib/librust*.dylib': No such file or directory
cp: cannot stat '/nix/store/dpcfcxl6ayh70sryb9331dq7iqn8c1jr-rust-stage0/lib/libstd*.dylib': No such file or directory
cp: cannot stat '/nix/store/dpcfcxl6ayh70sryb9331dq7iqn8c1jr-rust-stage0/lib/libsyntax*.dylib': No such file or directory
make: *** [x86_64-apple-darwin/stage0/bin/rustc] Error 1
builder for `/nix/store/v1a80hzyf1aiy0gx53kw34ff2kxc0hww-rust-0.10.drv' failed with exit code 2
error: build of `/nix/store/v1a80hzyf1aiy0gx53kw34ff2kxc0hww-rust-0.10.drv' failed

I'll have to give it a little more thought...

@cstrahan
Copy link
Contributor Author

Alright, I added a new patch to remove those problematic calls to cp. Re-running the build...

@madjar
Copy link
Member

madjar commented May 12, 2014

On linux, the binaries need to be patched in order to work, so I did a little modification:

diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 39f79af..bb58821 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -50,7 +50,12 @@ stdenv.mkDerivation {
     installPhase = ''
       mkdir -p "$out"
       cp -r bin "$out/bin"
-    '';
+    '' + (if stdenv.isLinux then ''
+      patchelf --interpreter ${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker} \
+               --set-rpath ${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/ \
+               $out/bin/rustc
+    '' else "");
+
   };

   configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ];

With this, everything seems to work.

@cstrahan
Copy link
Contributor Author

@madjar - Oh, I thought the rustc binary would be patched & stripped during the snapshot derivation's fixup phase. It sounds like that's not the case though, so I've amended the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants