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

Extra cargo options not passed to cargo metadata #1316

Open
apoelstra opened this issue Jul 21, 2023 · 1 comment
Open

Extra cargo options not passed to cargo metadata #1316

apoelstra opened this issue Jul 21, 2023 · 1 comment

Comments

@apoelstra
Copy link

🐛 Bug description

The build documentation suggests that you can pass extra flags to cargo build. The example given is --offline. A natural inference for a user is that --locked should work too.

In fact, neither are passed to cargo metadata, making neither --locked nor --offline behave the way they would if the user were calling cargo build --locked.

🤔 Expected Behavior

When calling wasm-pack build -- --locked, wasm-pack should not manipulate lockfiles at all, just like cargo build --locked. I believe all that is needed is to feed the extra cargo options into the cargo_metadata::MetadataCommand constructor alongside the manifest path. This is done in CrateData::new in manifest/mod.rs.

👟 Steps to reproduce

  1. Delete your Cargo.lock.
  2. Run `wasm-pack build -- --locked
  3. Check whether the command succeeded and created a Cargo.lock file.

🌍 Your environment

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

@TakodaS
Copy link

TakodaS commented Aug 23, 2024

Even --offline isn't passed to cargo build: #821
This feature is critical if you want to use wasm-pack in a nix derivation as they are isolated on purpose.

EDIT: I take this back. The problem is that wasm-pack build runs both cargo build, which is now passed extra parameters, and cargo install that you have no control over.

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