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

Export wasm source map when debug information is enabled #47883

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

yurydelendik
Copy link
Contributor

We use binaryen's linker to produce a wasm file (via s2wasm). The wasm writer has capabilities to export source maps. The pilot support for source maps is added to Firefox.

The produced source map contains references to the original file, that might require additional source map file processing to include / package original files with it.

/cc @alexcrichton

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Nice! I think Travis is failing b/c of the use of "TODO" (we have a lint that says to use "FIXME" instead), but other than that this looks great to me.

I think we may want to follow this up with a patch to Cargo as well around here so Cargo knows about the *.wasm.map outputs as well, but we should for sure land this here first!

@yurydelendik yurydelendik changed the title [WIP] Export wasm source map when debug information is enabled Export wasm source map when debug information is enabled Jan 30, 2018
@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2018
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 30, 2018

📌 Commit 0a83d5b has been approved by alexcrichton

@alexcrichton
Copy link
Member

@bors: r-

er actually lemme leave a comment

fs::write(&object, binary.data())
let result = fs::write(&object, binary.data());
if cgcx.debuginfo != config::NoDebugInfo {
fs::write(map, binary.source_map()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Instead of .unwrap() here could this use .and_then or other sorts of error handling?

We use binaryen's linker to produce a wasm file (via s2wasm). The wasm writer has capabilities to export source maps.

The produced source map contains references to the original file, that might require additional source map file processing to include / package original files with it.
@pietroalbini
Copy link
Member

@alexcrichton the PR author should have fixed your concerns, could you review this?

@alexcrichton
Copy link
Member

@bors: r+

Indeed1

@yurydelendik feel free to ping when a PR is updated, unfortunately no notifications are sent out for that :(

@bors
Copy link
Contributor

bors commented Feb 5, 2018

📌 Commit cfe53c0 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Feb 6, 2018

⌛ Testing commit cfe53c0 with merge e31860d...

bors added a commit that referenced this pull request Feb 6, 2018
Export wasm source map when debug information is enabled

We use binaryen's linker to produce a wasm file (via s2wasm). The wasm writer has capabilities to export source maps. The pilot support for source maps is added to Firefox.

The produced source map contains references to the original file, that might require additional source map file processing to include / package original files with it.

/cc @alexcrichton
@bors
Copy link
Contributor

bors commented Feb 6, 2018

💔 Test failed - status-appveyor

@kennytm
Copy link
Member

kennytm commented Feb 6, 2018

@bors retry

3 hour timeout.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 7, 2018
Export wasm source map when debug information is enabled

We use binaryen's linker to produce a wasm file (via s2wasm). The wasm writer has capabilities to export source maps. The pilot support for source maps is added to Firefox.

The produced source map contains references to the original file, that might require additional source map file processing to include / package original files with it.

/cc @alexcrichton
bors added a commit that referenced this pull request Feb 7, 2018
Rollup of 10 pull requests

- Successful merges: #47613, #47631, #47810, #47883, #47922, #47944, #48014, #48018, #48020, #48028
- Failed merges:
@bors bors merged commit cfe53c0 into rust-lang:master Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants