Skip to content

Commit 8c34b0b

Browse files
Merge pull request #2081 from swiftwasm/katei/remove-sed-backup-file
Remove sed backup file from toolchain
2 parents d62be52 + 201bf5b commit 8c34b0b

File tree

4 files changed

+58
-30
lines changed

4 files changed

+58
-30
lines changed

.github/workflows/main.yml

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -153,32 +153,43 @@ 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+
- name: Run integration tests
189+
run: |
190+
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer/
191+
swift run # Use TOOLCHAIN env value
192+
working-directory: ${{ github.workspace }}/integration-tests
182193

183194
ubuntu1804_smoke_test:
184195
name: Run smoke tests on Ubuntu 18.04
@@ -189,32 +200,41 @@ jobs:
189200
uses: actions/download-artifact@v1
190201
with:
191202
name: ubuntu18.04-installable
192-
- name: Build hello.wasm
193-
shell: bash
203+
- name: Unpack toolchain
194204
run: |
195205
set -x
196206
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
197-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
207+
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
208+
- name: Build hello.wasm
209+
shell: bash
210+
run: |
198211
echo 'print("Hello, world!")' > hello.swift
199-
$TOOLCHAIN_PATH/usr/bin/swiftc \
212+
$TOOLCHAIN/usr/bin/swiftc \
200213
-target wasm32-unknown-wasi \
201-
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
214+
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
202215
hello.swift -o hello.wasm && \
203216
echo "Successfully linked hello.wasm"
204217
- name: Test SwiftPM
205218
shell: bash
206219
run: |
207220
set -x
208-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
209221
mkdir test
210222
cd test
211-
$TOOLCHAIN_PATH/usr/bin/swift package init
212-
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
223+
$TOOLCHAIN/usr/bin/swift package init
224+
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
213225
- name: Upload hello.wasm compiled with Ubuntu 18.04 package
214226
uses: actions/upload-artifact@v1
215227
with:
216228
name: ubuntu18.04-hello.wasm
217229
path: hello.wasm
230+
- name: Checkout integration-tests
231+
uses: actions/checkout@v2
232+
with:
233+
repository: swiftwasm/integration-tests
234+
path: integration-tests
235+
- name: Run integration tests
236+
run: swift run # Use TOOLCHAIN env value
237+
working-directory: ${{ github.workspace }}/integration-tests
218238

219239
ubuntu2004_smoke_test:
220240
name: Run smoke tests on Ubuntu 20.04
@@ -225,29 +245,38 @@ jobs:
225245
uses: actions/download-artifact@v1
226246
with:
227247
name: ubuntu20.04-installable
228-
- name: Build hello.wasm
229-
shell: bash
248+
- name: Unpack toolchain
230249
run: |
231250
set -x
232251
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
233-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
252+
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
253+
- name: Build hello.wasm
254+
shell: bash
255+
run: |
234256
echo 'print("Hello, world!")' > hello.swift
235-
$TOOLCHAIN_PATH/usr/bin/swiftc \
257+
$TOOLCHAIN/usr/bin/swiftc \
236258
-target wasm32-unknown-wasi \
237-
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
259+
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
238260
hello.swift -o hello.wasm && \
239261
echo "Successfully linked hello.wasm"
240262
- name: Test SwiftPM
241263
shell: bash
242264
run: |
243265
set -x
244-
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
245266
mkdir test
246267
cd test
247-
$TOOLCHAIN_PATH/usr/bin/swift package init
248-
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
268+
$TOOLCHAIN/usr/bin/swift package init
269+
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
249270
- name: Upload hello.wasm compiled with Ubuntu 20.04 package
250271
uses: actions/upload-artifact@v1
251272
with:
252273
name: ubuntu20.04-hello.wasm
253274
path: hello.wasm
275+
- name: Checkout integration-tests
276+
uses: actions/checkout@v2
277+
with:
278+
repository: swiftwasm/integration-tests
279+
path: integration-tests
280+
- name: Run integration tests
281+
run: swift run # Use TOOLCHAIN env value
282+
working-directory: ${{ github.workspace }}/integration-tests

utils/webassembly/build-foundation.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ cmake -G Ninja \
2020

2121
ninja -v
2222
ninja -v install
23-
24-
# .swiftdoc and .swiftmodule files should live in `swift`, not in `swift_static`
25-
mv $DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swift* \
26-
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32

utils/webassembly/build-toolchain.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ merge_toolchains() {
115115
rsync -v -a "$TARGET_TOOLCHAIN_SDK/usr/bin/" "$DIST_TOOLCHAIN_SDK/usr/bin/"
116116

117117
# Replace absolute sysroot path with relative path
118-
sed -i -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" "$DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap"
118+
sed -i.bak -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" "$DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap"
119+
rm "$DIST_TOOLCHAIN_SDK/usr/lib/swift/wasi/wasm32/wasi.modulemap.bak"
120+
sed -i.bak -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" "$DIST_TOOLCHAIN_SDK/usr/lib/swift_static/wasi/wasm32/wasi.modulemap"
121+
rm "$DIST_TOOLCHAIN_SDK/usr/lib/swift_static/wasi/wasm32/wasi.modulemap.bak"
119122
}
120123

121124
create_darwin_info_plist() {

utils/webassembly/build-xctest.sh

Lines changed: 1 addition & 1 deletion
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)