Use the default xcode version & fix emsripten build - #47
Conversation
|
|
||
| dnl map int64_t and uint64_t to JS bigint | ||
| AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"]) | ||
| AS_VAR_APPEND([LDFLAGS_NODIST], [" -fwasm-exceptions"]) |
There was a problem hiding this comment.
Rust ships a prebuilt std for wasm32-unknown-emscripten, and it's compiled with -fwasm-exceptions.
So I suppose we have no choice here
There was a problem hiding this comment.
Let me ping @hoodmane. Hood, for context this PR is adding emscripten support to our Rust fork. Do you think adding wasm-exceptions would be an issue for users of CPython on Emscripten?
There was a problem hiding this comment.
Yeah, Pyodide uses it and it works well, panic and catch_unwind both work as expected. I don't think there is anything to worry about.
| if !have_sysroot && cargo_target.contains("emscripten") { | ||
| let mut candidates = Vec::new(); | ||
| if let Ok(emsdk) = env::var("EMSDK") { | ||
| candidates.push( | ||
| PathBuf::from(&emsdk) | ||
| .join("upstream") | ||
| .join("emscripten") | ||
| .join("cache") | ||
| .join("sysroot"), | ||
| ); | ||
| } | ||
| if let Ok(cc) = env::var("PY_CC") | ||
| && let Some(parts) = shlex::split(&cc) | ||
| && let Some(binary) = parts.first() | ||
| && let Some(bin_dir) = Path::new(binary).parent() | ||
| { | ||
| candidates.push(bin_dir.join("cache").join("sysroot")); | ||
| } | ||
| if let Some(sysroot) = candidates.into_iter().find(|p| p.is_dir()) { | ||
| builder = builder.clang_arg(format!("--sysroot={}", sysroot.display())); | ||
| have_sysroot = true; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This points bidgen at emsdk's sysroot, same as WASI/Android blocks above.
There was a problem hiding this comment.
It might be simpler to assume that $EMSDK/upstream/emscripten/cache/sysroot points to a valid sysroot and skip the second step.
No description provided.