Skip to content

Commit b812b4a

Browse files
authored
Use the default xcode version & fix emsripten build (#47)
1 parent 211624c commit b812b4a

5 files changed

Lines changed: 22 additions & 9 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,6 @@ jobs:
374374
with:
375375
toolchain: 1.95.0
376376
targets: aarch64-apple-ios-sim
377-
# GitHub recommends explicitly selecting the desired Xcode version:
378-
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
379-
# This became a necessity as a result of
380-
# https://github.com/actions/runner-images/issues/12541 and
381-
# https://github.com/actions/runner-images/issues/12751.
382-
- name: Select Xcode version
383-
run: |
384-
sudo xcode-select --switch /Applications/Xcode_16.4.app
385-
386377
- name: Build and test
387378
run: python3 Platforms/Apple ci iOS --fast-ci
388379

‎.github/workflows/reusable-emscripten.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5656
with:
5757
python-version: '3.x'
58+
- uses: dtolnay/rust-toolchain@f133eefe930d61f0d9371efd474daf0125ed3dd1 # 1.95.0
59+
with:
60+
toolchain: 1.95.0
61+
targets: wasm32-unknown-emscripten
5862
- name: "Runner image version"
5963
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
6064
- name: "Install Emscripten"

‎Modules/cpython-sys/build.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ fn emit_rerun_instructions(builddir: Option<&str>) {
3838
"PY_CFLAGS",
3939
"TARGET",
4040
"WASI_SDK_PATH",
41+
"EMSDK",
4142
] {
4243
println!("cargo:rerun-if-env-changed={var}");
4344
}
@@ -227,6 +228,21 @@ fn generate_c_api_bindings(
227228
}
228229
}
229230

231+
if !have_sysroot
232+
&& cargo_target.contains("emscripten")
233+
&& let Ok(emsdk) = env::var("EMSDK")
234+
{
235+
let sysroot = PathBuf::from(&emsdk)
236+
.join("upstream")
237+
.join("emscripten")
238+
.join("cache")
239+
.join("sysroot");
240+
if sysroot.is_dir() {
241+
builder = builder.clang_arg(format!("--sysroot={}", sysroot.display()));
242+
have_sysroot = true;
243+
}
244+
}
245+
230246
// Android NDK: ANDROID_HOME is set by the CI/user environment, and
231247
// Android/android-env.sh sets CC to the NDK clang binary at:
232248
// $ANDROID_HOME/ndk/<ver>/toolchains/llvm/prebuilt/<host>/bin/<triple>-clang

‎configure‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,7 @@ AS_CASE([$ac_sys_system],
24102410
24112411
dnl map int64_t and uint64_t to JS bigint
24122412
AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"])
2413+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -fwasm-exceptions"])
24132414
24142415
dnl Include file system support
24152416
AS_VAR_APPEND([LINKFORSHARED], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js"])

0 commit comments

Comments
 (0)