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

cargo web start with examples doesn't serve the wasm files correctly? #183

Closed
tangmi opened this issue Apr 1, 2019 · 1 comment
Closed

Comments

@tangmi
Copy link

tangmi commented Apr 1, 2019

Hi all, when I run cargo web start --example ... (currently trying this with the cube example in gfx), the server serves http://[::1]:8000/cube.js correctly, but http://[::1]:8000/cube-{build_hash}.wasm returns a 404.

I think the issue is somewhere around here:

"compiler-artifact" => {
CargoOutput::Artifact( serde_json::from_str( &string ).expect( "failed to parse compiler artifact" ) )
},

...because we're serving blobs based on compiler artifacts, but the cargo doesn't output the wasm files as a part of the compiler-artifact message:

{
    "reason": "compiler-artifact",
    "package_id": "gfx_app 0.9.0 (path+file:///E:/external/gfx)",
    "target": {
        "kind": [
            "example"
        ],
        "crate_types": [
            "bin"
        ],
        "name": "cube",
        "src_path": "E:\\external\\gfx\\examples/cube/main.rs",
        "edition": "2015"
    },
    "profile": {
        "opt_level": "0",
        "debuginfo": 2,
        "debug_assertions": true,
        "overflow_checks": true,
        "test": false
    },
    "features": [
        "default"
    ],
    "filenames": [
        "E:\\external\\gfx\\target\\wasm32-unknown-emscripten\\debug\\examples\\cube.js"
    ],
    "executable": "E:\\external\\gfx\\target\\wasm32-unknown-emscripten\\debug\\examples\\cube.js",
    "fresh": false
}

Sifting through all the compiler output, it doesn't seem like there is a message that includes the wasm file at all?

Anyways, thanks for the awesome project!

Edit: this might be a cargo bug? I've filed one here: rust-lang/cargo#6810

@tangmi
Copy link
Author

tangmi commented Apr 3, 2019

I think this was closed by rust-lang/cargo#6812! Should be fixed in the next release of cargo?

@tangmi tangmi closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant