Merge pull request #77972 from LnL7/enable-rustc-dev
rustPackages: make rustc-dev optional
This commit is contained in:
commit
778f317820
@ -1,6 +1,7 @@
|
|||||||
import ./default.nix {
|
import ./default.nix {
|
||||||
rustcVersion = "1.38.0";
|
rustcVersion = "1.38.0";
|
||||||
rustcSha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4";
|
rustcSha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4";
|
||||||
|
enableRustcDev = false;
|
||||||
|
|
||||||
# Note: the version MUST be one version prior to the version we're
|
# Note: the version MUST be one version prior to the version we're
|
||||||
# building
|
# building
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{ rustcVersion
|
{ rustcVersion
|
||||||
, rustcSha256
|
, rustcSha256
|
||||||
|
, enableRustcDev ? true
|
||||||
, bootstrapVersion
|
, bootstrapVersion
|
||||||
, bootstrapHashes
|
, bootstrapHashes
|
||||||
, selectRustPackage
|
, selectRustPackage
|
||||||
@ -70,6 +71,7 @@
|
|||||||
rustc = self.callPackage ./rustc.nix ({
|
rustc = self.callPackage ./rustc.nix ({
|
||||||
version = rustcVersion;
|
version = rustcVersion;
|
||||||
sha256 = rustcSha256;
|
sha256 = rustcSha256;
|
||||||
|
inherit enableRustcDev;
|
||||||
|
|
||||||
# Use boot package set to break cycle
|
# Use boot package set to break cycle
|
||||||
rustPlatform = bootRustPlatform;
|
rustPlatform = bootRustPlatform;
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
, pkgconfig, openssl
|
, pkgconfig, openssl
|
||||||
, which, libffi
|
, which, libffi
|
||||||
, withBundledLLVM ? false
|
, withBundledLLVM ? false
|
||||||
|
, enableRustcDev ? true
|
||||||
, version
|
, version
|
||||||
, sha256
|
, sha256
|
||||||
}:
|
}:
|
||||||
@ -132,12 +133,13 @@ in stdenv.mkDerivation rec {
|
|||||||
outputs = [ "out" "man" "doc" ];
|
outputs = [ "out" "man" "doc" ];
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = stdenv.lib.optionalString enableRustcDev ''
|
||||||
# install rustc-dev components. Necessary to build rls, clippy...
|
# install rustc-dev components. Necessary to build rls, clippy...
|
||||||
python x.py dist rustc-dev
|
python x.py dist rustc-dev
|
||||||
tar xf build/dist/rustc-dev*tar.gz
|
tar xf build/dist/rustc-dev*tar.gz
|
||||||
cp -r rustc-dev*/rustc-dev*/lib/* $out/lib/
|
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
|
# 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
|
# and thus a transitive dependency on ncurses
|
||||||
find $out/lib -name "*.so" -type f -exec remove-references-to -t ${llvmShared} '{}' '+'
|
find $out/lib -name "*.so" -type f -exec remove-references-to -t ${llvmShared} '{}' '+'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user