Skip to content

emscripten support broken by cargo file layout changes #4087

Open
@CryZe

Description

@CryZe

Moved over from: rust-lang/rust#38454

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layoutArea: target output directory layout, naming, and organizationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-buildS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions