-
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
emcc and wasm-ld can't link our ui tests for wasm32-unknown-emscripten
?
#131666
Comments
Does this target use some different main symbol name? |
... do we need to pass --no-entry to lib builds? emscripten-core/emscripten#9640 @workingjubilee can you check if (some of) the failing tests are lib crates? Actually what am I doing, I can check |
I can't get past the building test helpers for this target cross-compiling from msvc host, not sure what's up with that. |
Huh. cc @juntyr Can you make it any further? |
|
In the open platform support docs PR this says
... so I don't know, is this expected failure? |
See #131582 (comment) I was able to get past the build helpers stage by properly acquring the toolchain and making relevant env vars available to bootstrap. Didn't bother trying to diagnose past stage 1 std and tests because there's like a chain of failures. Notably I see
|
The failing link command includes:
if we replace that with
We should invoke |
So I guess for starters we should do: --- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1643,7 +1643,10 @@ fn make_exe_name(&self) -> PathBuf {
// double the length.
let mut f = self.output_base_dir().join("a");
// FIXME: This is using the host architecture exe suffix, not target!
- if self.config.target.starts_with("wasm") {
+ if self.config.target.contains("emscripten") {
+ f = f.with_extra_extension("js");
+ }
+ else if self.config.target.starts_with("wasm") {
f = f.with_extra_extension("wasm");
} else if self.config.target.contains("spirv") {
f = f.with_extra_extension("spv"); |
Combined with setting the runner to --- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -612,6 +612,9 @@ pub fn from_triple(triple: &str) -> Self {
if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
target.no_std = true;
}
+ if triple.contains("emscripten") {
+ target.runner = Some("node".into());
+ }
target
}
} |
The failures seem to be:
and |
Rollup merge of rust-lang#131705 - hoodmane:fix-emscripten-tests, r=jieyouxu Fix most ui tests on emscripten target To fix the linker errors, we need to set the output extension to `.js` instead of `.wasm`. Setting the output to a `.wasm` file puts Emscripten into standalone mode which is effectively a distinct target. We need to set the runner to be `node` as well. This fixes most of the ui tests. I fixed 4 additional tests with simple problems: - `intrinsics/intrinsic-alignment.rs` -- Two `#[cfg]` macros match for Emscripten so we got duplicate definition - `structs-enums/rec-align-u64.rs` -- same problem - `issues/issue-12699.rs` -- hangs so I disabled it - `process/process-sigpipe.rs` -- Not expected to work on Emscripten so I disabled it Resolves rust-lang#131666. There are 7 more failing tests. I'll try to investigate more and see if I can fix them or at least understand why they happen. - abi/numbers-arithmetic/return-float.rs (problem with [wasm treatment of noncanonical floats](https://webassembly.github.io/spec/core/exec/numerics.html#nan-propagation)?) - async-await/issue-60709.rs -- linker error related to memcpy. Possible Emscripten bug? - backtrace/dylib-dep.rs -- Says "Not supported" - backtrace/line-tables-only.rs -- Says "Not supported" - no_std/no-std-unwind-binary.rs -- compiler says `error: lang item required, but not found: eh_catch_typeinfo` - structs-enums/enum-rec/issue-17431-6.rs -- One of the two compiler errors is missing - test-attrs/test-passed.rs r?workingjubilee r?jieyouxu
Perhaps I'm holding it wrong? About a fifth of the rustc UI test suite to fail on wasm32-unknown-emscripten when trying to run
./x.py test --target wasm32-unknown-emscripten
. In all cases we get an error like this:The text was updated successfully, but these errors were encountered: