Skip to content

Repair main and release/5.9 build #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
412c489
Repair release/5.9 build
kateinoigakukun Oct 28, 2023
9040cde
Update base toolchain channel for 5.9
kateinoigakukun Oct 29, 2023
753fac1
Pin release/5.9 container
kateinoigakukun Oct 29, 2023
8dfe61a
Use bootstrapping=hosttools
kateinoigakukun Oct 29, 2023
cb46580
Install libdispatch in host toolchain
kateinoigakukun Oct 29, 2023
6029570
Add missing libdispatch build for Linux
kateinoigakukun Oct 29, 2023
84104a8
Remove out-dated release/5.8 scheme
kateinoigakukun Oct 28, 2023
7f74568
Update base snapshot swift-DEVELOPMENT-SNAPSHOT-2023-10-27-a
kateinoigakukun Oct 28, 2023
4ad5971
Remove upstreamed patches
kateinoigakukun Oct 28, 2023
f06bddf
Make build-toolchain clang version independent
kateinoigakukun Oct 29, 2023
b2d0346
Update wasi-sysroot in main scheme
kateinoigakukun Oct 29, 2023
8ac466f
Remove pthread hack from swift-corelibs-foundation
kateinoigakukun Oct 29, 2023
8224fd1
Skip applying patch if no patch dir
kateinoigakukun Oct 29, 2023
d307ed6
Build with swift.org toolchain if no compiler patch is needed
kateinoigakukun Oct 29, 2023
864752c
Fix cross compiler build condition
kateinoigakukun Oct 29, 2023
de436d3
Fix ci.sh
kateinoigakukun Oct 29, 2023
ffb7116
Symlink even if all tools are available
kateinoigakukun Oct 29, 2023
8ef0cec
Use clang compiler to build llvm
kateinoigakukun Oct 29, 2023
c4e4bfc
Repair lit.cfg in release/5.9
kateinoigakukun Oct 29, 2023
078e68e
Fix base toolchain path
kateinoigakukun Oct 29, 2023
75fc49e
Use cancelled() instead of always() as much as possible
kateinoigakukun Oct 30, 2023
85383aa
Fix llvm cmake error
kateinoigakukun Oct 30, 2023
88645bb
Build FileCheck if it doesn't exist
kateinoigakukun Oct 30, 2023
5c6be89
Use llvm-tools build dir if exists
kateinoigakukun Oct 30, 2023
2911001
Apply debugger support patch
kateinoigakukun Oct 30, 2023
0da9987
Build lld instead of wasm-ld
kateinoigakukun Oct 30, 2023
8c02d0a
add workaround for resource dir
kateinoigakukun Oct 30, 2023
cf0af16
Fix release-5.9 build-compiler check
kateinoigakukun Oct 30, 2023
e6ac225
Configure with sccache and fix missing LLVM_ENABLE_PROJECTS
kateinoigakukun Oct 30, 2023
9492dba
Fix clang version extraction
kateinoigakukun Oct 30, 2023
e010627
Copy host toolchain into target toolchain for layout compatibility
kateinoigakukun Oct 30, 2023
240da6a
Use legacy driver for now
kateinoigakukun Oct 31, 2023
1015d5e
Build icu4c with latest upstream wasi-sdk
kateinoigakukun Oct 31, 2023
a707d88
Create wasm-ld symlink if it already exists
kateinoigakukun Oct 31, 2023
242e794
Set SWIFT_STDLIB_HAS_ASL explicitly
kateinoigakukun Oct 31, 2023
a3be3ee
Turn-on back swapfile
kateinoigakukun Oct 31, 2023
2023b84
Set SWIFT_RUNTIME_CRASH_REPORTER_CLIENT explicitly
kateinoigakukun Oct 31, 2023
b65bc0f
Set several cmake variables
kateinoigakukun Oct 31, 2023
4c10257
Skip building sdk overlays
kateinoigakukun Oct 31, 2023
02c2b18
Optimize disk footprint
kateinoigakukun Oct 31, 2023
b869aba
Install extra llvm tools if necessary
kateinoigakukun Oct 31, 2023
cca5a7a
Set CI environment variable to activate disk-footprint optimization
kateinoigakukun Oct 31, 2023
00e2533
Cleanup docker volume just before e2e tests
kateinoigakukun Oct 31, 2023
9cd9522
Clean build directory after running tests
kateinoigakukun Oct 31, 2023
f44fcd4
Stop and remove container before removing attached volume
kateinoigakukun Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/scripts/build-matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"build_os": "ubuntu-18.04",
"agent_query": "ubuntu-20.04",
"target": "ubuntu18.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04",
"containers": {
"main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04",
"release/5.9": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04@sha256:c996b1fe2babba4e468a6422d9fbe1a9e080e4745c5cb933e4eeaed0a5a95840",
},
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
Expand All @@ -18,7 +21,10 @@
"build_os": "ubuntu-20.04",
"agent_query": "ubuntu-20.04",
"target": "ubuntu20.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"containers": {
"main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"release/5.9": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04@sha256:61d40c32e63abbebb35fa682d78991e0cb9b186f280ba42adec89443905af2f4",
},
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
Expand All @@ -30,7 +36,10 @@
"build_os": "ubuntu-22.04",
"agent_query": "ubuntu-22.04",
"target": "ubuntu22.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04",
"containers": {
"main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04",
"release/5.9": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04@sha256:a55c1ab110d3ef8b1605234245803b5917484990d0b3a00077f9957ae386da97",
},
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
Expand All @@ -42,7 +51,10 @@
"build_os": "amazon-linux-2",
"agent_query": "ubuntu-22.04",
"target": "amazonlinux2_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2",
"containers": {
"main": "ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2",
"release/5.9": "ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2@sha256:5aa7643df1a0d2ea43d86e1dfa603848760deb6efba50349bd00fee9395d0ded",
},
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
Expand Down Expand Up @@ -105,7 +117,10 @@ def main
"build_os": "ubuntu-20.04",
"agent_query": label,
"target": "ubuntu20.04_aarch64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"containers": {
"main": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"release/5.9": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04@sha256:61d40c32e63abbebb35fa682d78991e0cb9b186f280ba42adec89443905af2f4",
},
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
Expand Down Expand Up @@ -133,7 +148,10 @@ def main
raise "Unknown scheme: #{scheme}"
end
matrix_entries.map do |entry|
entry.merge("scheme": scheme, toolchain_channel: toolchain_channel)
container = if containers = entry[:containers]
containers[scheme.to_sym] || containers[:main]
end
entry.merge("scheme": scheme, toolchain_channel: toolchain_channel, container: container)
end
end

Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
name: Build matrix
needs: [start-runner]
runs-on: ubuntu-latest
if: ${{ always() }}
if: ${{ !cancelled() }}
outputs:
entries: ${{ steps.generate.outputs.entries }}
steps:
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 30
needs: [build-matrix]
if: ${{ always() }}
if: ${{ !cancelled() }}
strategy:
fail-fast: false
matrix:
Expand All @@ -113,8 +113,6 @@ jobs:
if: ${{ matrix.free_disk_space }}
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo rm -rf /opt/hostedtoolcache
sudo rm -rf /usr/share/dotnet
sudo apt clean
Expand Down Expand Up @@ -188,6 +186,7 @@ jobs:
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-dit \
-e CI=$CI \
-w /home/build-user/ \
-v ${{ github.workspace }}:/source \
-v oss-swift-package:/home/build-user \
Expand All @@ -196,7 +195,7 @@ jobs:
docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-${{ matrix.target }}.tar.gz .

- name: Extract build-cache from Docker container
if: ${{ matrix.container != null && always() }}
if: ${{ matrix.container != null && !cancelled() }}
run: |
rm -rf ${{ github.workspace }}/build-cache
docker cp swiftwasm-ci-buildbot:/home/build-user/build-cache ${{ github.workspace }}/build-cache
Expand All @@ -209,7 +208,7 @@ jobs:
run: ./swiftwasm-build/tools/build/ci.sh ${{ matrix.scheme }}

- uses: actions/cache/save@v3
if: ${{ always() }}
if: ${{ !cancelled() }}
with:
path: build-cache
key: ${{ steps.cache_key.outputs.SCCACHE_KEY }}
Expand All @@ -223,7 +222,8 @@ jobs:
- name: Run stdlib tests for wasi-wasm32
if: ${{ matrix.run_stdlib_test && matrix.container != null }}
run: |
docker exec swiftwasm-ci-buildbot /bin/bash -lc "cd build/WebAssembly/swift-stdlib-wasi-wasm32 && ninja check-swift-wasi-wasm32-custom"
docker exec swiftwasm-ci-buildbot /bin/bash -lc \
"ninja -C build/WebAssembly/swift-stdlib-wasi-wasm32 check-swift-wasi-wasm32-custom && rm -rf build"
- name: Run stdlib tests for wasi-wasm32
if: ${{ matrix.run_stdlib_test && matrix.container == null }}
run: |
Expand All @@ -248,6 +248,13 @@ jobs:
name: ${{ matrix.target }}-test-results
path: ./swift-test-results.tar.gz

- name: Cleanup docker volume
if: ${{ matrix.container != null }}
run: |
docker stop swiftwasm-ci-buildbot
docker rm swiftwasm-ci-buildbot
docker volume rm --force oss-swift-package

# Run e2e test
- name: Prepare E2E test
run: |
Expand All @@ -262,6 +269,7 @@ jobs:
$TOOLCHAIN/usr/bin/swiftc \
-target wasm32-unknown-wasi \
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
-resource-dir $TOOLCHAIN/usr/lib/swift_static \
hello.swift -o hello.wasm && \
echo "Successfully linked hello.wasm"
- name: Upload hello.wasm
Expand Down
5 changes: 4 additions & 1 deletion schemes/main/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"base-tag": "swift-DEVELOPMENT-SNAPSHOT-2023-08-03-a",
"base-tag": "swift-DEVELOPMENT-SNAPSHOT-2023-10-27-a",
"repos": {
"swift-corelibs-foundation": "660624d0220c0efbef054f4919f9f01fd3866be1",
"swift-corelibs-xctest": "77bc9f5386ee8a2a4e8da5ac30e846b451d101b6"
},
"build-compiler": false,
"icu4c": "https://github.com/swiftwasm/icu4c-wasi/releases/download/0.7.0/icu4c-wasi.tar.xz",
"wasi-sysroot": "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sysroot-19.0.tar.gz",
"swift-org-download-channel": "development"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 2be8e97d311ee0a7530303d62bcd51e7cba6df59 Mon Sep 17 00:00:00 2001
From: Yuta Saito <kateinoigakukun@gmail.com>
Date: Sun, 29 Oct 2023 00:39:00 +0000
Subject: [PATCH 1/2] [wasm] import emulated wasi-libc module for mman apis

---
Sources/Foundation/Data.swift | 1 +
Sources/Foundation/FileHandle.swift | 1 +
2 files changed, 2 insertions(+)

diff --git a/Sources/Foundation/Data.swift b/Sources/Foundation/Data.swift
index f6b9a06b..f396129a 100644
--- a/Sources/Foundation/Data.swift
+++ b/Sources/Foundation/Data.swift
@@ -29,6 +29,7 @@
@usableFromInline let memcpy = Glibc.memcpy
@usableFromInline let memcmp = Glibc.memcmp
#elseif canImport(WASILibc)
+@_implementationOnly import wasi_emulated_mman
@usableFromInline let calloc = WASILibc.calloc
@usableFromInline let malloc = WASILibc.malloc
@usableFromInline let free = WASILibc.free
diff --git a/Sources/Foundation/FileHandle.swift b/Sources/Foundation/FileHandle.swift
index 5e28678c..670d684f 100644
--- a/Sources/Foundation/FileHandle.swift
+++ b/Sources/Foundation/FileHandle.swift
@@ -26,6 +26,7 @@ fileprivate let _write = Glibc.write(_:_:_:)
fileprivate let _close = Glibc.close(_:)
#elseif canImport(WASILibc)
import WASILibc
+@_implementationOnly import wasi_emulated_mman
fileprivate let _read = WASILibc.read(_:_:_:)
fileprivate let _write = WASILibc.write(_:_:_:)
fileprivate let _close = WASILibc.close(_:)
--
2.40.0

Loading