-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationC-bugCategory: bugCategory: bugO-wasmOS: WASM target released issuesOS: WASM target released issuesS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
Problem
For wasm32-unknown-emscripten target, the path of the .wasm file name is embedded in the output .js file. However, different-binary-name changes both file name of .wasm and .js when uplifting final binaries to target/debug directory, but not the .wasm path embedded in .js file.
Steps
- Have a project enabling
different-binary-nameunstable featurecargo-features = ["different-binary-name"] [package] name = "a-b-c" version = "0.1.0" edition = "2021" [[bin]] name = "a-b-c" filename = "a-b-c_a_b_c" path = "src/main.rs" nix-shell -p emscriptenrustup +nightly target add wasm32-unknown-emscriptencargo +nightly buildls target/wasm32-unknown-emscripten/debug/a-b-c_a_b_c.wasmand observe it existsrg '\.wasm' target/wasm32-unknown-emscripten/debug/a-b-c_a_b_c.jsand observewasmBinaryFile = 'a_b_c.wasm'
Possible Solution(s)
Do not change name of the .wasm file for wasm32-unknown-emscripten.
Notes
No response
Version
cargo 1.77.0-nightly (7bb7b5395 2024-01-20)
release: 1.77.0-nightly
commit-hash: 7bb7b539558dc88bea44cee4168b6269bf8177b0
commit-date: 2024-01-20
Metadata
Metadata
Assignees
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationC-bugCategory: bugCategory: bugO-wasmOS: WASM target released issuesOS: WASM target released issuesS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.