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

Fix wasm-bindgen if lib is renamed via lib.name #435

Merged
merged 1 commit into from
Nov 6, 2018

Conversation

alexcrichton
Copy link
Contributor

This commit fixes an issue where if a library is renamed via the name
key in the [lib] section of the manifest then wasm-pack would try to
generate bindings for an noexistent wasm-file, generating an error.

The fix was to internally use cargo_metadata more aggressively and
move around where this data is generated. This ended up refactoring a
few locations, but this should also bring improved error messages for
cargo metadata as well as caching the resulting data more aggressively
to avoid recalculating it too much.

Closes #339

This commit fixes an issue where if a library is renamed via the `name`
key in the `[lib]` section of the manifest then `wasm-pack` would try to
generate bindings for an noexistent wasm-file, generating an error.

The fix was to internally use `cargo_metadata` more aggressively and
move around where this data is generated. This ended up refactoring a
few locations, but this should also bring improved error messages for
`cargo metadata` as well as caching the resulting data more aggressively
to avoid recalculating it too much.

Closes rustwasm#339
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!

@alexcrichton alexcrichton merged commit 7796ecb into rustwasm:master Nov 6, 2018
@alexcrichton alexcrichton deleted the handle-rename branch November 6, 2018 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The cdylib's name can be overriden by lib.name
3 participants