Skip to content

Commit 2db367f

Browse files
authored
Merge pull request #2083 from swiftwasm/katei/remove-sed-backup-file-5.3
Remove sed backup file from toolchain for 5.3 branch, cherry-pick #2081
2 parents 6d113b8 + ec823a3 commit 2db367f

File tree

4 files changed

+68
-33
lines changed

4 files changed

+68
-33
lines changed

.github/workflows/main.yml

+56-24
Original file line numberDiff line numberDiff line change
@@ -153,32 +153,44 @@ jobs:
153153
uses: actions/download-artifact@v1
154154
with:
155155
name: macos-installable
156-
- name: Build hello.wasm
157-
shell: bash
156+
- name: Unpack toolchain
158157
run: |
159158
set -x
160159
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
161-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
160+
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
161+
- name: Build hello.wasm
162+
shell: bash
163+
run: |
162164
echo 'print("Hello, world!")' > hello.swift
163-
$TOOLCHAIN_PATH/usr/bin/swiftc \
165+
$TOOLCHAIN/usr/bin/swiftc \
164166
-target wasm32-unknown-wasi \
165-
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
167+
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
166168
hello.swift -o hello.wasm && \
167169
echo "Successfully linked hello.wasm"
168170
- name: Test SwiftPM
169171
shell: bash
170172
run: |
171173
set -x
172-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
173174
mkdir test
174175
cd test
175-
$TOOLCHAIN_PATH/usr/bin/swift package init
176-
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
176+
$TOOLCHAIN/usr/bin/swift package init
177+
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
177178
- name: Upload hello.wasm compiled with macOS package
178179
uses: actions/upload-artifact@v1
179180
with:
180181
name: macos-hello.wasm
181182
path: hello.wasm
183+
- name: Checkout integration-tests
184+
uses: actions/checkout@v2
185+
with:
186+
repository: swiftwasm/integration-tests
187+
path: integration-tests
188+
ref: release/5.3
189+
- name: Run integration tests
190+
run: |
191+
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer/
192+
swift run # Use TOOLCHAIN env value
193+
working-directory: ${{ github.workspace }}/integration-tests
182194

183195
ubuntu1804_smoke_test:
184196
name: Run smoke tests on Ubuntu 18.04
@@ -189,32 +201,42 @@ jobs:
189201
uses: actions/download-artifact@v1
190202
with:
191203
name: ubuntu18.04-installable
192-
- name: Build hello.wasm
193-
shell: bash
204+
- name: Unpack toolchain
194205
run: |
195206
set -x
196207
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
197-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
208+
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
209+
- name: Build hello.wasm
210+
shell: bash
211+
run: |
198212
echo 'print("Hello, world!")' > hello.swift
199-
$TOOLCHAIN_PATH/usr/bin/swiftc \
213+
$TOOLCHAIN/usr/bin/swiftc \
200214
-target wasm32-unknown-wasi \
201-
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
215+
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
202216
hello.swift -o hello.wasm && \
203217
echo "Successfully linked hello.wasm"
204218
- name: Test SwiftPM
205219
shell: bash
206220
run: |
207221
set -x
208-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
209222
mkdir test
210223
cd test
211-
$TOOLCHAIN_PATH/usr/bin/swift package init
212-
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
224+
$TOOLCHAIN/usr/bin/swift package init
225+
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
213226
- name: Upload hello.wasm compiled with Ubuntu 18.04 package
214227
uses: actions/upload-artifact@v1
215228
with:
216229
name: ubuntu18.04-hello.wasm
217230
path: hello.wasm
231+
- name: Checkout integration-tests
232+
uses: actions/checkout@v2
233+
with:
234+
repository: swiftwasm/integration-tests
235+
path: integration-tests
236+
ref: release/5.3
237+
- name: Run integration tests
238+
run: swift run # Use TOOLCHAIN env value
239+
working-directory: ${{ github.workspace }}/integration-tests
218240

219241
ubuntu2004_smoke_test:
220242
name: Run smoke tests on Ubuntu 20.04
@@ -225,29 +247,39 @@ jobs:
225247
uses: actions/download-artifact@v1
226248
with:
227249
name: ubuntu20.04-installable
228-
- name: Build hello.wasm
229-
shell: bash
250+
- name: Unpack toolchain
230251
run: |
231252
set -x
232253
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
233-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
254+
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
255+
- name: Build hello.wasm
256+
shell: bash
257+
run: |
234258
echo 'print("Hello, world!")' > hello.swift
235-
$TOOLCHAIN_PATH/usr/bin/swiftc \
259+
$TOOLCHAIN/usr/bin/swiftc \
236260
-target wasm32-unknown-wasi \
237-
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
261+
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
238262
hello.swift -o hello.wasm && \
239263
echo "Successfully linked hello.wasm"
240264
- name: Test SwiftPM
241265
shell: bash
242266
run: |
243267
set -x
244-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
245268
mkdir test
246269
cd test
247-
$TOOLCHAIN_PATH/usr/bin/swift package init
248-
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
270+
$TOOLCHAIN/usr/bin/swift package init
271+
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
249272
- name: Upload hello.wasm compiled with Ubuntu 20.04 package
250273
uses: actions/upload-artifact@v1
251274
with:
252275
name: ubuntu20.04-hello.wasm
253276
path: hello.wasm
277+
- name: Checkout integration-tests
278+
uses: actions/checkout@v2
279+
with:
280+
repository: swiftwasm/integration-tests
281+
path: integration-tests
282+
ref: release/5.3
283+
- name: Run integration tests
284+
run: swift run # Use TOOLCHAIN env value
285+
working-directory: ${{ github.workspace }}/integration-tests

utils/webassembly/build-foundation.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ cmake -G Ninja \
2121
ninja -v
2222
ninja -v install
2323

24-
# On macOS the target CoreFoundation shadows the CoreFoundation suppplied by Xcode.
25-
# On Linux though there's no system CoreFoundation, its headers have to be shipped
26-
# in the installable archive and serve for both host and target.
27-
if [[ "$(uname)" == "Darwin" ]]; then
28-
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/CoreFoundation \
29-
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/CoreFoundation
30-
fi
24+
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/CoreFoundation \
25+
$DESTINATION_TOOLCHAIN/usr/lib/swift_static/CoreFoundation
26+
27+
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/Foundation.swiftmodule \
28+
$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swiftmodule
29+
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/Foundation.swiftdoc \
30+
$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swiftdoc

utils/webassembly/build-toolchain.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ merge_toolchains() {
121121
rsync -v -a $TARGET_TOOLCHAIN_SDK/usr/bin/ $DIST_TOOLCHAIN_SDK/usr/bin/
122122

123123
# Replace absolute sysroot path with relative path
124-
sed -i -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" $DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap
124+
sed -i.bak -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" "$DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap"
125+
rm "$DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap.bak"
126+
sed -i.bak -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" "$DIST_TOOLCHAIN_SDK/usr/lib/swift_static/wasi/wasm32/wasi.modulemap"
127+
rm "$DIST_TOOLCHAIN_SDK/usr/lib/swift_static/wasi/wasm32/wasi.modulemap.bak"
125128
}
126129

127130
create_darwin_info_plist() {

utils/webassembly/build-xctest.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cmake -G Ninja \
1515
-DWASI_SDK_PATH="$SOURCE_PATH/wasi-sdk" \
1616
-DBUILD_SHARED_LIBS=OFF \
1717
-DCMAKE_Swift_COMPILER_FORCED=ON \
18-
-DSWIFT_FOUNDATION_PATH=$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32 \
18+
-DSWIFT_FOUNDATION_PATH=$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32 \
1919
"${SOURCE_PATH}/swift-corelibs-xctest"
2020

2121
ninja -v

0 commit comments

Comments
 (0)