Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/swift-6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
xtremekforever committed Dec 23, 2024
2 parents e302e06 + 53e40ba commit 7abcf98
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 17 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-swift-nightly.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/build-swift-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build Swift Versions

on:
push:
branches: [ "main", "feature/**" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down
1 change: 1 addition & 0 deletions build-foundation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion build-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
1 change: 1 addition & 0 deletions build-swift-stdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions swift-builder/build-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
4 changes: 1 addition & 3 deletions swift-builder/build-gh-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
4 changes: 1 addition & 3 deletions swift-builder/swift-builder-common
Original file line number Diff line number Diff line change
@@ -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}}
13 changes: 7 additions & 6 deletions swift-hello/Tests/swift-helloTests/swift_helloTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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*/

0 comments on commit 7abcf98

Please sign in to comment.