Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildRustCrate: Fix #60125 - Always set additional env variables during build #60127

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/build-support/rust/build-rust-crate/configure-crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, completeDeps
, crateAuthors
, crateDescription
, crateHomepage
, crateFeatures
, crateName
, crateVersion
Expand Down Expand Up @@ -91,12 +92,11 @@ in ''
export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0}
export CARGO_PKG_VERSION_MINOR=${builtins.elemAt version 1}
export CARGO_PKG_VERSION_PATCH=${builtins.elemAt version 2}
export CARGO_PKG_VERSION_PRE="${versionPre}"
export CARGO_PKG_HOMEPAGE="${crateHomepage}"
export NUM_JOBS=1
export RUSTC="rustc"
export RUSTDOC="rustdoc"
if [[ -n "${versionPre}" ]]; then
export CARGO_PKG_VERSION_PRE="${versionPre}"
fi

BUILD=""
if [[ ! -z "${build}" ]] ; then
Expand Down
3 changes: 2 additions & 1 deletion pkgs/build-support/rust/build-rust-crate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ stdenv.mkDerivation (rec {
crateVersion = crate.version;
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [];
crateHomepage = crate.homepage or "";
crateType =
if lib.attrByPath ["procMacro"] false crate then ["proc-macro"] else
if lib.attrByPath ["plugin"] false crate then ["dylib"] else
Expand All @@ -144,7 +145,7 @@ stdenv.mkDerivation (rec {
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures libName build workspace_member release libPath crateVersion
extraLinkFlags extraRustcOpts
crateAuthors verbose colors target_os;
crateAuthors crateHomepage verbose colors target_os;
};
buildPhase = buildCrate {
inherit crateName dependencies
Expand Down