From 972ce8697f677614d65015c9de726f5101048caf Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 12:54:50 +0900 Subject: [PATCH 1/8] Stop adding SwiftWasm toolchain to PATH in CI The SwiftWasm toolchain is just used for testing, and it's not necessary to add it to the PATH in the whole CI job. --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82641fc5..fc6277b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,7 @@ jobs: uses: swiftwasm/setup-swiftwasm@v1 with: swift-version: "wasm-5.8.0-RELEASE" + add-to-path: false - name: Select Xcode version run: sudo xcode-select -switch /Applications/${{ matrix.xcode }}.app - name: Configure Tests/default.json @@ -37,7 +38,7 @@ jobs: "hostSdkRootPath": "$(xcrun --show-sdk-path --sdk macosx)" } EOS - - run: env PATH=/usr/bin:$PATH swift test + - run: swift test # TODO: Enable spectest and wasi-testsuite checks build-linux: @@ -61,6 +62,7 @@ jobs: uses: swiftwasm/setup-swiftwasm@v1 with: swift-version: "wasm-5.8.0-RELEASE" + add-to-path: false - name: Configure Tests/default.json run: | cat < Tests/default.json @@ -69,6 +71,6 @@ jobs: "hostSwiftExecutablePath": "/usr/bin/swift" } EOS - - run: env PATH=/usr/bin:$PATH swift test + - run: swift test - run: ./CI/check-spectest.sh - run: ./CI/check-wasi-testsuite.sh From 60263816c4f734038266485de4bd0d2503913fe1 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:07:18 +0900 Subject: [PATCH 2/8] Add CI job for building with CMake --- .github/workflows/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc6277b0..85a2e4bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,3 +74,17 @@ jobs: - run: swift test - run: ./CI/check-spectest.sh - run: ./CI/check-wasi-testsuite.sh + + build-cmake: + runs-on: ubuntu-20.04 + container: + image: swift:5.8-focal + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install CMake + run: sudo apt-get install cmake ninja + - run: cmake -G Ninja -B ./build + - run: cmake --build ./build + - run: ./build/bin/wasmkit-cli --version From 6b357a7abd5237a17c1c9cb20e6a792fc4d1b287 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:08:32 +0900 Subject: [PATCH 3/8] Fix CMake build --- Sources/WASI/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/WASI/CMakeLists.txt b/Sources/WASI/CMakeLists.txt index 5f3bbaa4..74144a9f 100644 --- a/Sources/WASI/CMakeLists.txt +++ b/Sources/WASI/CMakeLists.txt @@ -8,6 +8,8 @@ add_wasmkit_library(WASI Platform/SandboxPrimitives.swift FileSystem.swift GuestMemorySupport.swift + Clock.swift + RandomBufferGenerator.swift WASI.swift ) From dcbcdac0995f4f22282a8f16e34c7b51826291dc Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:11:02 +0900 Subject: [PATCH 4/8] Remove sudo from apt-get install --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85a2e4bf..369e1185 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: with: submodules: recursive - name: Install CMake - run: sudo apt-get install cmake ninja + run: apt-get install cmake ninja - run: cmake -G Ninja -B ./build - run: cmake --build ./build - run: ./build/bin/wasmkit-cli --version From ce1bac4c980ddf108a4913850ff05bbb624ab584 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:15:20 +0900 Subject: [PATCH 5/8] Need apt-get update before apt-get install --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 369e1185..bfd9532d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: with: submodules: recursive - name: Install CMake - run: apt-get install cmake ninja + run: apt-get update && apt-get install cmake ninja - run: cmake -G Ninja -B ./build - run: cmake --build ./build - run: ./build/bin/wasmkit-cli --version From 927fb25000c2b0c9307addaaf101a12754b8e60e Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:16:37 +0900 Subject: [PATCH 6/8] ninja-build is the package name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfd9532d..86694e59 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: with: submodules: recursive - name: Install CMake - run: apt-get update && apt-get install cmake ninja + run: apt-get update && apt-get install cmake ninja-build - run: cmake -G Ninja -B ./build - run: cmake --build ./build - run: ./build/bin/wasmkit-cli --version From d4e06e8af98e994b69f079d452829cff1ca048c2 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:19:44 +0900 Subject: [PATCH 7/8] Install CMake without asking for confirmation --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86694e59..ab174ed2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: with: submodules: recursive - name: Install CMake - run: apt-get update && apt-get install cmake ninja-build + run: apt-get update && apt-get install -y cmake ninja-build - run: cmake -G Ninja -B ./build - run: cmake --build ./build - run: ./build/bin/wasmkit-cli --version From 4f1452c8056ce84a5c2ae5e20cb212462b0e1265 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Apr 2024 13:26:33 +0900 Subject: [PATCH 8/8] Install CMake from the official release tarball --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab174ed2..7d657fc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,8 +83,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - name: Install Ninja + run: apt-get update && apt-get install -y ninja-build - name: Install CMake - run: apt-get update && apt-get install -y cmake ninja-build + run: | + apt-get install -y curl + curl -L https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-linux-x86_64.tar.gz | tar xz --strip-component 1 -C /usr/local/ - run: cmake -G Ninja -B ./build - run: cmake --build ./build - run: ./build/bin/wasmkit-cli --version