-
Notifications
You must be signed in to change notification settings - Fork 422
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
Handle versions of wasm-bindgen in lockfiles #270
Comments
Finding the lock file can be interesting if the crate is in a workspace. We can leverage https://crates.io/crates/cargo_metadata to help. |
So would the metadata output the current version in the lockfile? Or what's in Cargo.toml? |
It gives us the location of the workspace root, which will have the I don't think we want to use |
Digging into this now 😸 https://github.com/oli-obk/cargo_metadata/blob/master/src/lib.rs#L156 It does look like the |
Yeah, I think we only want to use it in order to get the workspace root. |
Sounds good to me :o) I'll follow up if I have other questions! |
I think I have a lot of the work on this done 😸 I should be able to open a PR shortly. As an aside, is there anywhere where the fields in |
I think @ashleygwilliams or @alexcrichton would know the answer to that question. |
Ah they're not necessarily officially specified but when using TOML+Serde you can deserialize into a structure like: #[derive(Deserialize)]
struct Lockfile {
packages: Vec<Package>,
}
#[derive(Deserialize)]
struct Package {
name: String,
version: String,
source: Option<String>,
} and that should be enough to match on |
Yay! Thanks for the help @alexcrichton, that lines up with what I had done so far. My struct looked like this: #[derive(Deserialize)]
struct Package {
name: String,
version: String,
source: Option<String>,
dependencies: Option<Vec<String>>
} Should I keep the |
Ah yeah it won't hurt anything to keep |
Awesome, thank you! |
closed by the last release. |
💡 Feature description
We have a basic implementation of keeping up to date with wasm-bindgen. Ideally though with the local install we'd tie the version to whatever is in the lock file to avoid issues with things like
Cargo.toml
usingwasm-bindgen = 0.2
as what version ofwasm-bindgen-cli
does this mean? Having a lock file look up would solve this issue.The text was updated successfully, but these errors were encountered: