diff --git a/pkgs/development/compilers/rust/binary.nix b/pkgs/development/compilers/rust/binary.nix index 6c3751cbb5757..839f7a2ea1e00 100644 --- a/pkgs/development/compilers/rust/binary.nix +++ b/pkgs/development/compilers/rust/binary.nix @@ -82,9 +82,6 @@ rec { patchShebangs ./install.sh ./install.sh --prefix=$out \ --components=cargo - - wrapProgram "$out/bin/cargo" \ - --suffix PATH : "${rustc}/bin" ''; }; } diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 2d8361eb2a4e1..03add6c5c30b8 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -4,7 +4,7 @@ , CoreFoundation, Security }: -rustPlatform.buildRustPackage { +stdenv.mkDerivation { pname = "cargo"; inherit (rustc) version src; @@ -17,11 +17,26 @@ rustPlatform.buildRustPackage { # changes hash of vendor directory otherwise dontUpdateAutotoolsGnuConfigScripts = true; + configurePhase = '' + runHook preConfigure + runHook postConfigure + ''; + nativeBuildInputs = [ - pkg-config cmake installShellFiles makeWrapper + pkg-config installShellFiles makeWrapper zlib (lib.getDev pkgsHostHost.curl) + + rustc + rustPlatform.cargoSetupHook + rustPlatform.cargoInstallHook + rustPlatform.cargoBuildHook + rustPlatform.cargoCheckHook ]; - buildInputs = [ cacert file curl python3 openssl zlib ] + + cargoBuildType = "release"; + cargoCheckType = "release"; + + buildInputs = [ cacert file curl python3 openssl ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ]; # cargo uses git-rs which is made for a version of libgit2 from recent master that @@ -72,7 +87,5 @@ rustPlatform.buildRustPackage { maintainers = with maintainers; [ retrry ]; license = [ licenses.mit licenses.asl20 ]; platforms = platforms.unix; - # weird segfault in a build script - broken = stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic; }; } diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index cfed71f0e80bd..3bd0905b90cc4 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -133,6 +133,8 @@ in stdenv.mkDerivation rec { # Useful debugging parameter # export VERBOSE=1 + + sed -i "s/base.crt_static_default = true/base.crt_static_default = false/" compiler/rustc_target/src/spec/linux_musl_base.rs ''; # rustc unfortunately needs cmake to compile llvm-rt but doesn't