From 891fee7487d9e233c85ea8cf2cfb681daf72fda0 Mon Sep 17 00:00:00 2001 From: Raghav Sood Date: Tue, 14 May 2024 00:08:24 +0800 Subject: [PATCH 1/2] cargo-bisect-rustc: nixfmt-rfc-style --- .../tools/rust/cargo-bisect-rustc/default.nix | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix b/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix index 5c7d0d57fde0..39056d826ed7 100644 --- a/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix +++ b/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix @@ -1,13 +1,14 @@ -{ stdenv -, lib -, fetchFromGitHub -, rustPlatform -, pkg-config -, openssl -, runCommand -, patchelf -, zlib -, Security +{ + stdenv, + lib, + fetchFromGitHub, + rustPlatform, + pkg-config, + openssl, + runCommand, + patchelf, + zlib, + Security, }: rustPlatform.buildRustPackage rec { @@ -23,41 +24,41 @@ rustPlatform.buildRustPackage rec { patches = let - patchelfPatch = runCommand "0001-dynamically-patchelf-binaries.patch" - { - CC = stdenv.cc; - patchelf = patchelf; - libPath = "$ORIGIN/../lib:${lib.makeLibraryPath [ zlib ]}"; - } - '' - export dynamicLinker=$(cat $CC/nix-support/dynamic-linker) - substitute ${./0001-dynamically-patchelf-binaries.patch} $out \ - --subst-var patchelf \ - --subst-var dynamicLinker \ - --subst-var libPath - ''; + patchelfPatch = + runCommand "0001-dynamically-patchelf-binaries.patch" + { + CC = stdenv.cc; + patchelf = patchelf; + libPath = "$ORIGIN/../lib:${lib.makeLibraryPath [ zlib ]}"; + } + '' + export dynamicLinker=$(cat $CC/nix-support/dynamic-linker) + substitute ${./0001-dynamically-patchelf-binaries.patch} $out \ + --subst-var patchelf \ + --subst-var dynamicLinker \ + --subst-var libPath + ''; in lib.optionals stdenv.isLinux [ patchelfPatch ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - openssl - ] ++ lib.optionals stdenv.isDarwin [ - Security - ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ]; cargoHash = "sha256-CgEs0cejquFRY3VN6CgbE23Gipg+LEuWp/jSIkITrjw="; checkFlags = [ - "--skip test_github" # requires internet + "--skip test_github" # requires internet ]; meta = with lib; { description = "Bisects rustc, either nightlies or CI artifacts"; mainProgram = "cargo-bisect-rustc"; homepage = "https://github.com/rust-lang/cargo-bisect-rustc"; - license = with licenses; [ asl20 mit ]; + license = with licenses; [ + asl20 + mit + ]; maintainers = with maintainers; [ davidtwco ]; }; } From 182513d558534c79e0666904a1454c4e405b61a3 Mon Sep 17 00:00:00 2001 From: Raghav Sood Date: Tue, 14 May 2024 00:10:12 +0800 Subject: [PATCH 2/2] cargo-bisect-rustc: fix darwin build --- .../tools/rust/cargo-bisect-rustc/default.nix | 9 +++++++-- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix b/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix index 39056d826ed7..9babac9ebade 100644 --- a/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix +++ b/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix @@ -2,13 +2,13 @@ stdenv, lib, fetchFromGitHub, + darwin, rustPlatform, pkg-config, openssl, runCommand, patchelf, zlib, - Security, }: rustPlatform.buildRustPackage rec { @@ -43,7 +43,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ]; + buildInputs = + [ openssl ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.SystemConfiguration + ]; cargoHash = "sha256-CgEs0cejquFRY3VN6CgbE23Gipg+LEuWp/jSIkITrjw="; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6aab5726b385..ad091e5eea7f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16618,9 +16618,7 @@ with pkgs; }; cargo-benchcmp = callPackage ../development/tools/rust/cargo-benchcmp { }; cargo-binstall = callPackage ../development/tools/rust/cargo-binstall { }; - cargo-bisect-rustc = callPackage ../development/tools/rust/cargo-bisect-rustc { - inherit (darwin.apple_sdk.frameworks) Security; - }; + cargo-bisect-rustc = callPackage ../development/tools/rust/cargo-bisect-rustc { }; cargo-bitbake = callPackage ../development/tools/rust/cargo-bitbake { }; cargo-c = callPackage ../development/tools/rust/cargo-c { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;