Skip to content

Attempt to build libdispatch on Linux #718

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

Closed
wants to merge 9 commits into from
Closed
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
112 changes: 56 additions & 56 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,61 +47,61 @@ jobs:
# name: linux-test-results
# path: ./swift-test-results.tar.gz

macos_build:
timeout-minutes: 0
runs-on: macos-latest
# macos_build:
# timeout-minutes: 0
# runs-on: macos-latest

steps:
- uses: actions/checkout@v1
with:
path: swift
- uses: actions/cache@v1
with:
path: ../build-cache
key: ${{ runner.os }}-sccache-v4
- name: Build macOS installable archive
run: ./utils/webassembly/ci.sh
- name: Upload macOS installable archive
uses: actions/upload-artifact@v1
with:
name: macos-installable
path: ../swift-wasm-DEVELOPMENT-SNAPSHOT-osx.tar.gz
- name: Upload packaging scripts
uses: actions/upload-artifact@v1
with:
name: packaging-scripts
path: utils/webassembly
- name: Pack test results
run: tar cJf swift-test-results.tar.gz ../build/*/swift-macosx-x86_64/swift-test-results
- name: Upload test results
uses: actions/upload-artifact@v1
with:
name: macos-test-results
path: ./swift-test-results.tar.gz
macos_smoke_test:
name: Compile hello.swift on macOS
runs-on: macos-latest
needs: macos_build
steps:
- name: Download installable macOS archive
uses: actions/download-artifact@v1
with:
name: macos-installable
- name: Build hello.wasm
shell: bash
run: |
set -x
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
TOOLCHAIN_PATH=$(find . -name "swift-wasm-*" -type d)
echo 'print("Hello, world!")' > hello.swift
$TOOLCHAIN_PATH/usr/bin/swiftc \
-target wasm32-unknown-wasi \
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
hello.swift -o hello.wasm && \
echo "Successfully linked hello.wasm"
# steps:
# - uses: actions/checkout@v1
# with:
# path: swift
# - uses: actions/cache@v1
# with:
# path: ../build-cache
# key: ${{ runner.os }}-sccache-v4
# - name: Build macOS installable archive
# run: ./utils/webassembly/ci.sh
# - name: Upload macOS installable archive
# uses: actions/upload-artifact@v1
# with:
# name: macos-installable
# path: ../swift-wasm-DEVELOPMENT-SNAPSHOT-osx.tar.gz
# - name: Upload packaging scripts
# uses: actions/upload-artifact@v1
# with:
# name: packaging-scripts
# path: utils/webassembly
# - name: Pack test results
# run: tar cJf swift-test-results.tar.gz ../build/*/swift-macosx-x86_64/swift-test-results
# - name: Upload test results
# uses: actions/upload-artifact@v1
# with:
# name: macos-test-results
# path: ./swift-test-results.tar.gz
# macos_smoke_test:
# name: Compile hello.swift on macOS
# runs-on: macos-latest
# needs: macos_build
# steps:
# - name: Download installable macOS archive
# uses: actions/download-artifact@v1
# with:
# name: macos-installable
# - name: Build hello.wasm
# shell: bash
# run: |
# set -x
# tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
# TOOLCHAIN_PATH=$(find . -name "swift-wasm-*" -type d)
# echo 'print("Hello, world!")' > hello.swift
# $TOOLCHAIN_PATH/usr/bin/swiftc \
# -target wasm32-unknown-wasi \
# -sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
# hello.swift -o hello.wasm && \
# echo "Successfully linked hello.wasm"

- name: Upload hello.wasm compiled with macOS package
uses: actions/upload-artifact@v1
with:
name: macos-hello.wasm
path: hello.wasm
# - name: Upload hello.wasm compiled with macOS package
# uses: actions/upload-artifact@v1
# with:
# name: macos-hello.wasm
# path: hello.wasm
2 changes: 1 addition & 1 deletion utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def apply_default_arguments(toolchain, args):
# On OS X, libdispatch is provided by the OS.
# On Linux, we must ensure that it is built manually.
if (args.build_foundation and
platform.system() != "Darwin"):
platform.system() != "Darwin" and not args.wasm):
args.build_libdispatch = True

if args.build_subdir is None:
Expand Down
4 changes: 2 additions & 2 deletions utils/update_checkout/update-checkout-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"swift-corelibs-xctest": {
"remote": { "id": "apple/swift-corelibs-xctest" } },
"swift-corelibs-foundation": {
"remote": { "id": "apple/swift-corelibs-foundation" } },
"remote": { "id": "swiftwasm/swift-corelibs-foundation" } },
"swift-corelibs-libdispatch": {
"remote": { "id": "apple/swift-corelibs-libdispatch" } },
"swift-integration-tests": {
Expand Down Expand Up @@ -63,7 +63,7 @@
"swift-syntax": "master",
"swift-stress-tester": "master",
"swift-corelibs-xctest": "master",
"swift-corelibs-foundation": "master",
"swift-corelibs-foundation": "swiftwasm",
"swift-corelibs-libdispatch": "master",
"swift-integration-tests": "master",
"swift-xcode-playground-support": "master",
Expand Down
1 change: 1 addition & 0 deletions utils/webassembly/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SWIFT_PATH=$SOURCE_PATH/swift

$SWIFT_PATH/utils/build-script --wasm \
--skip-build-benchmarks \
--libdispatch true \
--extra-cmake-options=" \
-DSWIFT_PRIMARY_VARIANT_SDK:STRING=WASI \
-DSWIFT_PRIMARY_VARIANT_ARCH:STRING=wasm32 \
Expand Down
5 changes: 5 additions & 0 deletions utils/webassembly/linux/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -ex

dpkg -l | grep gcc
dpkg -l | grep libc
dpkg -l | grep libstdc

sudo apt-get purge libgcc-9-dev gcc-9
sudo apt update
sudo apt install -y \
git ninja-build clang python python-six \
Expand Down