diff --git a/.github/workflows/build-swift-nightly.yml b/.github/workflows/build-swift-nightly.yml new file mode 100644 index 0000000..88e53fa --- /dev/null +++ b/.github/workflows/build-swift-nightly.yml @@ -0,0 +1,47 @@ +name: Build Swift Nightly + +on: + push: + branches: [ "feature/swift-6.1" ] + pull_request: + branches: [ "main" ] + +env: + DISTRIBUTION: debian-bookworm + +jobs: + nightly: + strategy: + matrix: + branch: ["swift-6.1-branch", "development"] + env: + SWIFT_TAG: + SWIFT_BRANCH: ${{ matrix.branch }} + SWIFT_PLATFORM: ubuntu2204 + SWIFT_VERSION: ${{ matrix.branch }} + name: Build Swift Nigtly + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get Latest Nightly Version + shell: bash + run: | + export $(curl https://download.swift.org/${{ env.SWIFT_BRANCH }}/${{ env.SWIFT_PLATFORM }}/latest-build.yml | grep 'dir:' | sed 's/:[^:\/\/]/=/g') + echo "Latest Tag on ${{ env.SWIFT_BRANCH }} Branch: $dir" + echo "SWIFT_TAG=$(echo $dir)" >> $GITHUB_ENV + - uses: ./.github/actions/checkout-swift + name: Fetch Swift Sources + with: + swift-tag: ${{ env.SWIFT_TAG }} + swift-workspace-cache: ${{ env.SWIFT_BRANCH }}-workspace + - name: Build Swift Nightly Container + shell: bash + run: | + source ./swift-builder/swift-builder-common + ./swift-builder/build-container.sh + - uses: ./.github/actions/build-for-distribution + name: Build & Publish Swift + with: + swift-tag: ${{ env.SWIFT_TAG }} + distribution: ${{ env.DISTRIBUTION }} + builder-tag: ${{ env.SWIFT_VERSION }} diff --git a/.github/workflows/build-swift-versions.yml b/.github/workflows/build-swift-versions.yml index a1c6e4d..2b8a8db 100644 --- a/.github/workflows/build-swift-versions.yml +++ b/.github/workflows/build-swift-versions.yml @@ -2,7 +2,7 @@ name: Build Swift Versions on: push: - branches: [ "main", "feature/**" ] + branches: [ "main" ] pull_request: branches: [ "main" ] diff --git a/build-foundation.sh b/build-foundation.sh index 4d16059..114c892 100755 --- a/build-foundation.sh +++ b/build-foundation.sh @@ -37,6 +37,7 @@ LIBS="-latomic" cmake -S $FOUNDATION_SRCDIR -B $FOUNDATION_BUILDDIR -G Ninja \ -DCMAKE_Swift_FLAGS_DEBUG="" \ -DCMAKE_Swift_FLAGS_RELEASE="" \ -DCMAKE_Swift_FLAGS_RELWITHDEBINFO="" \ + -DSwiftFoundation_MACRO="${SWIFT_NATIVE_PATH}../lib/host/plugins/libFoundationMacros.so" \ -D_SwiftFoundation_SourceDIR="$SRC_ROOT/downloads/swift-foundation" \ -D_SwiftFoundationICU_SourceDIR="$SRC_ROOT/downloads/swift-foundation-icu" \ -D_SwiftCollections_SourceDIR="$SRC_ROOT/downloads/swift-collections" \ diff --git a/build-in-container.sh b/build-in-container.sh index 0e7cf58..e31276d 100755 --- a/build-in-container.sh +++ b/build-in-container.sh @@ -10,7 +10,7 @@ source ./swift-builder/swift-builder-common echo "Building Swift ${SWIFT_TAG} using ${DOCKER_TAG}..." docker run \ --rm -ti \ - --user ${BUILD_USER}:${BUILD_USER} \ + --user ${USER}:${USER} \ --volume $(pwd):/src \ --workdir /src \ -e SWIFT_VERSION=${SWIFT_TAG} \ diff --git a/build-swift-stdlib.sh b/build-swift-stdlib.sh index 407ca72..8477719 100755 --- a/build-swift-stdlib.sh +++ b/build-swift-stdlib.sh @@ -54,6 +54,7 @@ LIBS="-latomic" cmake -S $SWIFT_SRCDIR -B $SWIFT_BUILDDIR -G Ninja \ -DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES=ON \ -DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=ON \ -DSWIFT_ENABLE_SYNCHRONIZATION=ON \ + -DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB=OFF \ -DSWIFT_INCLUDE_TESTS=OFF \ -DSWIFT_INCLUDE_TEST_BINARIES=OFF \ -DSWIFT_BUILD_TEST_SUPPORT_MODULES=OFF \ diff --git a/build.sh b/build.sh index 742a99d..f9cd834 100755 --- a/build.sh +++ b/build.sh @@ -31,7 +31,9 @@ rm -rf $STAGING_DIR/usr/lib/swift* ./build-dispatch.sh ./build-foundation.sh ./build-xctest.sh -if [[ $SWIFT_VERSION == *"6."* ]]; then + +# NOTE: Swift-testing is disabled in 6.1 since it fails to compile +if [[ $SWIFT_VERSION == *"6.0"* ]]; then ./build-swift-testing.sh fi diff --git a/swift-builder/build-container.sh b/swift-builder/build-container.sh index 9e31602..b045d8d 100755 --- a/swift-builder/build-container.sh +++ b/swift-builder/build-container.sh @@ -9,7 +9,7 @@ echo "Building container for Swift $SWIFT_VERSION, branch $SWIFT_BRANCH, tag $SW docker build \ --build-arg SWIFT_VERSION=${SWIFT_TAG} \ --build-arg SWIFT_BRANCH=${SWIFT_BRANCH} \ - --build-arg USER=${BUILD_USER} \ - --build-arg UID=${BUILD_USER_ID} \ + --build-arg USER=${USER} \ + --build-arg UID=${UID} \ -t ${DOCKER_TAG} \ ${SCRIPT_DIR} diff --git a/swift-builder/build-gh-runner.sh b/swift-builder/build-gh-runner.sh index f033fe9..2051f0b 100755 --- a/swift-builder/build-gh-runner.sh +++ b/swift-builder/build-gh-runner.sh @@ -6,13 +6,11 @@ if [ -z $SWIFT_VERSION ]; then fi export DOCKER_TAG=${DOCKER_TAG:=xtremekforever/swift-builder:${SWIFT_VERSION}-gh-runner} -export BUILD_USER=runner -export BUILD_USER_ID=1001 SCRIPT_DIR=$(dirname "$0") source ${SCRIPT_DIR}/swift-builder-common -./build-container.sh +USER=runner UID=1001 ./build-container.sh if [ ! -z $PUSH ]; then echo "Pushing ${DOCKER_TAG} now..." diff --git a/swift-builder/swift-builder-common b/swift-builder/swift-builder-common index d6af23f..cf7624f 100644 --- a/swift-builder/swift-builder-common +++ b/swift-builder/swift-builder-common @@ -1,7 +1,5 @@ SWIFT_VERSION=${SWIFT_VERSION:=6.0.3} SWIFT_BRANCH=${SWIFT_BRANCH:=swift-${SWIFT_VERSION}-release} SWIFT_TAG=${SWIFT_TAG:=swift-${SWIFT_VERSION}-RELEASE} -BUILD_USER=${BUILD_USER:=build-user} -BUILD_USER_ID=${BUILD_USER_ID:=$UID} -DOCKER_TAG=${DOCKER_TAG:=swift-builder:${SWIFT_VERSION}} +DOCKER_TAG=${DOCKER_TAG:=xtremekforever/swift-builder:${SWIFT_VERSION}} diff --git a/swift-hello/Tests/swift-helloTests/swift_helloTests.swift b/swift-hello/Tests/swift-helloTests/swift_helloTests.swift index 8f8c155..ef09795 100644 --- a/swift-hello/Tests/swift-helloTests/swift_helloTests.swift +++ b/swift-hello/Tests/swift-helloTests/swift_helloTests.swift @@ -2,9 +2,9 @@ import XCTest import class Foundation.Bundle -#if canImport(Testing) +/*#if canImport(Testing) import Testing -#endif +#endif*/ final class swift_helloTests: XCTestCase { func testExample() throws { @@ -51,9 +51,10 @@ final class swift_helloTests: XCTestCase { } } -#if canImport(Testing) - @Test +// Disabled due to compiler crash in 6.1 +/*#if canImport(Testing) + /*@Test func swiftTesting() { #expect(true) - } -#endif + }*/ +#endif*/