Skip to content

Remove sed backup file from toolchain for 5.3 branch #2083

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 10 commits into from
Oct 25, 2020
80 changes: 56 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,32 +153,44 @@ jobs:
uses: actions/download-artifact@v1
with:
name: macos-installable
- name: Build hello.wasm
shell: bash
- name: Unpack toolchain
run: |
set -x
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
- name: Build hello.wasm
shell: bash
run: |
echo 'print("Hello, world!")' > hello.swift
$TOOLCHAIN_PATH/usr/bin/swiftc \
$TOOLCHAIN/usr/bin/swiftc \
-target wasm32-unknown-wasi \
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
hello.swift -o hello.wasm && \
echo "Successfully linked hello.wasm"
- name: Test SwiftPM
shell: bash
run: |
set -x
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
mkdir test
cd test
$TOOLCHAIN_PATH/usr/bin/swift package init
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
$TOOLCHAIN/usr/bin/swift package init
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
- name: Upload hello.wasm compiled with macOS package
uses: actions/upload-artifact@v1
with:
name: macos-hello.wasm
path: hello.wasm
- name: Checkout integration-tests
uses: actions/checkout@v2
with:
repository: swiftwasm/integration-tests
path: integration-tests
ref: release/5.3
- name: Run integration tests
run: |
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer/
swift run # Use TOOLCHAIN env value
working-directory: ${{ github.workspace }}/integration-tests

ubuntu1804_smoke_test:
name: Run smoke tests on Ubuntu 18.04
Expand All @@ -189,32 +201,42 @@ jobs:
uses: actions/download-artifact@v1
with:
name: ubuntu18.04-installable
- name: Build hello.wasm
shell: bash
- name: Unpack toolchain
run: |
set -x
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
- name: Build hello.wasm
shell: bash
run: |
echo 'print("Hello, world!")' > hello.swift
$TOOLCHAIN_PATH/usr/bin/swiftc \
$TOOLCHAIN/usr/bin/swiftc \
-target wasm32-unknown-wasi \
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
hello.swift -o hello.wasm && \
echo "Successfully linked hello.wasm"
- name: Test SwiftPM
shell: bash
run: |
set -x
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
mkdir test
cd test
$TOOLCHAIN_PATH/usr/bin/swift package init
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
$TOOLCHAIN/usr/bin/swift package init
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
- name: Upload hello.wasm compiled with Ubuntu 18.04 package
uses: actions/upload-artifact@v1
with:
name: ubuntu18.04-hello.wasm
path: hello.wasm
- name: Checkout integration-tests
uses: actions/checkout@v2
with:
repository: swiftwasm/integration-tests
path: integration-tests
ref: release/5.3
- name: Run integration tests
run: swift run # Use TOOLCHAIN env value
working-directory: ${{ github.workspace }}/integration-tests

ubuntu2004_smoke_test:
name: Run smoke tests on Ubuntu 20.04
Expand All @@ -225,29 +247,39 @@ jobs:
uses: actions/download-artifact@v1
with:
name: ubuntu20.04-installable
- name: Build hello.wasm
shell: bash
- name: Unpack toolchain
run: |
set -x
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
- name: Build hello.wasm
shell: bash
run: |
echo 'print("Hello, world!")' > hello.swift
$TOOLCHAIN_PATH/usr/bin/swiftc \
$TOOLCHAIN/usr/bin/swiftc \
-target wasm32-unknown-wasi \
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
hello.swift -o hello.wasm && \
echo "Successfully linked hello.wasm"
- name: Test SwiftPM
shell: bash
run: |
set -x
TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
mkdir test
cd test
$TOOLCHAIN_PATH/usr/bin/swift package init
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
$TOOLCHAIN/usr/bin/swift package init
$TOOLCHAIN/usr/bin/swift build --triple wasm32-unknown-wasi
- name: Upload hello.wasm compiled with Ubuntu 20.04 package
uses: actions/upload-artifact@v1
with:
name: ubuntu20.04-hello.wasm
path: hello.wasm
- name: Checkout integration-tests
uses: actions/checkout@v2
with:
repository: swiftwasm/integration-tests
path: integration-tests
ref: release/5.3
- name: Run integration tests
run: swift run # Use TOOLCHAIN env value
working-directory: ${{ github.workspace }}/integration-tests
14 changes: 7 additions & 7 deletions utils/webassembly/build-foundation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ cmake -G Ninja \
ninja -v
ninja -v install

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

mv $DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/Foundation.swiftmodule \
$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swiftmodule
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/Foundation.swiftdoc \
$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swiftdoc
5 changes: 4 additions & 1 deletion utils/webassembly/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ merge_toolchains() {
rsync -v -a $TARGET_TOOLCHAIN_SDK/usr/bin/ $DIST_TOOLCHAIN_SDK/usr/bin/

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

create_darwin_info_plist() {
Expand Down
2 changes: 1 addition & 1 deletion utils/webassembly/build-xctest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmake -G Ninja \
-DWASI_SDK_PATH="$SOURCE_PATH/wasi-sdk" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_Swift_COMPILER_FORCED=ON \
-DSWIFT_FOUNDATION_PATH=$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32 \
-DSWIFT_FOUNDATION_PATH=$DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32 \
"${SOURCE_PATH}/swift-corelibs-xctest"

ninja -v
Expand Down