Skip to content

Run packaging scripts and smoke test on CI #15

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 7 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 44 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,56 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Run a multi-line script
- name: Build Linux installable archive
run: ./ci-linux.sh
- name: Upload Linux installable archive
uses: actions/upload-artifact@v1
with:
name: linux-installable
path: ../swiftwasm-linux.tar.gz

macos_build:
timeout-minutes: 0
runs-on: macOS-10.14

steps:
- uses: actions/checkout@v1
- name: Run a multi-line script
- name: Build macOS installable archive
run: ./ci-mac.sh
- name: Upload macOS installable archive
uses: actions/upload-artifact@v1
with:
name: macos-installable
path: ../swiftwasm-mac.tar.gz

package:
name: Build SwiftWasm packages
needs:
- linux_build
- macos_build
runs-on: ubuntu-18.04
steps:
- name: Download installable Linux archive
uses: actions/download-artifact@v1
with:
name: linux-installable
- name: Download installable macOS archive
uses: actions/download-artifact@v1
with:
name: macos-installable
- name: Build the packages
shell: bash
run: |
git clone https://github.com/swiftwasm/swiftwasm-package-sdk.git
cd swiftwasm-package-sdk
./download-prebuilts.sh

cp ../linux-installable/swiftwasm-linux.tar.gz prebuilt/swiftwasm.tar.gz
cp ../macos-installable/swiftwasm-mac.tar.gz prebuilt/swiftwasm-mac.tar.gz
./build-packages.sh

cd output
tar xf swiftwasm-sdk-linux.tar.xz

cd swiftwasm-sdk
./swiftwasm example/hello.swift hello.wasm
2 changes: 1 addition & 1 deletion build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export sourcedir=$PWD/..
--install-destdir="$sourcedir/install" \
--install-prefix="/opt/swiftwasm-sdk" \
--install-swift \
--installable-package="$sourcedir/swiftwasm.tar.gz" \
--installable-package="$sourcedir/swiftwasm-linux.tar.gz" \
--llvm-targets-to-build "X86;WebAssembly" \
--stdlib-deployment-targets "wasm-wasm32" \
--wasm-icu-data "todo-icu-data" \
Expand Down
6 changes: 4 additions & 2 deletions stdlib/private/StdlibUnittest/SymbolLookup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(Wasm)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand All @@ -23,7 +23,7 @@

#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
let RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: -2)
#elseif os(Linux)
#elseif os(Linux) || os(Wasm)
let RTLD_DEFAULT = UnsafeMutableRawPointer(bitPattern: 0)
#elseif os(Android)
#if arch(arm) || arch(i386)
Expand All @@ -43,6 +43,8 @@ public func pointerToSwiftCoreSymbol(name: String) -> UnsafeMutableRawPointer? {
#if os(Windows)
return unsafeBitCast(GetProcAddress(hStdlibCore, name),
to: UnsafeMutableRawPointer?.self)
#elseif os(Wasm)
fatalError("\(#function) is not supported on WebAssembly")
#else
return dlsym(RTLD_DEFAULT, name)
#endif
Expand Down