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.
This commit is contained in:
Andreas Rammhold 2020-01-21 17:22:59 +01:00
parent 60fea726de
commit d6a8b55fb0
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86

View File

@ -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}")