-
Notifications
You must be signed in to change notification settings - Fork 417
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 --message-format=json
for getting the location of the generated files
#333
Comments
I think unfortunately we won't be able to switch to doing this in the near future because when Cargo is placed in json message mode it also places the compiler in json message mode. We don't have a great way to rerender an error message as desired by rustc later on which means we wouldn't be able to render rustc's error messages faithfully to the console. I think, though, that with recent improvements and bug fixes we should be pretty good to go here. Cargo should always produce predictable output for a package so long as we hook up the directories and such correctly. For now we'll have to implement that logic manually, but perhaps in the future we can also add a feature to Cargo to have cargo emit json messages and have rustc still emit normal error messages! |
💡 Feature description
Currently, wasm-pack tries to guess the location of the asset from the Cargo.toml. With
--message-format=json
we can get the location directly from cargo.This should also fix #252.
💻 Basic example
Implementation in pyo3-pack: https://github.com/PyO3/pyo3-pack/blob/2f0c8a926bf1b607c48589a2393604de322f7f40/src/compile.rs#L221-L232
cargo-metadata has a pending pull request which wraps cargo's messages in a nice api we could use.
The text was updated successfully, but these errors were encountered: