]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] GH-123877: make `wasm32-wasip1` the target triple for WASI (#126561)
authorBrett Cannon <brett@python.org>
Fri, 8 Nov 2024 00:16:12 +0000 (16:16 -0800)
committerGitHub <noreply@github.com>
Fri, 8 Nov 2024 00:16:12 +0000 (16:16 -0800)
.github/workflows/reusable-wasi.yml
Misc/NEWS.d/next/Build/2024-11-07-15-03-34.gh-issue-123877.9dWXe2.rst [new file with mode: 0644]
Tools/wasm/wasi.py
configure
configure.ac

index 4c8137c958a3128851ea147f6ffa5de5983a9f53..8793ded6266744bb99f3af05abc1d0f06be02f51 100644 (file)
@@ -17,7 +17,7 @@ jobs:
       WASI_SDK_VERSION: 24
       WASI_SDK_PATH: /opt/wasi-sdk
       CROSS_BUILD_PYTHON: cross-build/build
-      CROSS_BUILD_WASI: cross-build/wasm32-wasi
+      CROSS_BUILD_WASI: cross-build/wasm32-wasip1
     steps:
     - uses: actions/checkout@v4
     # No problem resolver registered as one doesn't currently exist for Clang.
@@ -31,7 +31,7 @@ jobs:
       with:
         path: ${{ env.WASI_SDK_PATH }}
         key: ${{ runner.os }}-wasi-sdk-${{ env.WASI_SDK_VERSION }}
-    - name: "Install WASI SDK"
+    - name: "Install WASI SDK"  # Hard-coded to x64.
       if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
       run: |
         mkdir ${{ env.WASI_SDK_PATH }} && \
diff --git a/Misc/NEWS.d/next/Build/2024-11-07-15-03-34.gh-issue-123877.9dWXe2.rst b/Misc/NEWS.d/next/Build/2024-11-07-15-03-34.gh-issue-123877.9dWXe2.rst
new file mode 100644 (file)
index 0000000..5fc04ae
--- /dev/null
@@ -0,0 +1,2 @@
+Set ``wasm32-wasip1`` as the WASI target. The old ``wasm32-wasi`` target is
+deprecated so it can be used for an eventual WASI 1.0.
index 8deb1f631df49ab140d85e3d6590a8620f7975c4..c8f48a26f2a8be9a3ab4498447bdf73b0f51b2cc 100644 (file)
@@ -347,7 +347,7 @@ def main():
                              "(default designed for wasmtime 14 or newer: "
                                 f"`{default_host_runner}`)")
     for subcommand in build, configure_host, make_host:
-        subcommand.add_argument("--host-triple", action="store", default="wasm32-wasi",
+        subcommand.add_argument("--host-triple", action="store", default="wasm32-wasip1",
                         help="The target triple for the WASI host build")
 
     context = parser.parse_args()
index 5295bdab6c2c3b257f4181859262c3eae9591867..ae70f02f70e5d1267d876709a00d5a94a17a9df3 100755 (executable)
--- a/configure
+++ b/configure
@@ -4060,7 +4060,7 @@ then
        *-*-emscripten)
            ac_sys_system=Emscripten
            ;;
-       *-*-wasi)
+       *-*-wasi*)
            ac_sys_system=WASI
            ;;
        *)
@@ -7058,7 +7058,7 @@ case $host/$ac_cv_cc_name in #(
     PY_SUPPORT_TIER=2 ;; #(
   powerpc64le-*-linux-gnu/gcc) :
     PY_SUPPORT_TIER=2 ;; #(
-    wasm32-unknown-wasi/clang) :
+    wasm32-unknown-wasip1/clang) :
     PY_SUPPORT_TIER=2 ;; #(
     x86_64-*-linux-gnu/clang) :
     PY_SUPPORT_TIER=2 ;; #(
@@ -7819,7 +7819,7 @@ then :
 fi
      ;; #(
               WASI/*) :
-    HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #(
+    HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #(
   *) :
     HOSTRUNNER=''
    ;;
index a3d7ab904bd4e5244a976fb88589e918f5c3b28c..a764028e49fcfda0f24a57030b9e3ac8dcdc6358 100644 (file)
@@ -336,7 +336,7 @@ then
        *-*-emscripten)
            ac_sys_system=Emscripten
            ;;
-       *-*-wasi)
+       *-*-wasi*)
            ac_sys_system=WASI
            ;;
        *)
@@ -1181,7 +1181,7 @@ AS_CASE([$host/$ac_cv_cc_name],
   [aarch64-*-linux-gnu/gcc],         [PY_SUPPORT_TIER=2], dnl Linux ARM64, glibc, gcc+clang
   [aarch64-*-linux-gnu/clang],       [PY_SUPPORT_TIER=2],
   [powerpc64le-*-linux-gnu/gcc],     [PY_SUPPORT_TIER=2], dnl Linux on PPC64 little endian, glibc, gcc
-  [wasm32-unknown-wasi/clang],       [PY_SUPPORT_TIER=2], dnl WebAssembly System Interface, clang
+  [wasm32-unknown-wasip1/clang],     [PY_SUPPORT_TIER=2], dnl WebAssembly System Interface preview1, clang
   [x86_64-*-linux-gnu/clang],        [PY_SUPPORT_TIER=2], dnl Linux on AMD64, any vendor, glibc, clang
 
   [aarch64-pc-windows-msvc/msvc],    [PY_SUPPORT_TIER=3], dnl Windows ARM64, MSVC
@@ -1655,7 +1655,7 @@ then
     dnl TODO: support other WASI runtimes
     dnl wasmtime starts the process with "/" as CWD. For OOT builds add the
     dnl directory containing _sysconfigdata to PYTHONPATH.
-    [WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
+    [WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
     [HOSTRUNNER='']
   )
 fi