summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2020-01-18 10:57:13 +0100
committerDaiderd Jordan <daiderd@gmail.com>2020-01-18 10:57:13 +0100
commit8df4338f51d91279c5d87f1447fcbda434abc633 (patch)
tree7a0a47dffdce2f0d59b44ba0941dc61eba0b36f3 /pkgs
parentbcd8c6b8dce40e62cbe70031f7def119b8b16c0c (diff)
downloadnixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar.gz
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar.bz2
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar.lz
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar.xz
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.tar.zst
nixpkgs-8df4338f51d91279c5d87f1447fcbda434abc633.zip
rustPackages: make rustc-dev optional
This was only introduced in 1.40.0 and doesn't work on older versions.

    thread 'main' panicked at 'Error: no rules matched rustc-dev.', src/bootstrap/builder.rs:231:21
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
    failed to run: /build/rustc-1.38.0-src/build/bootstrap/debug/bootstrap dist rustc-dev
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/rust/1_38_0.nix1
-rw-r--r--pkgs/development/compilers/rust/default.nix2
-rw-r--r--pkgs/development/compilers/rust/rustc.nix4
3 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/compilers/rust/1_38_0.nix b/pkgs/development/compilers/rust/1_38_0.nix
index be43e074228..13d2139bffd 100644
--- a/pkgs/development/compilers/rust/1_38_0.nix
+++ b/pkgs/development/compilers/rust/1_38_0.nix
@@ -1,6 +1,7 @@
 import ./default.nix {
   rustcVersion = "1.38.0";
   rustcSha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4";
+  enableRustcDev = false;
 
   # Note: the version MUST be one version prior to the version we're
   # building
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 60e31c6def4..da3421a987d 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -1,5 +1,6 @@
 { rustcVersion
 , rustcSha256
+, enableRustcDev ? true
 , bootstrapVersion
 , bootstrapHashes
 , selectRustPackage
@@ -70,6 +71,7 @@
       rustc = self.callPackage ./rustc.nix ({
         version = rustcVersion;
         sha256 = rustcSha256;
+        inherit enableRustcDev;
 
         # Use boot package set to break cycle
         rustPlatform = bootRustPlatform;
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 2c235a12b31..b0c26f3dffd 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -4,6 +4,7 @@
 , pkgconfig, openssl
 , which, libffi
 , withBundledLLVM ? false
+, enableRustcDev ? true
 , version
 , sha256
 }:
@@ -132,12 +133,13 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "man" "doc" ];
   setOutputFlags = false;
 
-  postInstall = ''
+  postInstall = stdenv.lib.optionalString enableRustcDev ''
     # install rustc-dev components. Necessary to build rls, clippy...
     python x.py dist rustc-dev
     tar xf build/dist/rustc-dev*tar.gz
     cp -r rustc-dev*/rustc-dev*/lib/* $out/lib/
 
+  '' + ''
     # remove references to llvm-config in lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
     # and thus a transitive dependency on ncurses
     find $out/lib -name "*.so" -type f -exec remove-references-to -t ${llvmShared} '{}' '+'