-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
emscripten support broken by cargo file layout changes #38454
Comments
This is likely due to rust-lang/cargo#3102, not a rustc change itself. That tweaked how Cargo deals with the directory structure a bit, and namely assumes that if you hard link a "binary" to a new location it will continue working. Turns out that's not true for emscripten though! |
Thanks for the report @CryZe. |
I didn't try, but does this mean that Cargo will break source map support as well? (as in, will it rename |
Checked, looks the same - |
@RReverser if this behavior is causing problems we may be able to alter Cargo's behavior as well to be more amenable to emscripten |
@alexcrichton Well at the moment I've submitted emscripten-core/emscripten#4936 to Emscripten, so it will be the only blocker to get separate memory init file in Rust, and also it seems to block ability to debug with source maps when building with Cargo. Would you want to have a special Cargo behavior for |
Awesome, thanks! We may also want to have special support for this in Cargo. IIRC this is also an issue for Windows with |
@alexcrichton I'm wondering if inverting folder copies would help (that is, for top-level target build in the Then, when you're looking for cached result, you still look for the hashed one in |
@RReverser that... sounds like a great idea! |
This looks like a Cargo issue, since as far as I know rustc itself doesn't really have any special logic along these lines. As such, I'm going to close; please refile there if this is still a problem. |
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.
To clarify, the final JS binary is located in the
target/asmjs-unknown-emscripten/release/
folder asaoc.js
like intended. However there's noaoc.js.mem
file like there used to be. That's because the deps are calledaoc-66434e595ec0b4e8
now, so the compiler spits out the binaries with that name. However rustc only copies out theaoc-66434e595ec0b4e8.js
asaoc.js
, but not the mem file. But even if it copied out the mem file, it wouldn't be able to rename it, because theaoc.js
looks specifically for the original name.Ping: @brson
The text was updated successfully, but these errors were encountered: