diff --git a/.github/scripts/build-matrix.rb b/.github/scripts/build-matrix.rb index 9587b490..a27e549b 100644 --- a/.github/scripts/build-matrix.rb +++ b/.github/scripts/build-matrix.rb @@ -7,7 +7,7 @@ "agent_query": "ubuntu-20.04", "target": "ubuntu18.04_x86_64", "containers": { - "main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04", + # "main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04", # "release-5.9": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04@sha256:d5d555cf48fc02f5003928a064c03b76c012fef8afbe54a1942c6bfc3d773c58", "release-5.10": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04@sha256:d5d555cf48fc02f5003928a064c03b76c012fef8afbe54a1942c6bfc3d773c58" }, diff --git a/schemes/main/build/build-target-toolchain.sh b/schemes/main/build/build-target-toolchain.sh index 39658b5f..45150107 100755 --- a/schemes/main/build/build-target-toolchain.sh +++ b/schemes/main/build/build-target-toolchain.sh @@ -27,8 +27,9 @@ build_target_toolchain() { local CLANG_BIN_DIR="$2" local SWIFT_BIN_DIR="$3" local TRIPLE="$4" - local STDLIB_PRODUCT="$5" - local COMPILER_RT_OS_DIR="$6" + local SHORT_TRIPLE="$5" + local STDLIB_PRODUCT="$6" + local COMPILER_RT_OS_DIR="$7" local HOST_SUFFIX HOST_SUFFIX=$(find "$TARGET_BUILD_ROOT" -name "wasmstdlib-*" -exec basename {} \; | sed 's/wasmstdlib-//') @@ -40,7 +41,7 @@ build_target_toolchain() { rm -rf "$TRIPLE_DESTDIR/usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR" # XXX: Is this the right way to install compiler-rt? - cp -R "$TARGET_BUILD_ROOT/wasi-sysroot/lib/$COMPILER_RT_OS_DIR" "$TRIPLE_DESTDIR/usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR" + cp -R "$TARGET_BUILD_ROOT/wasi-sysroot/$SHORT_TRIPLE/lib/$COMPILER_RT_OS_DIR" "$TRIPLE_DESTDIR/usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR" # FIXME: Clang resource directory installation is not the best way currently. # We currently have two copies of compiler headers copied from the base toolchain in @@ -61,6 +62,7 @@ build_target_corelibs() { local CLANG_BIN_DIR="$2" local SWIFT_BIN_DIR="$3" local TRIPLE="$4" + local SHORT_TRIPLE="$5" local TRIPLE_DESTDIR="$TARGET_TOOLCHAIN_DESTDIR/$TRIPLE" local CORELIBS_ARGS=( @@ -68,7 +70,7 @@ build_target_corelibs() { "$LLVM_BIN_DIR" "$CLANG_BIN_DIR" "$SWIFT_BIN_DIR" - "$WASI_SYSROOT_PATH" + "$WASI_SYSROOT_PATH/$SHORT_TRIPLE" ) "$SCHEMES_BUILD_PATH/build-foundation.sh" "${CORELIBS_ARGS[@]}" "$TRIPLE" "$SCHEMES_BUILD_PATH/build-xctest.sh" "${CORELIBS_ARGS[@]}" "$TRIPLE" @@ -160,13 +162,13 @@ main() { "$OPTIONS_SWIFT_BIN" ) - build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi" "wasmstdlib" "wasi" - build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads" "wasmthreadsstdlib" "wasip1" + build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi" "wasm32-wasi" "wasmstdlib" "wasi" + build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads" "wasm32-wasip1-threads" "wasmthreadsstdlib" "wasip1" rsync -av "$WASI_SYSROOT_PATH/" "$PACKAGING_DIR/wasi-sysroot/" - build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi" - build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads" + build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi" "wasm32-wasi" + build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads" "wasm32-wasip1-threads" } main "$@" diff --git a/schemes/main/manifest.json b/schemes/main/manifest.json index 1c0ff0d5..665ed889 100644 --- a/schemes/main/manifest.json +++ b/schemes/main/manifest.json @@ -1,5 +1,5 @@ { - "base-tag": "swift-DEVELOPMENT-SNAPSHOT-2024-04-13-a", + "base-tag": "swift-DEVELOPMENT-SNAPSHOT-2024-04-23-a", "build-compiler": false, "icu4c": "https://github.com/swiftwasm/icu4c-wasi/releases/download/0.8.0/icu4c-wasi.tar.xz", "swift-org-download-channel": "development" diff --git a/tools/build/package-toolchain b/tools/build/package-toolchain index 0b8e0a1b..85dbffba 100755 --- a/tools/build/package-toolchain +++ b/tools/build/package-toolchain @@ -37,11 +37,11 @@ class SnapshotInfo: return f"{self.artifact_name}.artifactbundle.zip" -def derive_wasi_sysroot(options, packaging_dir: str) -> str: +def derive_wasi_sysroot(options, packaging_dir: str, target_triple: str) -> str: if options.download_wasi_sysroot: return os.path.join('..', 'build-sdk', 'wasi-sysroot') else: - return os.path.join(packaging_dir, 'wasi-sysroot') + return os.path.join(packaging_dir, 'wasi-sysroot', target_triple) def copy_icu_libs(build_sdk_path, dist_toolchain_path): @@ -116,7 +116,7 @@ class PackageAction(Action): os.remove(swift_driver_path) # Select wasi-sysroot - wasi_sysroot_path = derive_wasi_sysroot(self.options, packaging_dir) + wasi_sysroot_path = derive_wasi_sysroot(self.options, packaging_dir, 'wasm32-wasi') print("=====> Using wasi-sysroot from {}".format(wasi_sysroot_path)) # Now dist toolchain always has cross compiler regardless of whether @@ -439,8 +439,9 @@ def main(): os.path.dirname(__file__), '..', '..', '..', 'build', 'Packaging') toolchain_channel = derive_toolchain_channel(options.scheme) - for target_triple in [ - "wasm32-unknown-wasi", "wasm32-unknown-wasip1-threads" + for target_triple, short_triple in [ + ["wasm32-unknown-wasi", "wasm32-wasi"], + ["wasm32-unknown-wasip1-threads", "wasm32-wasip1-threads"] ]: snapshot_info = SnapshotInfo( now.year, now.month, now.day, @@ -454,7 +455,7 @@ def main(): base_toolchain_path=os.path.join(packaging_dir, 'base-snapshot'), host_toolchain_path=None, target_toolchain_path=os.path.join(packaging_dir, 'target-toolchain', target_triple), - wasi_sysroot_path=derive_wasi_sysroot(options, packaging_dir), + wasi_sysroot_path=derive_wasi_sysroot(options, packaging_dir, short_triple), swift_sdk_name=f"{snapshot_info.swift_version}-{target_triple}", target_triple=target_triple, ))