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

compiler-artifact message doesn't include WASM source maps #6937

Closed
tangmi opened this issue May 13, 2019 · 1 comment · Fixed by #8210
Closed

compiler-artifact message doesn't include WASM source maps #6937

tangmi opened this issue May 13, 2019 · 1 comment · Fixed by #8210
Labels
C-bug Category: bug O-wasm OS: WASM target released issues

Comments

@tangmi
Copy link

tangmi commented May 13, 2019

Problem

Hi all, when I compile for --target wasm32-unknown-emscripten (looks like wasm32-unknown-unknown does not support sourcemaps: rust-lang/rust#56660), the compiler-artifact message includes the .js and .wasm files under the filenames property. However, it does not include the .wasm.map file found in target/wasm32-unknown-emscripten/deps/*.wasm.map.

cargo-web depends on the compiler-artifacts message to determine which files to serve for its cargo web start command, but it doesn't seem to serve the .wasm.map file because it is not emitted by cargo.

Steps

When I build with cargo web build --message-format json --target wasm32-unknown-emscripten:

{
    "features": [],
    "filenames": [
        "E:\\test-app\\target\\wasm32-unknown-emscripten\\debug\\test-app.js",
        "E:\\test-app\\target\\wasm32-unknown-emscripten\\debug\\test_app.wasm"
        // Should there be a "target\\wasm32-unknown-emscripten\\debug\\deps\\test_app.wasm.map" here?
    ],
    "fresh": true,
    "package_id": "test-all 0.1.0 (path+file:///E:/test-app)",
    "profile": {
        "debug_assertions": true,
        "debuginfo": 2,
        "opt_level": "0",
        "overflow_checks": true,
        "test": false
    },
    "reason": "compiler-artifact",
    "target": {
        "crate_types": [
            "bin"
        ],
        "edition": "2018",
        "kind": [
            "bin"
        ],
        "name": "test-app",
        "src_path": "E:\\test-app\\src\\main.rs"
    }
}

Possible Solution(s)

Notes

Output of cargo version: cargo 1.35.0-nightly (6f3e9c367 2019-04-04)

Many thanks!

@tangmi tangmi added the C-bug Category: bug label May 13, 2019
@ehuss
Copy link
Contributor

ehuss commented Aug 12, 2019

Do you happen to know exactly when .map files are generated? At a minimum it seems to be related to debug settings.

I also saw a recent post saying the emscripten backend may be changing, would that affect this?

It's a bit unfortunate that we need to hard-code these output files, but neither cargo nor rustc knows about them.

@ehuss ehuss added the O-wasm OS: WASM target released issues label Sep 23, 2019
@bors bors closed this as completed in c719a05 May 7, 2020
@bors bors closed this as completed in #8210 May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug O-wasm OS: WASM target released issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants