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

Use of wasm-bindgen from git/path/registry may fail #852

Closed
hajifkd opened this issue May 27, 2020 · 2 comments
Closed

Use of wasm-bindgen from git/path/registry may fail #852

hajifkd opened this issue May 27, 2020 · 2 comments

Comments

@hajifkd
Copy link

hajifkd commented May 27, 2020

If the wasm-bindgen is not globally installed, these codes

let lockfile = Lockfile::new(&self.crate_data)?;
let bindgen_version = lockfile.require_wasm_bindgen()?;

cmd.arg("install")
.arg("--force")
.arg(crate_name)
.arg("--version")
.arg(version)
.arg("--root")
.arg(&tmp);

try to install it based on the Cargo.lock. (This may happen other commands, but in practice, only wasm-bindgen causes the problem.)

However, if the project specifies the version using the git, path, or registry section, this may fail, because the lock file does not reflect it. The workaround is to install wasm-bindgen-cli globally.

Well, I understand this is an extremely rare problem, but I found it when I was working on rustwasm/wasm-bindgen#2105 and I think at least this should be noted somewhere.

@ctaggart
Copy link

ctaggart commented May 30, 2020

It would be nice if the git version of wasm-bindgen is specified, then the matching version of wasm-bindgen-cli be used

wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" }
cargo install --git https://github.com/rustwasm/wasm-bindgen wasm-bindgen-cli

I installed wasm-bingen-cli globally like that, but the cached version is still being run. I don't know why it decided to pick to use 0.2.19 for August of 2018 rustwasm/wasm-bindgen@d9bc0a3. I opened #853.

@Pauan
Copy link
Contributor

Pauan commented Jun 4, 2020

This seems like the same issue as #853, and the solution is to use [patch] to override the version of wasm-bindgen.

Specifying wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" } won't work, because it won't affect any of your dependencies, whereas [patch] does.

@Pauan Pauan closed this as completed Jun 4, 2020
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