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

Specify cargo build target dir? #1156

Closed
shrinktofit opened this issue Jul 19, 2022 · 2 comments
Closed

Specify cargo build target dir? #1156

shrinktofit opened this issue Jul 19, 2022 · 2 comments

Comments

@shrinktofit
Copy link

💡 Feature description

I want to specify all the intermediate compilation files or wasm output into specified dir. I used wasm-pack build <input-dir> --out-dir <wasm-pack-output-dir> -- --target-dir <cargo-target-dir>, but the following error was emitted:

[INFO]: Installing wasm-bindgen...
error: failed reading '<input-dir>\target\wasm32-unknown-unknown\release\<not-important>.wasm'

Caused by:
    系统找不到指定的路径。 (os error 3)
    ^^^^^^^^^^^^^^^
    (Which means "system can not find specified path")

Seems like wasm-pack always assumes the cargo target output is emitted to <input-dir>/target?

💻 Basic example

Include a basic code example if possible. Omit this section if not applicable.

@kaimast
Copy link

kaimast commented Oct 28, 2022

To me it looks like as wasm-pack changes directories incorrectly.

I specify CARGO_TARGET_DIR=wasm-target and it ends up compiling everything in the following folder: <workspace_dir>/<crate_dir>/wasm-target (which isn't the correct path).

But then wasm-pack looks for the binary in <workspace_dir>/wasm-target (which is the correct path) and fails.

dfaust added a commit to dfaust/wasm-pack that referenced this issue Sep 22, 2023
dfaust added a commit to dfaust/wasm-pack that referenced this issue Sep 22, 2023
@drager
Copy link
Member

drager commented Jul 1, 2024

Fixed in #1331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants