Revert "build-rust-{crate,package}: cleanups"

This commit is contained in:
Guillaume Girol 2023-06-18 09:27:44 +00:00 committed by GitHub
parent 30c0a2f738
commit f8602fa508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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 ''

View File

@ -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_

View File

@ -34,6 +34,7 @@
, buildInputs ? []
, nativeBuildInputs ? []
, cargoUpdateHook ? ""
, cargoDepsHook ? ""
, buildType ? "release"
, meta ? {}
, cargoLock ? null