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

error: the argument '--release' cannot be used with '--profile <PROFILE-NAME>' #1461

Open
loynoir opened this issue Jan 9, 2025 · 2 comments

Comments

@loynoir
Copy link

loynoir commented Jan 9, 2025

🐛 Bug description

Describe your issue in detail.

error: the argument '--release' cannot be used with '--profile <PROFILE-NAME>'

🤔 Expected Behavior

What should have happened?

$ wasm-pack build --profile x-release --verbose
(No error)

👟 Steps to reproduce

Clear steps describing how to reproduce the issue, including commands and flags run. If you are seeing an error, please include the full error message and stack trace.

$ wasm-pack build --profile x-release --verbose
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
error: the argument '--release' cannot be used with '--profile <PROFILE-NAME>'

Usage: cargo build --lib --release --target [<TRIPLE>] --verbose...

For more information, try '--help'.
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 1
  full command: cd "/path/to/project" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown" "--profile" "x-release" "--verbose"
...

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version:
rustc version:

$ wasm-pack --version                                    
wasm-pack 0.13.1

$ grep -P '^channel' rust-toolchain.toml
channel = "nightly-2025-01-06"

$ rustc --version
rustc 1.86.0-nightly (b3b368a18 2025-01-05)

$ cargo --version                                              
cargo 1.86.0-nightly (fd784878c 2025-01-03)
@chris13524
Copy link

I'm also trying to use a custom profile with wasm-pack so I can avoid mucking with my clean default release profile. I have a lot of different profiles being used for different build targets and they all inherit from release.

@loynoir did you find a workaround for this?

@loynoir
Copy link
Author

loynoir commented Jan 23, 2025

Unexpected but acceptable for me.

Did not try to find a workaround.

If I do, I would try

  • PATH=${CARGO_WRAPPER_X}:${PATH} wasm-pack build --profile X

Which wrapper will turn

  • cargo ... --release ...

  • cargo ... --release ... --profile X ...

Into

  • cargo ... --release ...

  • cargo ... --profile X ...

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

2 participants