Skip to content

Commit 0fd367c

Browse files
brettcannonerlend-aasland
authored andcommitted
pythonGH-123877: default to wasm32-wasip1 instead of wasm32-wasi to be more specific (pythonGH-126552)
Eventually wasm32-wasi will represent WASI 1.0, and so it's currently deprecated so it can be used for that eventual purpose. wasm32-wasip1 is also more specific to what version of WASI is currently supported. --------- Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 52441bf commit 0fd367c

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
WASI_SDK_VERSION: 24
1818
WASI_SDK_PATH: /opt/wasi-sdk
1919
CROSS_BUILD_PYTHON: cross-build/build
20-
CROSS_BUILD_WASI: cross-build/wasm32-wasi
20+
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
2121
steps:
2222
- uses: actions/checkout@v4
2323
# No problem resolver registered as one doesn't currently exist for Clang.
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
path: ${{ env.WASI_SDK_PATH }}
3333
key: ${{ runner.os }}-wasi-sdk-${{ env.WASI_SDK_VERSION }}
34-
- name: "Install WASI SDK"
34+
- name: "Install WASI SDK" # Hard-coded to x64.
3535
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
3636
run: |
3737
mkdir ${{ env.WASI_SDK_PATH }} && \
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Use ``wasm32-wasip1`` as the target triple for WASI instead of
2+
``wasm32-wasi``. The latter will eventually be reclaimed for WASI 1.0 while
3+
CPython currently only supports WASI preview1.

Tools/wasm/wasi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def main():
346346
"(default designed for wasmtime 14 or newer: "
347347
f"`{default_host_runner}`)")
348348
for subcommand in build, configure_host, make_host:
349-
subcommand.add_argument("--host-triple", action="store", default="wasm32-wasi",
349+
subcommand.add_argument("--host-triple", action="store", default="wasm32-wasip1",
350350
help="The target triple for the WASI host build")
351351

352352
context = parser.parse_args()

configure

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

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ then
336336
*-*-emscripten)
337337
ac_sys_system=Emscripten
338338
;;
339-
*-*-wasi)
339+
*-*-wasi*)
340340
ac_sys_system=WASI
341341
;;
342342
*)
@@ -1201,7 +1201,7 @@ AS_CASE([$host/$ac_cv_cc_name],
12011201
[aarch64-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux ARM64, glibc, gcc+clang
12021202
[aarch64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2],
12031203
[powerpc64le-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux on PPC64 little endian, glibc, gcc
1204-
[wasm32-unknown-wasi/clang], [PY_SUPPORT_TIER=2], dnl WebAssembly System Interface, clang
1204+
[wasm32-unknown-wasip1/clang], [PY_SUPPORT_TIER=2], dnl WebAssembly System Interface preview1, clang
12051205
[x86_64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2], dnl Linux on AMD64, any vendor, glibc, clang
12061206

12071207
[aarch64-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=3], dnl Windows ARM64, MSVC
@@ -1647,7 +1647,7 @@ then
16471647
dnl TODO: support other WASI runtimes
16481648
dnl wasmtime starts the process with "/" as CWD. For OOT builds add the
16491649
dnl directory containing _sysconfigdata to PYTHONPATH.
1650-
[WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
1650+
[WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
16511651
[HOSTRUNNER='']
16521652
)
16531653
fi

0 commit comments

Comments
 (0)