From d6a8b55fb0fd9f41f3c83982a5e3a7b7d7a4f01f Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 21 Jan 2020 17:22:59 +0100 Subject: [PATCH] buildRustCrate: treat `rlib` crates just like `lib` crates Both version provide `rlib` files to link against. Previously we would try to find a matching shared library in the `lib` output. --- pkgs/build-support/rust/build-rust-crate/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index 2885b2aef51..569b48d25ae 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -23,7 +23,7 @@ let lib.strings.replaceStrings ["-"] ["_"] crateRenames.${dep.crateName} else extern; - in (if lib.any (x: x == "lib") dep.crateType then + in (if lib.any (x: x == "lib" || x == "rlib") dep.crateType then " --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}.rlib" else " --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")