Skip to content

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

Closed
@tangmi

Description

@tangmi

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugO-wasmOS: WASM target released issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions