Skip to content

emscripten support broken by cargo file layout changes #38454

Closed
@CryZe

Description

@CryZe

Looks like the compiler uses hashes as postfixes for the deps now. This messes with emscripten though, as the final "binaries" don't get copied out of the deps folder correctly anymore. Also the original names get baked into the JS files, so even if copied out correctly, they can't find each other anymore.

Uncaught could not load memory initializer aoc-66434e595ec0b4e8.js.mem

To clarify, the final JS binary is located in the target/asmjs-unknown-emscripten/release/ folder as aoc.js like intended. However there's no aoc.js.mem file like there used to be. That's because the deps are called aoc-66434e595ec0b4e8 now, so the compiler spits out the binaries with that name. However rustc only copies out the aoc-66434e595ec0b4e8.js as aoc.js, but not the mem file. But even if it copied out the mem file, it wouldn't be able to rename it, because the aoc.js looks specifically for the original name.

Ping: @brson

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-asmjsTarget: asm.js - http://asmjs.org/O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions