buildRustCrate: fix wasm bins with hyphenated names
These are currently broken because buildRustCrate will try to mv from an underscored name to a hyphenated name, but will only try to move an unsuffixed name; rustc generates wasm binaries with a .wasm suffix.
This commit is contained in:
@@ -60,7 +60,11 @@ build_bin() {
|
||||
--color ${colors} \
|
||||
|
||||
if [ "$crate_name_" != "$crate_name" ]; then
|
||||
mv target/bin/$crate_name_ target/bin/$crate_name
|
||||
if [ -f "target/bin/$crate_name_.wasm" ]; then
|
||||
mv target/bin/$crate_name_.wasm target/bin/$crate_name.wasm
|
||||
else
|
||||
mv target/bin/$crate_name_ target/bin/$crate_name
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -838,6 +838,19 @@ rec {
|
||||
];
|
||||
};
|
||||
|
||||
crateWasm32BinHyphens = assertOutputs {
|
||||
name = "wasm32-crate-bin-hyphens";
|
||||
mkCrate = mkCrate pkgsCross.wasm32-unknown-none.buildRustCrate;
|
||||
crateArgs = {
|
||||
crateName = "wasm32-crate-bin-hyphens";
|
||||
crateBin = [ { name = "wasm32-crate-bin-hyphens"; } ];
|
||||
src = mkBin "src/main.rs";
|
||||
};
|
||||
expectedFiles = [
|
||||
"./bin/wasm32-crate-bin-hyphens.wasm"
|
||||
];
|
||||
};
|
||||
|
||||
brotliTest =
|
||||
let
|
||||
pkg = brotliCrates.brotli_2_5_0 { };
|
||||
|
||||
Reference in New Issue
Block a user