diff options
author | Guillaume Girol <symphorien@users.noreply.github.com> | 2023-06-18 09:27:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-18 09:27:44 +0000 |
commit | f8602fa508510f77d41b3d71e85fd682a0e5c8c4 (patch) | |
tree | 25501cca51108b7747dab0653b1c5bc84604aab1 /pkgs/build-support | |
parent | 30c0a2f73819cc71ff5ff270f6ae4aaafaf954ea (diff) |
Revert "build-rust-{crate,package}: cleanups"
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/build-crate.nix | 6 | ||||
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/rust/build-rust-package/default.nix | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 82560012d17bc..37bf3ec26f770 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -7,7 +7,7 @@ dependencies, crateFeatures, crateRenames, libName, release, libPath, crateType, metadata, crateBin, hasCrateBin, - extraRustcOpts, + extraRustcOpts, verbose, colors, buildTests, codegenUnits }: @@ -40,7 +40,9 @@ ++ (map (x: "--crate-type ${x}") crateType) ); - binRustcOpts = lib.concatStringsSep " " baseRustcOpts; + binRustcOpts = lib.concatStringsSep " " ( + baseRustcOpts + ); build_bin = if buildTests then "build_bin_test" else "build_bin"; in '' diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index ee96c873f54b0..f6079b7316d61 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -300,7 +300,7 @@ crate_: lib.makeOverridable (crate.features ++ features) ); - libName = crate.libName or crate.crateName; + libName = if crate ? libName then crate.libName else crate.crateName; libPath = lib.optionalString (crate ? libPath) crate.libPath; # Seed the symbol hashes with something unique every time. @@ -329,7 +329,7 @@ crate_: lib.makeOverridable colors = lib.attrByPath [ "colors" ] "always" crate; extraLinkFlags = lib.concatStringsSep " " (crate.extraLinkFlags or [ ]); edition = crate.edition or null; - codegenUnits = crate.codegenUnits or 1; + codegenUnits = if crate ? codegenUnits then crate.codegenUnits else 1; extraRustcOpts = lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts ++ extraRustcOpts_ diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 905ec5b98c3be..9b2e62fc240a6 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -34,6 +34,7 @@ , buildInputs ? [] , nativeBuildInputs ? [] , cargoUpdateHook ? "" +, cargoDepsHook ? "" , buildType ? "release" , meta ? {} , cargoLock ? null |