From e0f5ae3ec864afb80479cb3834f5e7f6747df979 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 23 Jul 2024 10:43:26 -0700 Subject: [PATCH 01/20] repo: switch default branch to `release/6.0` --- default.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/default.xml b/default.xml index c9ce8dc13..dd6aefdab 100644 --- a/default.xml +++ b/default.xml @@ -2,11 +2,11 @@ - + - + @@ -26,7 +26,7 @@ - + @@ -45,9 +45,9 @@ - + - + From ce581ebe0c21fba7ff9f38d0e608f49cd2dcd7e8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 23 Jul 2024 11:04:19 -0700 Subject: [PATCH 02/20] Update swift-toolchain.yml Apply stable snapshotting to release/6.0 branch rather than main. --- .github/workflows/swift-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 8f03436be..4942ff452 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -3346,7 +3346,7 @@ jobs: if ! git diff --exit-code ; then git add stable.xml git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" - git push origin HEAD:main + git push origin HEAD:release/6.0 fi release: From 92d981febb3a6e3837ecc2deb355ddd6810272ab Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Tue, 23 Jul 2024 12:01:27 -0700 Subject: [PATCH 03/20] Adjust default.xml for release/6.0 As per https://github.com/swiftlang/swift/blob/7eff8fbb44007d60b998eec33e128e30056dc9db/utils/update_checkout/update-checkout-config.json#L169 --- default.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/default.xml b/default.xml index dd6aefdab..df11c4e3d 100644 --- a/default.xml +++ b/default.xml @@ -10,7 +10,7 @@ - + @@ -35,8 +35,8 @@ - - + + From 0eba59b19dbe28d8fac517e6ff501e6e74e48f1b Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Tue, 23 Jul 2024 12:54:22 -0700 Subject: [PATCH 04/20] Fix default.xml. Fix a typo for swift-nio. Use main for swift-testing because it doesn't have release branches. apple/swift-testing: fatal: couldn't find remote ref refs/heads/release/6.0 apple/swift-testing: sleeping 4.0 seconds before retrying fatal: couldn't find remote ref refs/heads/release/6.0 error: Cannot fetch apple/swift-testing from https://github.com/apple/swift-testing Fetching: 100% (2/2), done in 10.012s error: Cannot checkout apple/swift-nio: ManifestInvalidRevisionError: revision release/6.0 in apple/swift-nio not found --- default.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.xml b/default.xml index df11c4e3d..98ad11acf 100644 --- a/default.xml +++ b/default.xml @@ -35,13 +35,13 @@ - + - + From 4fb1bfe273d14014c8c5950bfd4bdf5b47c86f53 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Tue, 23 Jul 2024 15:13:46 -0700 Subject: [PATCH 05/20] Update workflow to match release/5.10 --- .../workflows/release-swift-toolchain-schedule.yml | 11 ++++------- .github/workflows/swift-toolchain.yml | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-swift-toolchain-schedule.yml b/.github/workflows/release-swift-toolchain-schedule.yml index 71d18f210..5d8a261ee 100644 --- a/.github/workflows/release-swift-toolchain-schedule.yml +++ b/.github/workflows/release-swift-toolchain-schedule.yml @@ -2,18 +2,15 @@ name: Release Toolchains on: workflow_dispatch: - # Schedule to build a new release toolchain nightly. - # Note: This is disabled on compnerd/swift-build as the - # build times out when running the GitHub workflow in that repo. - # schedule: - # - cron: "10 0 * * */1" + schedule: + - cron: "10 0 * * */1" jobs: # Each job builds a release toolchain for a specific Swift version. - build-release-5_10: + build-release-6_0: # Note: GitHub requires the use of an 'owner/repo' path before the # workflow file path when we want to use a workflow from another branch. - uses: compnerd/swift-build/.github/workflows/swift-toolchain.yml@release/5.10 + uses: compnerd/swift-build/.github/workflows/swift-toolchain.yml@release/6.0 secrets: SYMBOL_SERVER_PAT: ${{ secrets.SYMBOL_SERVER_PAT }} CERTIFICATE: ${{ secrets.CERTIFICATE }} diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 4942ff452..c7f13a726 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -1,11 +1,11 @@ -name: Development Snapshot +name: swift-toolchain on: workflow_dispatch: inputs: swift_version: description: 'Swift Version' - default: '0.0.0' + default: '6.0.0' required: false type: string From 6f13d69f8db80ca0f024e60bdbd90844aa30322e Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi <56735936+hjyamauchi@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:43:10 -0700 Subject: [PATCH 06/20] Override cmake to avoid the cmake 3.30 issue * Override cmake to avoid the cmake 3.30 issue. Co-authored-by: Saleem Abdulrasool --- .github/workflows/swift-toolchain.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index c7f13a726..f862a7c95 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -1686,6 +1686,11 @@ jobs: release-asset-name: installer-amd64.exe release-tag-name: '20231016.0' + # workaround CMake 3.30 issue + - uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.29' + - uses: nttld/setup-ndk@v1 id: setup-ndk with: From d08423d2c2e5099b9e8af709c34ee2237bcc5a2b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 25 Jul 2024 11:49:45 -0700 Subject: [PATCH 07/20] Update swift-toolchain.yml Checkout the release/6.0 branch for snapshotting. --- .github/workflows/swift-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index f862a7c95..b19535076 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -3338,7 +3338,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: refs/heads/main + ref: release/6.0 show-progress: false - uses: actions/download-artifact@v4 From fab2eda481e5526f4b0b8655fbe08114e66339d4 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Thu, 25 Jul 2024 16:33:57 -0700 Subject: [PATCH 08/20] GHA: update for swift-foundation, swift-foundation-icu Cherrypick commit https://github.com/compnerd/swift-build/commit/203d5a020893304c4419ff377ee87eaa497d4875 --- .github/workflows/swift-toolchain.yml | 238 +- .github/workflows/swift-toolchain.yml.orig | 3395 ++++++++++++++++++++ 2 files changed, 3522 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/swift-toolchain.yml.orig diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index b19535076..5fe57307e 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -105,6 +105,8 @@ jobs: swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} + swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }} + swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }} swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} @@ -169,6 +171,8 @@ jobs: swift_driver_revision=refs/tags/${{ inputs.swift_tag }} swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} swift_format_revision=refs/heads/main + swift_foundation_revison=refs/heads/main + swift_foundation_icu_revision=refs/tags/0.0.8 swift_installer_scripts_revision=refs/heads/main swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} @@ -376,6 +380,7 @@ jobs: name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-3.43.2 path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr + # TODO(compnerd): remove this once android migrates to swift-foundation icu_tools: needs: [context] runs-on: ${{ needs.context.outputs.windows_build_runner }} @@ -447,6 +452,7 @@ jobs: ${{ github.workspace }}/BinaryCache/icu-tools-69.1/pkgdata.exe ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genccode.exe + # TODO(compnerd): remove this once android migrates to swift-foundation icu: needs: [context, icu_tools] runs-on: ${{ needs.context.outputs.windows_build_runner }} @@ -455,36 +461,6 @@ jobs: fail-fast: false matrix: include: - - arch: amd64 - BUILD_TOOLS: NO - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - BUILD_TOOLS: NO - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - BUILD_TOOLS: YES - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - arch: arm64 BUILD_TOOLS: NO BUILD_DATA: NO @@ -1593,6 +1569,7 @@ jobs: steps: - uses: actions/download-artifact@v4 + if: matrix.os == 'Android' with: name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr @@ -1652,6 +1629,27 @@ jobs: ref: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation show-progress: false + - uses: actions/checkout@v4 + if: matrix.os == 'Windows' + with: + repository: apple/swift-foundation + ref: ${{ needs.context.outputs.swift_foundation_revision }} + path: ${{ github.workspace }}/SourceCache/swift-foundation + show-progress: false + - uses: actions/checkout@v4 + if: matrix.os == 'Windows' + with: + repository: apple/swift-foundation-icu + ref: ${{ needs.context.outputs.swift_foundation_icu_revision }} + path: ${{ github.workspace }}/SourceCache/swift-foundation-icu + show-progress: false + - uses: actions/checkout@v4 + if: matrix.os == 'Windows' + with: + repository: apple/swift-collections + ref: ${{ needs.context.outputs.swift_collections_revision }} + path: ${{ github.workspace }}/SourceCache/swift-collections + show-progress: false - uses: actions/checkout@v4 if: matrix.os == 'Android' with: @@ -1672,6 +1670,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing show-progress: false + # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - uses: compnerd/gha-setup-vsdevenv@main with: host_arch: amd64 @@ -1691,6 +1690,12 @@ jobs: with: cmake-version: '3.29' + # FIXME(compnerd): workaround CMake 3.30 issue + - uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.29' + + # NOTE(compnerd): we execute unconditionally as we reference outputs - uses: nttld/setup-ndk@v1 id: setup-ndk with: @@ -1836,9 +1841,21 @@ jobs: $zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" } $xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" } - $icu_data_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicudt69.lib" } else { "libicudt69.a" } - $icu_i18n_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuuc69.lib" } else { "libicuin69.a" } - $icu_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuin69.lib" } else { "libicuuc69.a" } + + $SWIFT_FOUNDATION_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation + $SWIFT_FOUNDATION_ICU_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation-icu + $SWIFT_COLLECTIONS_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-collections + + $ICU_FLAGS = if ("${{ matrix.os }}" -eq "Android") { + "-D","ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicudt69.a", + "-D","ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuin69.a", + "-D","ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr", + "-D","ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include", + "-D","ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuuc69.a" + } else { + @() + } + $build_tools = if ("${{ matrix.os }}" -eq "Windows") { "YES" } else { "NO" } Remove-Item env:\SDKROOT @@ -1874,11 +1891,10 @@ jobs: -D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr/lib/cmake/CURL ` -D FOUNDATION_BUILD_TOOLS=${build_tools} ` -D ENABLE_TESTING=NO ` - -D ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_data_lib_release ` - -D ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_i18n_lib_release ` - -D ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -D ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include ` - -D ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_lib_release ` + @ICU_FLAGS ` + -D _SwiftFoundation_SourceDIR=$SWIFT_FOUNDATION_SOURCE_DIR ` + -D _SwiftFoundationICU_SourceDIR=$SWIFT_FOUNDATION_ICU_SOURCE_DIR ` + -D _SwiftCollections_SourceDIR=$SWIFT_COLLECTIONS_SOURCE_DIR ` -D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" ` -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 ` -D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib ` @@ -2152,15 +2168,22 @@ jobs: - run: | $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" - mv ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + + Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/_foundation_unicode ${env:SDKROOT}/usr/include + Move-Item ${env:SDKROOT}/usr/lib/swift/_FoundationCShims ${env:SDKROOT}/usr/include + + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - name: Configure swift-argument-parser run: | @@ -2699,24 +2722,40 @@ jobs: triple: aarch64-unknown-windows-msvc steps: - - name: Download build compilers + - name: Download Compilers uses: actions/download-artifact@v4 with: name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/ + path: ${{ github.workspace }}/BuildRoot/Library - - name: Download build devtools + - name: Download Devtools uses: actions/download-artifact@v4 with: name: devtools-amd64 - path: ${{ github.workspace }}/BuildRoot/ + path: ${{ github.workspace }}/BuildRoot/Library - # We're using the runtime libraries from this one. - - name: Download Windows SDK (AMD64) - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BinaryCache/ + path: ${{ github.workspace }}/BinaryCache + - name: Download SDK + uses: actions/download-artifact@v4 + with: + name: Windows-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + + - uses: actions/download-artifact@v4 + if: matrix.arch == 'arm64' + with: + name: cmark-gfm-arm64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - name: Copy Windows SDK (AMD64) to BuildRoot run: Copy-Item -Recurse -Force -Path ${{ github.workspace }}/BinaryCache/* -Destination ${{ github.workspace }}/BuildRoot/ @@ -2724,52 +2763,33 @@ jobs: - name: Update environment variables run: | $SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/SDKs/Windows.sdk" - $ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin" - $RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin" - echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "TOOLCHAIN_PATH=${ToolchainPath}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "AR=${ToolchainPath}\llvm-ar.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + $ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin" echo "${ToolchainPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "AR=${ToolchainPath}\llvm-ar.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + $RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin" echo "${RTLPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 - run: | - mv ${{ env.SDKROOT }}/usr/lib/swift/dispatch ${{ env.SDKROOT }}/usr/include/ - mv ${{ env.SDKROOT }}/usr/lib/swift/os ${{ env.SDKROOT }}/usr/include/ - mv ${{ env.SDKROOT }}/usr/lib/swift/Block ${{ env.SDKROOT }}/usr/include/ - - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - - - name: Download ${{ matrix.arch }} Windows SDK - # Only necessary when cross-compiling - if: ${{ matrix.arch != 'amd64' }} - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/ + - run: | + $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" - - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 - # Only necessary when cross-compiling - if: ${{ matrix.arch != 'amd64' }} - run: | - # We already copied these above. - # Remove them to prevent 'module defined more than once' errors. - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/dispatch - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/os - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/Block - - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ + Move-Item ${env:SDKROOT}/usr/lib/swift/_foundation_unicode ${env:SDKROOT}/usr/include + Move-Item ${env:SDKROOT}/usr/lib/swift/_FoundationCShims ${env:SDKROOT}/usr/include + + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - name: Checkout apple/swift uses: actions/checkout@v4 @@ -2779,11 +2799,6 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift show-progress: false - # Note: We didn't need to explicitly download cmark-gfm above because it's packaged inside - # compilers-${{ matrix.arch }}. - - name: Setup cmark-gfm - run: Copy-Item ${{ github.workspace }}/BuildRoot/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ env.TOOLCHAIN_PATH }} - - name: Build swift-inspect id: swift_inspect shell: cmd @@ -2791,14 +2806,15 @@ jobs: swift build ^ --triple=${{ matrix.triple }} ^ --scratch-path="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect" ^ - --sdk="${{ env.SDKROOT }}" ^ + --sdk="%SDKROOT%" ^ --package-path="${{ github.workspace }}/SourceCache/swift/tools/swift-inspect" ^ -c="release" ^ - -Xbuild-tools-swiftc="-L${{ env.SDKROOT }}/usr/lib/swift/windows" ^ - -Xbuild-tools-swiftc="-I${{ env.SDKROOT }}/usr/lib/swift -use-ld=lld" ^ - -Xcc="-I${{ env.SDKROOT }}/usr/include/swift/SwiftRemoteMirror" ^ - -Xlinker="${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/swiftRemoteMirror.lib" ^ - -Xswiftc="-use-ld=lld" + -Xbuild-tools-swiftc="-L%SDKROOT%/usr/lib/swift/windows" ^ + -Xbuild-tools-swiftc="-I%SDKROOT%/usr/lib/swift" ^ + -Xbuild-tools-swiftc="-use-ld=lld" ^ + -Xcc="-I%SDKROOT%/usr/include/swift/SwiftRemoteMirror" ^ + -Xswiftc="-use-ld=lld" ^ + -Xlinker="%SDKROOT%/usr/lib/swift/windows/${{ matrix.cpu }}/swiftRemoteMirror.lib" - name: Copy swift-inspect executable run: | @@ -2966,7 +2982,7 @@ jobs: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.cab package_sdk_runtime: - name: Package SDK & Runtime + name: Package Windows SDK & Runtime needs: [context, sdk] runs-on: ${{ needs.context.outputs.windows_build_runner }} @@ -3066,7 +3082,7 @@ jobs: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.cab package_android_sdk: - name: Package Android SDK + name: Package Android SDK & Runtime needs: [context, sdk] runs-on: ${{ needs.context.outputs.windows_build_runner }} @@ -3076,12 +3092,12 @@ jobs: include: - arch: arm64 cpu: aarch64 - - arch: x86_64 - cpu: x86_64 - arch: armv7 cpu: armv7 - arch: i686 cpu: i686 + - arch: x86_64 + cpu: x86_64 steps: - uses: actions/download-artifact@v4 diff --git a/.github/workflows/swift-toolchain.yml.orig b/.github/workflows/swift-toolchain.yml.orig new file mode 100644 index 000000000..b19535076 --- /dev/null +++ b/.github/workflows/swift-toolchain.yml.orig @@ -0,0 +1,3395 @@ +name: swift-toolchain + +on: + workflow_dispatch: + inputs: + swift_version: + description: 'Swift Version' + default: '6.0.0' + required: false + type: string + + android_api_level: + description: 'Android API Level' + default: 28 + required: false + type: number + + swift_tag: + description: 'Swift Build Tag' + required: false + type: string + + debug_info: + description: 'Emit PDBs (Debug Info)' + default: false + type: boolean + + signed: + description: 'Code Sign' + default: false + type: boolean + + create_release: + description: 'Create Release' + type: boolean + default: true + required: false + + workflow_call: + inputs: + swift_version: + description: 'Swift Version' + default: '0.0.0' + required: false + type: string + + android_api_level: + description: 'Android API Level' + default: 28 + required: false + type: number + + swift_tag: + description: 'Swift Build Tag' + required: false + type: string + + debug_info: + description: 'Emit PDBs (Debug Info)' + default: true + type: boolean + + signed: + description: 'Code Sign' + default: false + type: boolean + + create_release: + description: 'Create Release' + type: boolean + default: true + required: false + + secrets: + SYMBOL_SERVER_PAT: + required: true + CERTIFICATE: + required: true + PASSPHRASE: + required: true + +env: + SCCACHE_DIRECT: yes + +jobs: + context: + runs-on: ubuntu-latest + outputs: + curl_revision: ${{ steps.context.outputs.curl_revision }} + icu_revision: ${{ steps.context.outputs.icu_revision }} + indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }} + libxml2_revision: ${{ steps.context.outputs.libxml2_revision }} + llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }} + sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }} + swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }} + swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }} + swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }} + swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }} + swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }} + swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }} + swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }} + swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }} + swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }} + swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }} + swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} + swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} + swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} + swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} + swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} + swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} + swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }} + swift_revision: ${{ steps.context.outputs.swift_revision }} + swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }} + swift_system_revision: ${{ steps.context.outputs.swift_system_revision }} + swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }} + yams_revision: ${{ steps.context.outputs.yams_revision }} + zlib_revision: ${{ steps.context.outputs.zlib_revision }} + ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }} + WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} + ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }} + ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} + ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} + CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }} + debug_info: ${{ steps.context.outputs.debug_info }} + signed: ${{ steps.context.outputs.signed }} + swift_version: ${{ steps.context.outputs.swift_version }} + swift_tag: ${{ steps.context.outputs.swift_tag }} + windows_build_runner: ${{ steps.context.outputs.windows_build_runner }} + compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }} + steps: + - id: context + name: Generate Build Context + run: | + # TODO(compnerd) can we make this more silent? + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils + + # Which branch is this workflow based on + branch_version_string=${{ inputs.swift_version || '0.0.0' }} + if [[ $branch_version_string == *.* ]]; then + branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }') + else + branch_name="release/$branch_version_string" + fi + + repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name + repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all) + + if [[ "${{ inputs.swift_tag }}" != "" ]] ; then + tee -a "${GITHUB_OUTPUT}" <<-EOF + indexstore_db_revision=refs/tags/${{ inputs.swift_tag }} + llvm_project_revision=refs/tags/${{ inputs.swift_tag }} + sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }} + swift_revision=refs/tags/${{ inputs.swift_tag }} + swift_argument_parser_revision=refs/tags/1.4.0 + swift_asn1_revision=refs/tags/0.7.0 + swift_atomics_revision=refs/tags/1.2.0 + swift_certificates_revision=refs/tags/0.1.0 + swift_cmark_revision=refs/tags/${{ inputs.swift_tag }} + swift_collections_revision=refs/tags/1.1.2 + swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }} + swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }} + swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }} + swift_crypto_revision=refs/tags/3.0.0 + swift_driver_revision=refs/tags/${{ inputs.swift_tag }} + swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} + swift_format_revision=refs/heads/main + swift_installer_scripts_revision=refs/heads/main + swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} + swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} + swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }} + swift_syntax_revision=refs/tags/${{ inputs.swift_tag }} + swift_system_revision=refs/tags/1.3.0 + swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }} + curl_revision=refs/tags/curl-8_5_0 + libxml2_revision=refs/tags/v2.11.5 + yams_revision=refs/tags/5.0.6 + zlib_revision=refs/tags/v1.3.1 + icu_revision=refs/heads/maint/maint-69 + EOF + else + repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \ + xmllint --xpath "//project/@name | //project/@revision" - | \ + xargs -n2 | \ + awk -F'[= ]' '{ + split($2, repo, "/"); + gsub(/-/, "_", repo[2]); + print tolower(repo[2]) "_revision=" $4 + }' | tee -a "${GITHUB_OUTPUT}" + repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml + fi + + # FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1. + # see: https://github.com/actions/runner-images/issues/10004 + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then + echo debug_info=true >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} + echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} + else + echo debug_info=false >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} + fi + echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then + # FIXME(compnerd) enable this when requested + echo signed=false >> ${GITHUB_OUTPUT} + else + echo signed=false >> ${GITHUB_OUTPUT} + fi + + echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT} + if [[ -n "${{ inputs.swift_tag }}" ]] ; then + echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} + else + if [[ "$branch_name" == "main" ]] ; then + echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} + else + echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} + fi + fi + + echo windows_build_runner=${{ vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} + echo compilers_build_runner=${{ vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} + + echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT} + + - uses: actions/upload-artifact@v4 + with: + name: stable.xml + path: stable.xml + if-no-files-found: ignore + + sqlite: + needs: [context] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} SQLite3 + + steps: + - uses: actions/checkout@v4 + with: + path: ${{ github.workspace }}/SourceCache/swift-build + show-progress: false + + - name: download sqlite + run: | + curl.exe -sL "https://sqlite.org/2023/sqlite-amalgamation-3430200.zip" -o $env:TEMP\sqlite-amalgamation-3430200.zip + New-Item -ItemType Directory -Path ${{ github.workspace }}\SourceCache\sqlite-3.43.2 + unzip.exe -j -o $env:TEMP\sqlite-amalgamation-3430200.zip -d ${{ github.workspace }}\SourceCache\sqlite-3.43.2 + + - name: Copy CMakeLists.txt + run: Copy-Item ${{ github.workspace }}\SourceCache\swift-build\cmake\SQLite\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\sqlite-3.43.2\CMakeLists.txt + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: ${{ matrix.os }}-${{ matrix.arch }}-sqlite + variant: sccache + append-timestamp: false + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure SQLite + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/sqlite-3.43.2 + - name: Build SQLite + run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 + - name: Install SQLite + run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 --target install + + - uses: actions/upload-artifact@v4 + with: + name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-3.43.2 + path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr + + icu_tools: + needs: [context] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + steps: + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: actions/checkout@v4 + with: + repository: unicode-org/icu + ref: ${{ needs.context.outputs.icu_revision }} + path: ${{ github.workspace }}/SourceCache/icu + show-progress: false + + - name: Copy CMakeLists.txt + run: Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: amd64 + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: windows-amd64-icu_tools + variant: sccache + append-timestamp: false + + - name: Configure ICU Build Tools + run: + cmake -B ${{ github.workspace }}/BinaryCache/icu-tools-69.1 ` + -D BUILD_SHARED_LIBS=NO ` + -D BUILD_TOOLS=YES ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/icu/icu4c + + - name: Build ICU Tools + run: cmake --build ${{ github.workspace }}/BinaryCache/icu-tools-69.1 + + - uses: actions/upload-artifact@v4 + with: + name: icu-tools-69.1 + path: | + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genbrk.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencfu.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencnval.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gendict.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genrb.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gensprep.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/icupkg.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/makeconv.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/pkgdata.exe + ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genccode.exe + + icu: + needs: [context, icu_tools] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + BUILD_TOOLS: NO + BUILD_DATA: YES + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + BUILD_TOOLS: NO + BUILD_DATA: YES + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + BUILD_TOOLS: YES + BUILD_DATA: YES + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + BUILD_TOOLS: NO + BUILD_DATA: NO + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + BUILD_TOOLS: NO + BUILD_DATA: NO + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + BUILD_TOOLS: NO + BUILD_DATA: NO + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + BUILD_TOOLS: NO + BUILD_DATA: NO + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} ICU + + steps: + - uses: actions/download-artifact@v4 + with: + name: icu-tools-69.1 + path: ${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin + + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: actions/checkout@v4 + with: + repository: unicode-org/icu + ref: ${{ needs.context.outputs.icu_revision }} + path: ${{ github.workspace }}/SourceCache/icu + show-progress: false + + - name: Copy CMakeLists.txt + run: | + Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt + Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\icupkg.inc.cmake -destination ${{ github.workspace }}\SourceCache\icu\icu4c\icupkg.inc.cmake + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 200M + key: ${{ matrix.os }}-${{ matrix.arch }}-icu + variant: sccache + append-timestamp: false + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure ICU + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/icu-69.1 ` + -D BUILD_SHARED_LIBS=NO ` + -D BUILD_TOOLS=${{ matrix.BUILD_TOOLS }} ` + -D BUILD_DATA=${{ matrix.BUILD_DATA }} ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` + -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D ICU_TOOLS_DIR=${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/icu/icu4c + - name: Build ICU + run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 + - name: Install ICU + run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 --target install + + - uses: actions/upload-artifact@v4 + with: + name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 + path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr + + cmark_gfm: + needs: [context] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + arch: ['amd64', 'arm64'] + + steps: + - uses: actions/checkout@v4 + with: + repository: apple/swift-cmark + ref: ${{ needs.context.outputs.swift_cmark_revision }} + path: ${{ github.workspace }}/SourceCache/cmark-gfm + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 1M + key: windows-${{ matrix.arch }}-cmark-gfm + variant: sccache + append-timestamp: false + + - name: Configure cmark-gfm + run: > + cmake -B ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_COMPILER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr ` + -D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES ` + -S ${{ github.workspace }}/SourceCache/cmark-gfm ` + -G Ninja + - name: Build cmark-gfm + run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 + - name: Install cmark-gfm + run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 --target install + - uses: actions/upload-artifact@v4 + with: + name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + build_tools: + needs: [context, cmark_gfm] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + steps: + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - uses: actions/checkout@v4 + with: + repository: apple/llvm-project + ref: ${{ needs.context.outputs.llvm_project_revision }} + path: ${{ github.workspace }}/SourceCache/llvm-project + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift + ref: ${{ needs.context.outputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: windows-amd64-build_tools + variant: sccache + append-timestamp: false + + - name: Configure Tools + run: | + cmake -B ${{ github.workspace }}/BinaryCache/0 ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` + -D LLVM_ENABLE_ASSERTIONS=NO ` + -D LLVM_ENABLE_LIBEDIT=NO ` + -D LLVM_ENABLE_LIBXML2=NO ` + -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb" ` + -D LLVM_EXTERNAL_PROJECTS="swift" ` + -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift ` + -D LLDB_ENABLE_PYTHON=NO ` + -D LLDB_INCLUDE_TESTS=NO ` + -D LLDB_ENABLE_SWIFT_SUPPORT=NO ` + -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO ` + -D SWIFT_BUILD_DYNAMIC_STDLIB=NO ` + -D SWIFT_BUILD_HOST_DISPATCH=NO ` + -D SWIFT_BUILD_LIBEXEC=NO ` + -D SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=NO ` + -D SWIFT_BUILD_REMOTE_MIRROR=NO ` + -D SWIFT_BUILD_SOURCEKIT=NO ` + -D SWIFT_BUILD_STATIC_SDK_OVERLAY=NO ` + -D SWIFT_BUILD_STATIC_STDLIB=NO ` + -D SWIFT_BUILD_SWIFT_SYNTAX=NO ` + -D SWIFT_ENABLE_DISPATCH=NO ` + -D SWIFT_INCLUDE_APINOTES=NO ` + -D SWIFT_INCLUDE_DOCS=NO ` + -D SWIFT_INCLUDE_TESTS=NO + - name: Build llvm-tblgen + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-tblgen + - name: Build clang-tblgen + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tblgen + - name: Build lldb-tblgen + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target lldb-tblgen + - name: Build llvm-config + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-config + - name: Build clang-pseudo-gen + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-pseudo-gen + - name: Build clang-tidy-confusable-chars-gen + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tidy-confusable-chars-gen + - name: Build swift-def-to-strings-converter + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-def-to-strings-converter + - name: Build swift-serialize-diagnostics + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-serialize-diagnostics + - name: Build swift-compatibility-symbols + run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-compatibility-symbols + + - uses: actions/upload-artifact@v4 + with: + name: build-tools + path: | + ${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe + ${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe + ${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe + ${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe + ${{ github.workspace }}/BinaryCache/0/bin/clang-pseudo-gen.exe + ${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe + ${{ github.workspace }}/BinaryCache/0/bin/swift-def-to-strings-converter.exe + ${{ github.workspace }}/BinaryCache/0/bin/swift-serialize-diagnostics.exe + ${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols.exe + + compilers: + needs: [context, build_tools, cmark_gfm] + runs-on: ${{ needs.context.outputs.compilers_build_runner }} + + env: + # Must be a full version string from https://www.nuget.org/packages/pythonarm64 + PYTHON_VERSION: 3.9.10 + + strategy: + fail-fast: false + matrix: + include: + - arch: 'amd64' + cpu: 'x86_64' + triple: 'x86_64-unknown-windows-msvc' + + - arch: 'arm64' + cpu: 'aarch64' + triple: 'aarch64-unknown-windows-msvc' + + steps: + - uses: actions/download-artifact@v4 + with: + name: build-tools + path: ${{ github.workspace }}/BinaryCache/0/bin + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - uses: actions/checkout@v4 + with: + repository: apple/llvm-project + ref: ${{ needs.context.outputs.llvm_project_revision }} + path: ${{ github.workspace }}/SourceCache/llvm-project + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift + ref: ${{ needs.context.outputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-experimental-string-processing + ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} + path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-syntax + ref: ${{ needs.context.outputs.swift_syntax_revision }} + path: ${{ github.workspace }}/SourceCache/swift-syntax + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-corelibs-libdispatch + ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch + show-progress: false + + - name: Install Python ${{ env.PYTHON_VERSION }} (Host) + uses: actions/setup-python@v5 + id: python + with: + python-version: '${{ env.PYTHON_VERSION }}' + + - uses: nuget/setup-nuget@v2 + if: matrix.arch == 'arm64' + + # TODO(lxbndr) use actions/cache to improve this step timings + - name: Install Python ${{ env.PYTHON_VERSION }} (arm64) + if: matrix.arch == 'arm64' + run: | + $NugetSources=[string](nuget Sources List -Format short) + if (-Not ($NugetSources.contains("api.nuget.org"))) { + nuget sources Add -Name api.nuget.org -Source https://api.nuget.org/v3/index.json -NonInteractive + } + nuget install pythonarm64 -Version ${{ env.PYTHON_VERSION }} + + - name: Export Python Location + run: | + echo "PYTHON_LOCATION_amd64=$env:pythonLocation" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "PYTHON_LOCATION_arm64=${{ github.workspace }}\pythonarm64.${{ env.PYTHON_VERSION }}\tools" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Install Swift Toolchain + uses: compnerd/gha-setup-swift@main + with: + github-repo: thebrowsercompany/swift-build + github-token: ${{ secrets.GITHUB_TOKEN }} + release-asset-name: installer-amd64.exe + release-tag-name: '20231016.0' + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 500M + key: windows-${{ matrix.arch }}-compilers + variant: sccache + append-timestamp: false + + - name: Configure Compilers + env: + NDKPATH: ${{ steps.setup-ndk.outputs.ndk-path }} + run: | + if ( "${{ matrix.arch }}" -eq "arm64" ) { + $CMAKE_SYSTEM_NAME="-D CMAKE_SYSTEM_NAME=Windows" + $CMAKE_SYSTEM_PROCESSOR="-D CMAKE_SYSTEM_PROCESSOR=ARM64" + $CACHE="Windows-aarch64.cmake" + + # FIXME(compnerd) re-enable runtimes after we sort out compiler-rt + (Get-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).Replace(' runtimes', '') | Set-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake + } else { + $CACHE="Windows-x86_64.cmake" + } + $SWIFTC = cygpath -m (Get-Command swiftc).Source + $SDKROOT = cygpath -m ${env:SDKROOT} + # Use toolchain clang to avoid broken __prefetch intrinsic on arm64 in Clang 18. + $CLANG_LOCATION = cygpath -m (Split-Path (Get-Command swiftc).Source) + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/1 ` + -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/${CACHE} ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` + -D CMAKE_MT=mt ` + -D CMAKE_Swift_COMPILER="${SWIFTC}" ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` + -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" ` + ${CMAKE_SYSTEM_NAME} ` + ${CMAKE_SYSTEM_PROCESSOR} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` + -D CLANG_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe ` + -D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe ` + -D LLDB_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe ` + -D LLVM_CONFIG_PATH=${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe ` + -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift ` + -D LLVM_NATIVE_TOOL_DIR=${{ github.workspace }}/BinaryCache/0/bin ` + -D LLVM_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe ` + -D LLVM_USE_HOST_TOOLS=NO ` + -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO ` + -D SWIFT_BUILD_DYNAMIC_STDLIB=NO ` + -D SWIFT_BUILD_REMOTE_MIRROR=NO ` + -D SWIFT_BUILD_SWIFT_SYNTAX=YES ` + -D SWIFT_CLANG_LOCATION=${CLANG_LOCATION} ` + -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` + -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` + -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BinaryCache/0/bin ` + -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` + -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` + -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing ` + -D SWIFT_PATH_TO_SWIFT_SDK="${SDKROOT}" ` + -D CLANG_VENDOR=compnerd.org ` + -D CLANG_VENDOR_UTI=org.compnerd.dt ` + -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` + -D PACKAGE_VENDOR=compnerd.org ` + -D SWIFT_VENDOR=compnerd.org ` + -D LLVM_PARALLEL_LINK_JOBS=2 ` + -D SWIFT_PARALLEL_LINK_JOBS=2 ` + -D LLVM_APPEND_VC_REV=NO ` + -D LLVM_VERSION_SUFFIX="" ` + -D LLDB_PYTHON_EXE_RELATIVE_PATH=python.exe ` + -D LLDB_PYTHON_EXT_SUFFIX=.pyd ` + -D LLDB_PYTHON_RELATIVE_PATH=lib/site-packages ` + -D Python3_EXECUTABLE=${{ steps.python.outputs.python-path }} ` + -D Python3_INCLUDE_DIR=$env:PYTHON_LOCATION_${{ matrix.arch }}\include ` + -D Python3_LIBRARY=$env:PYTHON_LOCATION_${{ matrix.arch }}\libs\python39.lib ` + -D Python3_ROOT_DIR=$env:pythonLocation + + - name: Build Compiler Distribution + run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target distribution + + - name: Install Compiler Distribution + run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target install-distribution-stripped + + - name: Upload Compilers + uses: actions/upload-artifact@v4 + with: + name: compilers-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library + + - name: extract swift-syntax + run: | + $module = "${{ github.workspace }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake" + $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/1 + (Get-Content $module).Replace("${bindir}", '') | Set-Content $module + New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null + Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib" + Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" + Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse + New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null + Copy-Item -Path $module -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules" + + - name: Upload swift-syntax + uses: actions/upload-artifact@v4 + with: + name: swift-syntax-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift-syntax + + # TODO(compnerd) this takes ~1h due to the size, see if we can compress first + - uses: actions/upload-artifact@v4 + if: false # ${{ needs.context.outputs.debug_info }} + with: + name: compilers-${{ matrix.arch }}-debug-info + path: | + ${{ github.workspace }}/BinaryCache/1/**/*.pdb + + - name: Upload PDBs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + searchPattern: '**/*.pdb' + + - name: Upload DLLs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + searchPattern: '**/*.dll' + + - name: Upload EXEs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + searchPattern: '**/*.exe' + + zlib: + needs: [context] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} zlib + + steps: + - uses: actions/checkout@v4 + with: + repository: madler/zlib + ref: ${{ needs.context.outputs.zlib_revision }} + path: ${{ github.workspace }}/SourceCache/zlib + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: ${{ matrix.os }}-${{ matrix.arch }}-zlib + variant: sccache + append-timestamp: false + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure zlib + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/zlib-1.3 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/zlib ` + -D SKIP_INSTALL_FILES=YES + - name: Build zlib + run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3 + - name: Install zlib + run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3 --target install + + - uses: actions/upload-artifact@v4 + with: + name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 + path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr + + curl: + needs: [context, zlib] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} curl + + steps: + - uses: actions/checkout@v4 + with: + repository: curl/curl + ref: ${{ needs.context.outputs.curl_revision }} + path: ${{ github.workspace }}/SourceCache/curl + show-progress: false + + - uses: actions/download-artifact@v4 + with: + name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 + path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: ${{ matrix.os }}-${{ matrix.arch }}-curl + variant: sccache + append-timestamp: false + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure curl + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/curl-7.77.0 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/curl ` + -D BUILD_TESTING=NO ` + -D BUILD_CURL_EXE=NO ` + -D CURL_CA_BUNDLE="none" ` + -D CURL_CA_FALLBACK=NO ` + -D CURL_CA_PATH="none" ` + -D CURL_BROTLI=NO ` + -D CURL_DISABLE_ALTSVC=NO ` + -D CURL_DISABLE_AWS=YES ` + -D CURL_DISABLE_BASIC_AUTH=NO ` + -D CURL_DISABLE_BEARER_AUTH=NO ` + -D CURL_DISABLE_COOKIES=NO ` + -D CURL_DISABLE_DICT=YES ` + -D CURL_DISABLE_DIGEST_AUTH=NO ` + -D CURL_DISABLE_DOH=NO ` + -D CURL_DISABLE_FILE=YES ` + -D CURL_DISABLE_FORM_API=NO ` + -D CURL_DISABLE_FTP=YES ` + -D CURL_DISABLE_GETOPTIONS=NO ` + -D CURL_DISABLE_GOPHER=YES ` + -D CURL_DISABLE_HSTS=NO ` + -D CURL_DISABLE_HTTP=NO ` + -D CURL_DISABLE_HTTP_AUTH=NO ` + -D CURL_DISABLE_IMAP=YES ` + -D CURL_DISABLE_KERBEROS_AUTH=NO ` + -D CURL_DISABLE_LDAP=YES ` + -D CURL_DISABLE_LDAPS=YES ` + -D CURL_DISABLE_MIME=NO ` + -D CURL_DISABLE_MQTT=YES ` + -D CURL_DISABLE_NEGOTIATE_AUTH=NO ` + -D CURL_DISABLE_NETRC=NO ` + -D CURL_DISABLE_NTLM=NO ` + -D CURL_DISABLE_PARSEDATE=NO ` + -D CURL_DISABLE_POP3=YES ` + -D CURL_DISABLE_PROGRESS_METER=YES ` + -D CURL_DISABLE_PROXY=NO ` + -D CURL_DISABLE_RTSP=YES ` + -D CURL_DISABLE_SHUFFLE_DNS=YES ` + -D CURL_DISABLE_SMB=YES ` + -D CURL_DISABLE_SMTP=YES ` + -D CURL_DISABLE_SOCKETPAIR=YES ` + -D CURL_DISABLE_SRP=NO ` + -D CURL_DISABLE_TELNET=YES ` + -D CURL_DISABLE_TFTP=YES ` + -D CURL_DISABLE_VERBOSE_STRINGS=NO ` + -D CURL_LTO=NO ` + -D CURL_USE_BEARSSL=NO ` + -D CURL_USE_GNUTLS=NO ` + -D CURL_USE_GSSAPI=NO ` + -D CURL_USE_LIBPSL=NO ` + -D CURL_USE_LIBSSH=NO ` + -D CURL_USE_LIBSSH2=NO ` + -D CURL_USE_MBEDTLS=NO ` + -D CURL_USE_OPENSSL=NO ` + -D CURL_USE_SCHANNEL=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` + -D CURL_USE_WOLFSSL=NO ` + -D CURL_WINDOWS_SSPI=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` + -D CURL_ZLIB=YES ` + -D CURL_ZSTD=NO ` + -D ENABLE_ARES=NO ` + -D ENABLE_CURLDEBUG=NO ` + -D ENABLE_DEBUG=NO ` + -D ENABLE_IPV6=YES ` + -D ENABLE_MANUAL=NO ` + -D ENABLE_THREADED_RESOLVER=NO ` + -D ENABLE_UNICODE=YES ` + -D ENABLE_UNIX_SOCKETS=NO ` + -D ENABLE_WEBSOCKETS=NO ` + -D HAVE_POLL_FINE=NO ` + -D USE_IDN2=NO ` + -D USE_MSH3=NO ` + -D USE_NGHTTP2=NO ` + -D USE_NGTCP2=NO ` + -D USE_QUICHE=NO ` + -D USE_WIN32_IDN=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` + -D USE_WIN32_LARGE_FILES=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` + -D USE_WIN32_LDAP=NO ` + -D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` + -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/zlibstatic.lib ` + -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` + -D CMAKE_ANDROID_NDK=$NDKPATH + - name: Build curl + run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 + - name: Install curl + run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 --target install + + - uses: actions/upload-artifact@v4 + with: + name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 + path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr + + libxml2: + needs: [context] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + cc: cl + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} libxml2 + + steps: + - uses: actions/checkout@v4 + with: + repository: gnome/libxml2 + ref: ${{ needs.context.outputs.libxml2_revision }} + path: ${{ github.workspace }}/SourceCache/libxml2 + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: ${{ matrix.os }}-${{ matrix.arch }}-libxml2 + variant: sccache + append-timestamp: false + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure libxml2 + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/libxml2 ` + -D LIBXML2_WITH_ICONV=NO ` + -D LIBXML2_WITH_ICU=NO ` + -D LIBXML2_WITH_LZMA=NO ` + -D LIBXML2_WITH_PYTHON=NO ` + -D LIBXML2_WITH_TESTS=NO ` + -D LIBXML2_WITH_THREADS=YES ` + -D LIBXML2_WITH_ZLIB=NO ` + -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` + -D CMAKE_ANDROID_NDK=$NDKPATH + - name: Build libxml2 + run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 + - name: Install libxml2 + run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 --target install + + - uses: actions/upload-artifact@v4 + with: + name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 + path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr + + sdk: + continue-on-error: ${{ matrix.arch != 'amd64' }} + needs: [context, icu, libxml2, curl, zlib, compilers, cmark_gfm] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cpu: 'x86_64' + triple: 'x86_64-unknown-windows-msvc' + triple_no_api_level: 'x86_64-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: arm64 + cpu: 'aarch64' + triple: 'aarch64-unknown-windows-msvc' + triple_no_api_level: 'aarch64-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: x86 + cpu: 'i686' + triple: 'i686-unknown-windows-msvc' + triple_no_api_level: 'i686-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: arm64 + cpu: 'aarch64' + triple: 'aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple_no_api_level: aarch64-unknown-linux-android + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cpu: armv7 + triple: 'armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple_no_api_level: armv7-unknown-linux-androideabi + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cpu: i686 + triple: 'i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple_no_api_level: i686-unknown-linux-android + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cpu: 'x86_64' + triple: 'x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple_no_api_level: x86_64-unknown-linux-android + cc: clang + cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} SDK + + steps: + - uses: actions/download-artifact@v4 + with: + name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 + path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr + - uses: actions/download-artifact@v4 + with: + name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 + path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr + - uses: actions/download-artifact@v4 + with: + name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 + path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr + - uses: actions/download-artifact@v4 + with: + name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 + path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr + - name: Download Compilers + uses: actions/download-artifact@v4 + with: + name: compilers-amd64 + path: ${{ github.workspace }}/BuildRoot/Library + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + + - uses: actions/checkout@v4 + with: + repository: apple/llvm-project + ref: ${{ needs.context.outputs.llvm_project_revision }} + path: ${{ github.workspace }}/SourceCache/llvm-project + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift + ref: ${{ needs.context.outputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-syntax + ref: ${{ needs.context.outputs.swift_syntax_revision }} + path: ${{ github.workspace }}/SourceCache/swift-syntax + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-corelibs-libdispatch + ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch + show-progress: false + - uses: actions/checkout@v4 + if: matrix.os == 'Windows' + with: + repository: apple/swift-corelibs-foundation + ref: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation + show-progress: false + - uses: actions/checkout@v4 + if: matrix.os == 'Android' + with: + repository: apple/swift-corelibs-foundation + ref: a515f3e15c81d029411c540df7edf52d427ff2cb + path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-corelibs-xctest + ref: ${{ needs.context.outputs.swift_corelibs_xctest_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-xctest + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-experimental-string-processing + ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} + path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Install Swift Toolchain + uses: compnerd/gha-setup-swift@main + with: + github-repo: thebrowsercompany/swift-build + github-token: ${{ secrets.GITHUB_TOKEN }} + release-asset-name: installer-amd64.exe + release-tag-name: '20231016.0' + + # workaround CMake 3.30 issue + - uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.29' + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure LLVM + run: | + $CLANG_CL = "cl" + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/llvm ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + ${{ matrix.llvm_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` + -D LLVM_ENABLE_ASSERTIONS=YES + + - name: Configure Swift Standard Library + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/swift ` + -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-${{ matrix.os }}-${{ matrix.cpu }}.cmake ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/swift/lib/swift ${{ matrix.swiftflags }}" ` + -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` + -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift ` + -D LLVM_DIR=${{ github.workspace }}/BinaryCache/llvm/lib/cmake/llvm ` + -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` + -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` + -D SWIFT_ENABLE_VOLATILE=YES ` + -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ` + -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` + -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` + -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing + - name: Build Swift Standard Library + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/swift + - name: Install Swift Standard Library + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/swift --target install + + - name: Configure libdispatch + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/libdispatch ` + -D BUILD_SHARED_LIBS=YES ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` + -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` + -D BUILD_TESTING=NO ` + -D ENABLE_SWIFT=YES + - name: Build libdispatch + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/libdispatch + + - name: Configure Foundation + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } + $DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" } + + $zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" } + $xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" } + $icu_data_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicudt69.lib" } else { "libicudt69.a" } + $icu_i18n_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuuc69.lib" } else { "libicuin69.a" } + $icu_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuin69.lib" } else { "libicuuc69.a" } + $build_tools = if ("${{ matrix.os }}" -eq "Windows") { "YES" } else { "NO" } + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/foundation ` + -D BUILD_SHARED_LIBS=YES ` + -D CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL="/MD" ` + -D CMAKE_ASM_FLAGS="--target=${{ matrix.triple }}" ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` + -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-corelibs-foundation ` + -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` + -D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr/lib/cmake/CURL ` + -D FOUNDATION_BUILD_TOOLS=${build_tools} ` + -D ENABLE_TESTING=NO ` + -D ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_data_lib_release ` + -D ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_i18n_lib_release ` + -D ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` + -D ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include ` + -D ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_lib_release ` + -D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" ` + -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 ` + -D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib ` + -D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` + -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$zlib_lib + - name: Build foundation + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/foundation + + # TODO(compnerd) correctly version XCTest + - name: Configure xctest + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/xctest ` + -D BUILD_SHARED_LIBS=YES ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_BUILD_WITH_INSTALL_RPATH=YES ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=$NDKPATH ` + -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-corelibs-xctest ` + -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` + -D Foundation_DIR=${{ github.workspace }}/BinaryCache/foundation/cmake/modules ` + -D ENABLE_TESTING=NO + - name: Build xctest + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/xctest + + - name: Install xctest + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/xctest --target install + - name: Install foundation + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/foundation --target install + - name: Install libdispatch + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/libdispatch --target install + + - uses: actions/setup-python@v5 + - uses: jannekem/run-python-script-action@v1 + with: + script: | + import os + import plistlib + + info_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Info.plist' + with open(os.path.normpath(info_plist), 'wb') as plist: + # TODO(compnerd) derive this from the install directory + plistlib.dump({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFTC_FLAGS': ['-use-ld=lld'] } }, plist) + + sdk_settings_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/SDKSettings.plist' + with open(os.path.normpath(sdk_settings_plist), 'wb') as plist: + # TODO(compnerd) derive this from the CMAKE_BUILD_TYPE for the + # runtime. + plistlib.dump({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }, plist) + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform + + - name: Upload PDBs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.pdb' + + - name: Upload DLLs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.dll' + + devtools: + needs: [context, sqlite, compilers, sdk] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: 'amd64' + cpu: 'x86_64' + triple: 'x86_64-unknown-windows-msvc' + + - arch: 'arm64' + cpu: 'aarch64' + triple: 'aarch64-unknown-windows-msvc' + + steps: + - uses: actions/download-artifact@v4 + with: + name: sqlite-Windows-${{ matrix.arch }}-3.43.2 + path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr + - name: Download Compilers + uses: actions/download-artifact@v4 + with: + name: compilers-amd64 + path: ${{ github.workspace }}/BuildRoot/Library + - uses: actions/download-artifact@v4 + with: + name: Windows-sdk-amd64 + path: ${{ github.workspace }}/BinaryCache + - name: Download SDK + uses: actions/download-artifact@v4 + with: + name: Windows-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform + - name: Downlaod swift-syntax + uses: actions/download-artifact@v4 + with: + name: swift-syntax-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift-syntax + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + + - uses: actions/download-artifact@v4 + if: matrix.arch == 'arm64' + with: + name: cmark-gfm-arm64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - uses: actions/checkout@v4 + with: + repository: apple/indexstore-db + ref: ${{ needs.context.outputs.indexstore_db_revision }} + path: ${{ github.workspace }}/SourceCache/indexstore-db + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/sourcekit-lsp + ref: ${{ needs.context.outputs.sourcekit_lsp_revision }} + path: ${{ github.workspace }}/SourceCache/sourcekit-lsp + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-argument-parser + ref: ${{ needs.context.outputs.swift_argument_parser_revision }} + path: ${{ github.workspace }}/SourceCache/swift-argument-parser + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-asn1 + ref: ${{ needs.context.outputs.swift_asn1_revision }} + path: ${{ github.workspace }}/SourceCache/swift-asn1 + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-certificates + ref: ${{ needs.context.outputs.swift_certificates_revision }} + path: ${{ github.workspace }}/SourceCache/swift-certificates + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-collections + ref: ${{ needs.context.outputs.swift_collections_revision }} + path: ${{ github.workspace }}/SourceCache/swift-collections + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-crypto + ref: ${{ needs.context.outputs.swift_crypto_revision }} + path: ${{ github.workspace }}/SourceCache/swift-crypto + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-driver + ref: ${{ needs.context.outputs.swift_driver_revision }} + path: ${{ github.workspace }}/SourceCache/swift-driver + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-format + ref: ${{ needs.context.outputs.swift_format_revision }} + path: ${{ github.workspace }}/SourceCache/swift-format + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-llbuild + ref: ${{ needs.context.outputs.swift_llbuild_revision }} + path: ${{ github.workspace }}/SourceCache/swift-llbuild + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-markdown + ref: ${{ needs.context.outputs.swift_markdown_revision }} + path: ${{ github.workspace }}/SourceCache/swift-markdown + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-package-manager + ref: ${{ needs.context.outputs.swift_package_manager_revision }} + path: ${{ github.workspace }}/SourceCache/swift-package-manager + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-system + ref: ${{ needs.context.outputs.swift_system_revision }} + path: ${{ github.workspace }}/SourceCache/swift-system + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-tools-support-core + ref: ${{ needs.context.outputs.swift_tools_support_core_revision }} + path: ${{ github.workspace }}/SourceCache/swift-tools-support-core + show-progress: false + - uses: actions/checkout@v4 + with: + repository: jpsim/Yams + ref: ${{ needs.context.outputs.yams_revision }} + path: ${{ github.workspace }}/SourceCache/Yams + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift + ref: ${{ needs.context.outputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + + - run: | + $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin + echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - run: | + $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" + mv ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ + mv ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ + mv ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ + mv ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + + - name: Configure swift-argument-parser + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-argument-parser ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-argument-parser + - name: Build swift-argument-parser + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser + + - name: Configure swift-collections + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-collections ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-collections + - name: Build swift-collections + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections + + - name: Configure swift-crypto + run: | + # Workaround CMake 3.20 issue + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-crypto ` + -D BUILD_SHARED_LIBS=NO ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-crypto + - name: Build swift-crypto + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-crypto + + - name: Configure Yams + run: | + # Workaround CMake 3.20 issue + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/yams ` + -D BUILD_SHARED_LIBS=NO ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/Yams + - name: Build Yams + run: cmake --build ${{ github.workspace }}/BinaryCache/yams + + - name: Configure swift-llbuild + run: | + # Workaround CMake 3.20 issue + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-llbuild ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=cl ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=cl ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-llbuild ` + -D LLBUILD_SUPPORT_BINDINGS=Swift ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include + - name: Build swift-llbuild + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild + + - name: Configure swift-system + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-system ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-system + - name: Build swift-system + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system + + - name: Configure swift-tools-support-core + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-tools-support-core ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-tools-support-core ` + -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include + - name: Build swift-tools-support-core + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core + + - name: Configure swift-driver + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-driver ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-driver ` + -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` + -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` + -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` + -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules ` + -D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules + - name: Build swift-driver + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver + + - name: Configure swift-asn1 + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-asn1 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-asn1 + - name: Build swift-asn1 + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-asn1 + + - name: Configure swift-certificates + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-certificates ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-certificates ` + -D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules ` + -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules + - name: Build swift-certificates + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-certificates + + - name: extract swift-syntax + run: | + $module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake" + $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax + (Get-Content $module).Replace('', "${bindir}") | Set-Content $module + + - name: Configure swift-package-manager + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-package-manager ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-package-manager ` + -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` + -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` + -D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules ` + -D SwiftCertificates_DIR=${{ github.workspace }}/BinaryCache/swift-certificates/cmake/modules ` + -D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules ` + -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules ` + -D SwiftDriver_DIR=${{ github.workspace }}/BinaryCache/swift-driver/cmake/modules ` + -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules ` + -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` + -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules ` + -D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules + - name: Build swift-package-manager + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager + + - name: Configure Markdown + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-markdown ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-markdown ` + -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` + -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake + - name: Build Markdown + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown + + - name: Configure Format + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-format ` + -D BUILD_SHARED_LIBS=YES ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-format ` + -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` + -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` + -D SwiftMarkdown_DIR=${{ github.workspace }}/BinaryCache/swift-markdown/cmake/modules ` + -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules + - name: Build swift-format + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format + + - name: Configure IndexStoreDB + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/indexstore-db ` + -D BUILD_SHARED_LIBS=NO ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include/Block" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/indexstore-db + - name: Build indexstore-db + run: cmake --build ${{ github.workspace }}/BinaryCache/indexstore-db + + - name: Configure SourceKit-LSP + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/sourcekit-lsp ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${CLANG_CL} ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/sourcekit-lsp ` + -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` + -D IndexStoreDB_DIR=${{ github.workspace }}/BinaryCache/indexstore-db/cmake/modules ` + -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` + -D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules ` + -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules ` + -D SwiftPM_DIR=${{ github.workspace }}/BinaryCache/swift-package-manager/cmake/modules ` + -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules ` + -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` + -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules + - name: Build SourceKit-LSP + run: cmake --build ${{ github.workspace }}/BinaryCache/SourceKit-LSP + + - name: Install swift-argument-parser + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser --target install + - name: Install swift-collections + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections --target install + - name: Install swift-llbuild + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild --target install + - name: Install swift-system + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system --target install + - name: Install swift-tools-support-core + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core --target install + - name: Install swift-driver + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver --target install + - name: Install swift-package-manager + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager --target install + - name: Install SourceKit-LSP + run: cmake --build ${{ github.workspace }}/BinaryCache/sourcekit-lsp --target install + - name: Install swift-format + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format --target install + + - uses: actions/upload-artifact@v4 + with: + name: devtools-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot-DevTools/Library + + - name: Upload PDBs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.pdb' + + - name: Upload DLLs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.dll' + + - name: Upload EXEs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ needs.context.outputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.exe' + + + debugging_tools: + name: Debugging Tools + needs: [context, compilers, devtools, sdk] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cpu: x86_64 + triple: x86_64-unknown-windows-msvc + - arch: arm64 + cpu: aarch64 + triple: aarch64-unknown-windows-msvc + + steps: + - name: Download build compilers + uses: actions/download-artifact@v4 + with: + name: compilers-amd64 + path: ${{ github.workspace }}/BuildRoot/ + + - name: Download build devtools + uses: actions/download-artifact@v4 + with: + name: devtools-amd64 + path: ${{ github.workspace }}/BuildRoot/ + + # We're using the runtime libraries from this one. + - name: Download Windows SDK (AMD64) + uses: actions/download-artifact@v4 + with: + name: Windows-sdk-amd64 + path: ${{ github.workspace }}/BinaryCache/ + + - name: Copy Windows SDK (AMD64) to BuildRoot + run: Copy-Item -Recurse -Force -Path ${{ github.workspace }}/BinaryCache/* -Destination ${{ github.workspace }}/BuildRoot/ + + - name: Update environment variables + run: | + $SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/SDKs/Windows.sdk" + $ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin" + $RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin" + + echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "TOOLCHAIN_PATH=${ToolchainPath}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "AR=${ToolchainPath}\llvm-ar.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "${ToolchainPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "${RTLPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 + run: | + mv ${{ env.SDKROOT }}/usr/lib/swift/dispatch ${{ env.SDKROOT }}/usr/include/ + mv ${{ env.SDKROOT }}/usr/lib/swift/os ${{ env.SDKROOT }}/usr/include/ + mv ${{ env.SDKROOT }}/usr/lib/swift/Block ${{ env.SDKROOT }}/usr/include/ + + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ + + - name: Download ${{ matrix.arch }} Windows SDK + # Only necessary when cross-compiling + if: ${{ matrix.arch != 'amd64' }} + uses: actions/download-artifact@v4 + with: + name: Windows-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/ + + - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 + # Only necessary when cross-compiling + if: ${{ matrix.arch != 'amd64' }} + run: | + # We already copied these above. + # Remove them to prevent 'module defined more than once' errors. + rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/dispatch + rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/os + rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/Block + + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ + + - name: Checkout apple/swift + uses: actions/checkout@v4 + with: + repository: apple/swift + ref: ${{ needs.context.outputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + + # Note: We didn't need to explicitly download cmark-gfm above because it's packaged inside + # compilers-${{ matrix.arch }}. + - name: Setup cmark-gfm + run: Copy-Item ${{ github.workspace }}/BuildRoot/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ env.TOOLCHAIN_PATH }} + + - name: Build swift-inspect + id: swift_inspect + shell: cmd + run: | + swift build ^ + --triple=${{ matrix.triple }} ^ + --scratch-path="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect" ^ + --sdk="${{ env.SDKROOT }}" ^ + --package-path="${{ github.workspace }}/SourceCache/swift/tools/swift-inspect" ^ + -c="release" ^ + -Xbuild-tools-swiftc="-L${{ env.SDKROOT }}/usr/lib/swift/windows" ^ + -Xbuild-tools-swiftc="-I${{ env.SDKROOT }}/usr/lib/swift -use-ld=lld" ^ + -Xcc="-I${{ env.SDKROOT }}/usr/include/swift/SwiftRemoteMirror" ^ + -Xlinker="${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/swiftRemoteMirror.lib" ^ + -Xswiftc="-use-ld=lld" + + - name: Copy swift-inspect executable + run: | + New-Item -Path ${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect -ItemType Directory -Force | Out-Null + $SwiftInspectPath="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect/${{ matrix.triple }}/release/swift-inspect.exe" + Copy-Item ${SwiftInspectPath} -Destination "${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect/" + + - uses: actions/upload-artifact@v4 + with: + name: debugging_tools-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot-DebuggingTools + + package_tools: + name: Package Tools + needs: [context, compilers, debugging_tools, devtools] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + arch: ['amd64' , 'arm64'] + + steps: + - name: Download Debugging Tools + uses: actions/download-artifact@v4 + with: + name: debugging_tools-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/DebuggingTools + + - name: Download Compilers + uses: actions/download-artifact@v4 + with: + name: compilers-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library + + - name: Download DevTools + uses: actions/download-artifact@v4 + with: + name: devtools-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library + + - name: Download cmark-gfm + uses: actions/download-artifact@v4 + with: + name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - run: | + $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 + $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx + Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' + certutil -decode $CertificatePath $PFXPath + Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append + if: ${{ needs.context.outputs.signed }} + + - name: Install WixToolset.Sdk + run: | + if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { + if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { + Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet + } + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + } + + - name: Package Build Tools + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bld/bld.wixproj + + - name: Package CLI Tools + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/cli/cli.wixproj + + - name: Package Debugging Tools + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:INCLUDE_SWIFT_INSPECT=true ` + -p:SWIFT_INSPECT_BUILD=${{ github.workspace }}/BuildRoot/DebuggingTools/swift-inspect ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/dbg/dbg.wixproj + + - name: Package IDE Tools + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/ide/ide.wixproj + + - uses: actions/upload-artifact@v4 + with: + name: bld-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.cab + + - uses: actions/upload-artifact@v4 + with: + name: cli-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.cab + + - uses: actions/upload-artifact@v4 + with: + name: dbg-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.cab + + - uses: actions/upload-artifact@v4 + with: + name: ide-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.cab + + package_sdk_runtime: + name: Package SDK & Runtime + needs: [context, sdk] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + platform: x64 + - arch: arm64 + platform: arm64 + - arch: x86 + platform: x86 + + steps: + - uses: actions/download-artifact@v4 + with: + name: Windows-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform + + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - run: | + $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 + $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx + Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' + certutil.exe -decode $CertificatePath $PFXPath + Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append + if: ${{ needs.context.outputs.signed }} + + - name: Install WixToolset.Sdk + run: | + if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { + if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { + Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet + } + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + } + + - name: Package SDK + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` + -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductArchitecture=${{ matrix.arch }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/sdk/sdk.wixproj + + - name: Package Runtime + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` + -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:VCRedistDir="${env:VCToolsRedistDir}\${env:VSCMD_ARG_TGT_ARCH}\Microsoft.VC143.CRT\" ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/rtl/msi/rtlmsi.wixproj + + - uses: actions/upload-artifact@v4 + with: + name: sdk-windows-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.cab + - uses: actions/upload-artifact@v4 + with: + name: rtl-windows-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.cab + - uses: actions/upload-artifact@v4 + with: + name: rtl-windows-${{ matrix.arch }}-msm + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.msm + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.cab + + package_android_sdk: + name: Package Android SDK + needs: [context, sdk] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: arm64 + cpu: aarch64 + - arch: x86_64 + cpu: x86_64 + - arch: armv7 + cpu: armv7 + - arch: i686 + cpu: i686 + + steps: + - uses: actions/download-artifact@v4 + with: + name: Android-sdk-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform + + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: e1adc0d5dde137fa5941316e89a3ed139a273dde + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - run: | + $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 + $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx + Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' + certutil.exe -decode $CertificatePath $PFXPath + Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append + if: ${{ needs.context.outputs.signed }} + + - name: Install WixToolset.Sdk + run: | + if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { + if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { + Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet + } + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + } + + - name: Package SDK + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform ` + -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductArchitecture=${{ matrix.cpu }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/android_sdk/android_sdk.wixproj + + - uses: actions/upload-artifact@v4 + with: + name: sdk-android-${{ matrix.arch }}-msi + path: | + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.msi + ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.cab + + installer: + needs: [context, package_tools, package_sdk_runtime, package_android_sdk] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + strategy: + fail-fast: false + matrix: + arch: ['amd64' , 'arm64'] + + steps: + - uses: actions/download-artifact@v4 + with: + name: bld-${{ matrix.arch }}-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} + - uses: actions/download-artifact@v4 + with: + name: cli-${{ matrix.arch }}-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} + - uses: actions/download-artifact@v4 + with: + name: dbg-${{ matrix.arch }}-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} + - uses: actions/download-artifact@v4 + with: + name: ide-${{ matrix.arch }}-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} + + - uses: actions/download-artifact@v4 + with: + name: rtl-windows-${{ matrix.arch }}-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} + - uses: actions/download-artifact@v4 + with: + name: rtl-windows-amd64-msm + path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64 + - uses: actions/download-artifact@v4 + with: + name: rtl-windows-x86-msm + path: ${{ github.workspace }}/BinaryCache/installer/Release/x86 + - uses: actions/download-artifact@v4 + with: + name: rtl-windows-arm64-msm + path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64 + + - uses: actions/download-artifact@v4 + with: + name: sdk-windows-amd64-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64 + - uses: actions/download-artifact@v4 + with: + name: sdk-windows-x86-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/x86 + - uses: actions/download-artifact@v4 + with: + name: sdk-windows-arm64-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64 + - uses: actions/download-artifact@v4 + with: + name: sdk-android-arm64-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/aarch64 + - uses: actions/download-artifact@v4 + with: + name: sdk-android-x86_64-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/x86_64 + - uses: actions/download-artifact@v4 + with: + name: sdk-android-armv7-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/armv7 + - uses: actions/download-artifact@v4 + with: + name: sdk-android-i686-msi + path: ${{ github.workspace }}/BinaryCache/installer/Release/i686 + + - uses: actions/checkout@v4 + with: + repository: apple/swift-installer-scripts + ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + path: ${{ github.workspace }}/SourceCache/swift-installer-scripts + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - run: | + $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 + $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx + Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' + certutil -decode $CertificatePath $PFXPath + Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append + if: ${{ needs.context.outputs.signed }} + + # The installer bundle needs the shared project for localization strings, + # but it won't build the dependency on its own due to -p:BuildProjectReferences=false. + - name: Build shared project + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/shared/shared.wixproj + + - name: Build installer bundle + run: | + msbuild -nologo -restore -maxCpuCount ` + -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` + -p:Configuration=Release ` + -p:BuildProjectReferences=false ` + -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:CERTIFICATE=${env:CERTIFICATE} ` + -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` + -p:BundleFlavor=offline ` + -p:INCLUDE_AMD64_SDK=true ` + -p:INCLUDE_X86_SDK=true ` + -p:INCLUDE_ARM64_SDK=true ` + -p:ANDROID_INCLUDE_ARM64_SDK=true ` + -p:ANDROID_INCLUDE_x86_64_SDK=true ` + -p:ANDROID_INCLUDE_ARM_SDK=true ` + -p:ANDROID_INCLUDE_X86_SDK=true ` + -p:ProductArchitecture=${{ matrix.arch }} ` + -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` + ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj + + - uses: actions/upload-artifact@v4 + with: + name: installer-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe + + smoke_test: + needs: [context, installer] + runs-on: ${{ needs.context.outputs.windows_build_runner }} + + steps: + - uses: actions/download-artifact@v4 + with: + name: installer-amd64 + path: ${{ github.workspace }}/tmp + + # TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed + - run: | + function Update-EnvironmentVariables { + foreach ($level in "Machine", "User") { + [Environment]::GetEnvironmentVariables($level).GetEnumerator() | % { + # For Path variables, append the new values, if they're not already in there + if ($_.Name -Match 'Path$') { + $_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';' + } + $_ + } | Set-Content -Path { "Env:$($_.Name)" } + } + } + + try { + Write-Host "Starting Install installer.exe..." + $Process = Start-Process -FilePath ${{ github.workspace }}/tmp/installer.exe -ArgumentList ("-q") -Wait -PassThru + $ExitCode = $Process.ExitCode + if ($ExitCode -eq 0 -or $ExitCode -eq 3010) { + Write-Host "Installation successful" + } else { + Write-Host "non-zero exit code returned by the installation process: $ExitCode" + exit $ExitCode + } + } catch { + Write-Host "Failed to install: $($_.Exception.Message)" + exit 1 + } + Update-EnvironmentVariables + + # Reset Path and environment + echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 + Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } + + - uses: actions/checkout@v4 + with: + repository: compnerd/swift-win32 + ref: refs/heads/main + path: ${{ github.workspace }}/SourceCache/swift-win32 + show-progress: false + + - run: swift build + working-directory: ${{ github.workspace }}/SourceCache/swift-win32 + + - run: swift test -Xswiftc -DENABLE_TESTING + working-directory: ${{ github.workspace }}/SourceCache/swift-win32 + + snapshot: + runs-on: ubuntu-latest + needs: [context, smoke_test] + if: github.event_name == 'schedule' + steps: + - uses: actions/checkout@v4 + with: + ref: release/6.0 + show-progress: false + + - uses: actions/download-artifact@v4 + with: + name: stable.xml + + - run: | + git config --global user.name 'github-action[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + if ! git diff --exit-code ; then + git add stable.xml + git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" + git push origin HEAD:release/6.0 + fi + + release: + runs-on: ubuntu-latest + needs: [context, smoke_test] + if: inputs.create_release == true + steps: + - uses: actions/download-artifact@v4 + with: + name: installer-amd64 + path: ${{ github.workspace }}/tmp/amd64 + + - uses: actions/download-artifact@v4 + with: + name: installer-arm64 + path: ${{ github.workspace }}/tmp/arm64 + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Create Release + gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} + + # AMD64 + cd ${{ github.workspace }}/tmp/amd64 + + mv installer.exe installer-amd64.exe + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }} + + shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256 + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }} + + # ARM64 + cd ${{ github.workspace }}/tmp/arm64 + + mv installer.exe installer-arm64.exe + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }} + + shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256 + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }} From 2bb5a14844fb75022db76463c825d6fe782ab0ff Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 25 Jul 2024 16:39:27 -0700 Subject: [PATCH 09/20] GHA: clean up errant file --- .github/workflows/swift-toolchain.yml.orig | 3395 -------------------- 1 file changed, 3395 deletions(-) delete mode 100644 .github/workflows/swift-toolchain.yml.orig diff --git a/.github/workflows/swift-toolchain.yml.orig b/.github/workflows/swift-toolchain.yml.orig deleted file mode 100644 index b19535076..000000000 --- a/.github/workflows/swift-toolchain.yml.orig +++ /dev/null @@ -1,3395 +0,0 @@ -name: swift-toolchain - -on: - workflow_dispatch: - inputs: - swift_version: - description: 'Swift Version' - default: '6.0.0' - required: false - type: string - - android_api_level: - description: 'Android API Level' - default: 28 - required: false - type: number - - swift_tag: - description: 'Swift Build Tag' - required: false - type: string - - debug_info: - description: 'Emit PDBs (Debug Info)' - default: false - type: boolean - - signed: - description: 'Code Sign' - default: false - type: boolean - - create_release: - description: 'Create Release' - type: boolean - default: true - required: false - - workflow_call: - inputs: - swift_version: - description: 'Swift Version' - default: '0.0.0' - required: false - type: string - - android_api_level: - description: 'Android API Level' - default: 28 - required: false - type: number - - swift_tag: - description: 'Swift Build Tag' - required: false - type: string - - debug_info: - description: 'Emit PDBs (Debug Info)' - default: true - type: boolean - - signed: - description: 'Code Sign' - default: false - type: boolean - - create_release: - description: 'Create Release' - type: boolean - default: true - required: false - - secrets: - SYMBOL_SERVER_PAT: - required: true - CERTIFICATE: - required: true - PASSPHRASE: - required: true - -env: - SCCACHE_DIRECT: yes - -jobs: - context: - runs-on: ubuntu-latest - outputs: - curl_revision: ${{ steps.context.outputs.curl_revision }} - icu_revision: ${{ steps.context.outputs.icu_revision }} - indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }} - libxml2_revision: ${{ steps.context.outputs.libxml2_revision }} - llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }} - sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }} - swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }} - swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }} - swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }} - swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }} - swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }} - swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }} - swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }} - swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }} - swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }} - swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }} - swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} - swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} - swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} - swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} - swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} - swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} - swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }} - swift_revision: ${{ steps.context.outputs.swift_revision }} - swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }} - swift_system_revision: ${{ steps.context.outputs.swift_system_revision }} - swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }} - yams_revision: ${{ steps.context.outputs.yams_revision }} - zlib_revision: ${{ steps.context.outputs.zlib_revision }} - ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }} - WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} - WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} - ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }} - ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} - ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} - CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }} - debug_info: ${{ steps.context.outputs.debug_info }} - signed: ${{ steps.context.outputs.signed }} - swift_version: ${{ steps.context.outputs.swift_version }} - swift_tag: ${{ steps.context.outputs.swift_tag }} - windows_build_runner: ${{ steps.context.outputs.windows_build_runner }} - compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }} - steps: - - id: context - name: Generate Build Context - run: | - # TODO(compnerd) can we make this more silent? - sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq - sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils - - # Which branch is this workflow based on - branch_version_string=${{ inputs.swift_version || '0.0.0' }} - if [[ $branch_version_string == *.* ]]; then - branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }') - else - branch_name="release/$branch_version_string" - fi - - repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name - repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all) - - if [[ "${{ inputs.swift_tag }}" != "" ]] ; then - tee -a "${GITHUB_OUTPUT}" <<-EOF - indexstore_db_revision=refs/tags/${{ inputs.swift_tag }} - llvm_project_revision=refs/tags/${{ inputs.swift_tag }} - sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }} - swift_revision=refs/tags/${{ inputs.swift_tag }} - swift_argument_parser_revision=refs/tags/1.4.0 - swift_asn1_revision=refs/tags/0.7.0 - swift_atomics_revision=refs/tags/1.2.0 - swift_certificates_revision=refs/tags/0.1.0 - swift_cmark_revision=refs/tags/${{ inputs.swift_tag }} - swift_collections_revision=refs/tags/1.1.2 - swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }} - swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }} - swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }} - swift_crypto_revision=refs/tags/3.0.0 - swift_driver_revision=refs/tags/${{ inputs.swift_tag }} - swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} - swift_format_revision=refs/heads/main - swift_installer_scripts_revision=refs/heads/main - swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} - swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} - swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }} - swift_syntax_revision=refs/tags/${{ inputs.swift_tag }} - swift_system_revision=refs/tags/1.3.0 - swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }} - curl_revision=refs/tags/curl-8_5_0 - libxml2_revision=refs/tags/v2.11.5 - yams_revision=refs/tags/5.0.6 - zlib_revision=refs/tags/v1.3.1 - icu_revision=refs/heads/maint/maint-69 - EOF - else - repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \ - xmllint --xpath "//project/@name | //project/@revision" - | \ - xargs -n2 | \ - awk -F'[= ]' '{ - split($2, repo, "/"); - gsub(/-/, "_", repo[2]); - print tolower(repo[2]) "_revision=" $4 - }' | tee -a "${GITHUB_OUTPUT}" - repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml - fi - - # FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1. - # see: https://github.com/actions/runner-images/issues/10004 - if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then - echo debug_info=true >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} - echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} - else - echo debug_info=false >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} - fi - echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - - if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then - # FIXME(compnerd) enable this when requested - echo signed=false >> ${GITHUB_OUTPUT} - else - echo signed=false >> ${GITHUB_OUTPUT} - fi - - echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT} - if [[ -n "${{ inputs.swift_tag }}" ]] ; then - echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} - else - if [[ "$branch_name" == "main" ]] ; then - echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} - else - echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} - fi - fi - - echo windows_build_runner=${{ vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} - echo compilers_build_runner=${{ vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} - - echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT} - - - uses: actions/upload-artifact@v4 - with: - name: stable.xml - path: stable.xml - if-no-files-found: ignore - - sqlite: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} SQLite3 - - steps: - - uses: actions/checkout@v4 - with: - path: ${{ github.workspace }}/SourceCache/swift-build - show-progress: false - - - name: download sqlite - run: | - curl.exe -sL "https://sqlite.org/2023/sqlite-amalgamation-3430200.zip" -o $env:TEMP\sqlite-amalgamation-3430200.zip - New-Item -ItemType Directory -Path ${{ github.workspace }}\SourceCache\sqlite-3.43.2 - unzip.exe -j -o $env:TEMP\sqlite-amalgamation-3430200.zip -d ${{ github.workspace }}\SourceCache\sqlite-3.43.2 - - - name: Copy CMakeLists.txt - run: Copy-Item ${{ github.workspace }}\SourceCache\swift-build\cmake\SQLite\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\sqlite-3.43.2\CMakeLists.txt - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-sqlite - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure SQLite - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/sqlite-3.43.2 - - name: Build SQLite - run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 - - name: Install SQLite - run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 --target install - - - uses: actions/upload-artifact@v4 - with: - name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-3.43.2 - path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr - - icu_tools: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - steps: - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: actions/checkout@v4 - with: - repository: unicode-org/icu - ref: ${{ needs.context.outputs.icu_revision }} - path: ${{ github.workspace }}/SourceCache/icu - show-progress: false - - - name: Copy CMakeLists.txt - run: Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: amd64 - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: windows-amd64-icu_tools - variant: sccache - append-timestamp: false - - - name: Configure ICU Build Tools - run: - cmake -B ${{ github.workspace }}/BinaryCache/icu-tools-69.1 ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TOOLS=YES ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/icu/icu4c - - - name: Build ICU Tools - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-tools-69.1 - - - uses: actions/upload-artifact@v4 - with: - name: icu-tools-69.1 - path: | - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genbrk.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencfu.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencnval.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gendict.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genrb.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gensprep.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/icupkg.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/makeconv.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/pkgdata.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genccode.exe - - icu: - needs: [context, icu_tools] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - BUILD_TOOLS: NO - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - BUILD_TOOLS: NO - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - BUILD_TOOLS: YES - BUILD_DATA: YES - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} ICU - - steps: - - uses: actions/download-artifact@v4 - with: - name: icu-tools-69.1 - path: ${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin - - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: actions/checkout@v4 - with: - repository: unicode-org/icu - ref: ${{ needs.context.outputs.icu_revision }} - path: ${{ github.workspace }}/SourceCache/icu - show-progress: false - - - name: Copy CMakeLists.txt - run: | - Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt - Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\icupkg.inc.cmake -destination ${{ github.workspace }}\SourceCache\icu\icu4c\icupkg.inc.cmake - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 200M - key: ${{ matrix.os }}-${{ matrix.arch }}-icu - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure ICU - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/icu-69.1 ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TOOLS=${{ matrix.BUILD_TOOLS }} ` - -D BUILD_DATA=${{ matrix.BUILD_DATA }} ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D ICU_TOOLS_DIR=${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/icu/icu4c - - name: Build ICU - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 - - name: Install ICU - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 --target install - - - uses: actions/upload-artifact@v4 - with: - name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 - path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr - - cmark_gfm: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - arch: ['amd64', 'arm64'] - - steps: - - uses: actions/checkout@v4 - with: - repository: apple/swift-cmark - ref: ${{ needs.context.outputs.swift_cmark_revision }} - path: ${{ github.workspace }}/SourceCache/cmark-gfm - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 1M - key: windows-${{ matrix.arch }}-cmark-gfm - variant: sccache - append-timestamp: false - - - name: Configure cmark-gfm - run: > - cmake -B ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_COMPILER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr ` - -D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES ` - -S ${{ github.workspace }}/SourceCache/cmark-gfm ` - -G Ninja - - name: Build cmark-gfm - run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 - - name: Install cmark-gfm - run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 --target install - - uses: actions/upload-artifact@v4 - with: - name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - build_tools: - needs: [context, cmark_gfm] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - steps: - - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - uses: actions/checkout@v4 - with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} - path: ${{ github.workspace }}/SourceCache/llvm-project - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: windows-amd64-build_tools - variant: sccache - append-timestamp: false - - - name: Configure Tools - run: | - cmake -B ${{ github.workspace }}/BinaryCache/0 ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` - -D LLVM_ENABLE_ASSERTIONS=NO ` - -D LLVM_ENABLE_LIBEDIT=NO ` - -D LLVM_ENABLE_LIBXML2=NO ` - -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lldb" ` - -D LLVM_EXTERNAL_PROJECTS="swift" ` - -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift ` - -D LLDB_ENABLE_PYTHON=NO ` - -D LLDB_INCLUDE_TESTS=NO ` - -D LLDB_ENABLE_SWIFT_SUPPORT=NO ` - -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO ` - -D SWIFT_BUILD_DYNAMIC_STDLIB=NO ` - -D SWIFT_BUILD_HOST_DISPATCH=NO ` - -D SWIFT_BUILD_LIBEXEC=NO ` - -D SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=NO ` - -D SWIFT_BUILD_REMOTE_MIRROR=NO ` - -D SWIFT_BUILD_SOURCEKIT=NO ` - -D SWIFT_BUILD_STATIC_SDK_OVERLAY=NO ` - -D SWIFT_BUILD_STATIC_STDLIB=NO ` - -D SWIFT_BUILD_SWIFT_SYNTAX=NO ` - -D SWIFT_ENABLE_DISPATCH=NO ` - -D SWIFT_INCLUDE_APINOTES=NO ` - -D SWIFT_INCLUDE_DOCS=NO ` - -D SWIFT_INCLUDE_TESTS=NO - - name: Build llvm-tblgen - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-tblgen - - name: Build clang-tblgen - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tblgen - - name: Build lldb-tblgen - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target lldb-tblgen - - name: Build llvm-config - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target llvm-config - - name: Build clang-pseudo-gen - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-pseudo-gen - - name: Build clang-tidy-confusable-chars-gen - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target clang-tidy-confusable-chars-gen - - name: Build swift-def-to-strings-converter - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-def-to-strings-converter - - name: Build swift-serialize-diagnostics - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-serialize-diagnostics - - name: Build swift-compatibility-symbols - run: cmake --build ${{ github.workspace }}/BinaryCache/0 --target swift-compatibility-symbols - - - uses: actions/upload-artifact@v4 - with: - name: build-tools - path: | - ${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe - ${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe - ${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe - ${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe - ${{ github.workspace }}/BinaryCache/0/bin/clang-pseudo-gen.exe - ${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe - ${{ github.workspace }}/BinaryCache/0/bin/swift-def-to-strings-converter.exe - ${{ github.workspace }}/BinaryCache/0/bin/swift-serialize-diagnostics.exe - ${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols.exe - - compilers: - needs: [context, build_tools, cmark_gfm] - runs-on: ${{ needs.context.outputs.compilers_build_runner }} - - env: - # Must be a full version string from https://www.nuget.org/packages/pythonarm64 - PYTHON_VERSION: 3.9.10 - - strategy: - fail-fast: false - matrix: - include: - - arch: 'amd64' - cpu: 'x86_64' - triple: 'x86_64-unknown-windows-msvc' - - - arch: 'arm64' - cpu: 'aarch64' - triple: 'aarch64-unknown-windows-msvc' - - steps: - - uses: actions/download-artifact@v4 - with: - name: build-tools - path: ${{ github.workspace }}/BinaryCache/0/bin - - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - uses: actions/checkout@v4 - with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} - path: ${{ github.workspace }}/SourceCache/llvm-project - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-experimental-string-processing - ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} - path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-syntax - ref: ${{ needs.context.outputs.swift_syntax_revision }} - path: ${{ github.workspace }}/SourceCache/swift-syntax - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-corelibs-libdispatch - ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch - show-progress: false - - - name: Install Python ${{ env.PYTHON_VERSION }} (Host) - uses: actions/setup-python@v5 - id: python - with: - python-version: '${{ env.PYTHON_VERSION }}' - - - uses: nuget/setup-nuget@v2 - if: matrix.arch == 'arm64' - - # TODO(lxbndr) use actions/cache to improve this step timings - - name: Install Python ${{ env.PYTHON_VERSION }} (arm64) - if: matrix.arch == 'arm64' - run: | - $NugetSources=[string](nuget Sources List -Format short) - if (-Not ($NugetSources.contains("api.nuget.org"))) { - nuget sources Add -Name api.nuget.org -Source https://api.nuget.org/v3/index.json -NonInteractive - } - nuget install pythonarm64 -Version ${{ env.PYTHON_VERSION }} - - - name: Export Python Location - run: | - echo "PYTHON_LOCATION_amd64=$env:pythonLocation" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "PYTHON_LOCATION_arm64=${{ github.workspace }}\pythonarm64.${{ env.PYTHON_VERSION }}\tools" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Install Swift Toolchain - uses: compnerd/gha-setup-swift@main - with: - github-repo: thebrowsercompany/swift-build - github-token: ${{ secrets.GITHUB_TOKEN }} - release-asset-name: installer-amd64.exe - release-tag-name: '20231016.0' - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 500M - key: windows-${{ matrix.arch }}-compilers - variant: sccache - append-timestamp: false - - - name: Configure Compilers - env: - NDKPATH: ${{ steps.setup-ndk.outputs.ndk-path }} - run: | - if ( "${{ matrix.arch }}" -eq "arm64" ) { - $CMAKE_SYSTEM_NAME="-D CMAKE_SYSTEM_NAME=Windows" - $CMAKE_SYSTEM_PROCESSOR="-D CMAKE_SYSTEM_PROCESSOR=ARM64" - $CACHE="Windows-aarch64.cmake" - - # FIXME(compnerd) re-enable runtimes after we sort out compiler-rt - (Get-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).Replace(' runtimes', '') | Set-Content ${{ github.workspace }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake - } else { - $CACHE="Windows-x86_64.cmake" - } - $SWIFTC = cygpath -m (Get-Command swiftc).Source - $SDKROOT = cygpath -m ${env:SDKROOT} - # Use toolchain clang to avoid broken __prefetch intrinsic on arm64 in Clang 18. - $CLANG_LOCATION = cygpath -m (Split-Path (Get-Command swiftc).Source) - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/1 ` - -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/${CACHE} ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` - -D CMAKE_MT=mt ` - -D CMAKE_Swift_COMPILER="${SWIFTC}" ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` - -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" ` - ${CMAKE_SYSTEM_NAME} ` - ${CMAKE_SYSTEM_PROCESSOR} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` - -D CLANG_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe ` - -D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe ` - -D LLDB_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe ` - -D LLVM_CONFIG_PATH=${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe ` - -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift ` - -D LLVM_NATIVE_TOOL_DIR=${{ github.workspace }}/BinaryCache/0/bin ` - -D LLVM_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe ` - -D LLVM_USE_HOST_TOOLS=NO ` - -D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=NO ` - -D SWIFT_BUILD_DYNAMIC_STDLIB=NO ` - -D SWIFT_BUILD_REMOTE_MIRROR=NO ` - -D SWIFT_BUILD_SWIFT_SYNTAX=YES ` - -D SWIFT_CLANG_LOCATION=${CLANG_LOCATION} ` - -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` - -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` - -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BinaryCache/0/bin ` - -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` - -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` - -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing ` - -D SWIFT_PATH_TO_SWIFT_SDK="${SDKROOT}" ` - -D CLANG_VENDOR=compnerd.org ` - -D CLANG_VENDOR_UTI=org.compnerd.dt ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` - -D PACKAGE_VENDOR=compnerd.org ` - -D SWIFT_VENDOR=compnerd.org ` - -D LLVM_PARALLEL_LINK_JOBS=2 ` - -D SWIFT_PARALLEL_LINK_JOBS=2 ` - -D LLVM_APPEND_VC_REV=NO ` - -D LLVM_VERSION_SUFFIX="" ` - -D LLDB_PYTHON_EXE_RELATIVE_PATH=python.exe ` - -D LLDB_PYTHON_EXT_SUFFIX=.pyd ` - -D LLDB_PYTHON_RELATIVE_PATH=lib/site-packages ` - -D Python3_EXECUTABLE=${{ steps.python.outputs.python-path }} ` - -D Python3_INCLUDE_DIR=$env:PYTHON_LOCATION_${{ matrix.arch }}\include ` - -D Python3_LIBRARY=$env:PYTHON_LOCATION_${{ matrix.arch }}\libs\python39.lib ` - -D Python3_ROOT_DIR=$env:pythonLocation - - - name: Build Compiler Distribution - run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target distribution - - - name: Install Compiler Distribution - run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target install-distribution-stripped - - - name: Upload Compilers - uses: actions/upload-artifact@v4 - with: - name: compilers-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library - - - name: extract swift-syntax - run: | - $module = "${{ github.workspace }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake" - $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/1 - (Get-Content $module).Replace("${bindir}", '') | Set-Content $module - New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib" - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse - New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null - Copy-Item -Path $module -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules" - - - name: Upload swift-syntax - uses: actions/upload-artifact@v4 - with: - name: swift-syntax-${{ matrix.arch }} - path: ${{ github.workspace }}/BinaryCache/swift-syntax - - # TODO(compnerd) this takes ~1h due to the size, see if we can compress first - - uses: actions/upload-artifact@v4 - if: false # ${{ needs.context.outputs.debug_info }} - with: - name: compilers-${{ matrix.arch }}-debug-info - path: | - ${{ github.workspace }}/BinaryCache/1/**/*.pdb - - - name: Upload PDBs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 - searchPattern: '**/*.pdb' - - - name: Upload DLLs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 - searchPattern: '**/*.dll' - - - name: Upload EXEs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 - searchPattern: '**/*.exe' - - zlib: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} zlib - - steps: - - uses: actions/checkout@v4 - with: - repository: madler/zlib - ref: ${{ needs.context.outputs.zlib_revision }} - path: ${{ github.workspace }}/SourceCache/zlib - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-zlib - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure zlib - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/zlib-1.3 ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/zlib ` - -D SKIP_INSTALL_FILES=YES - - name: Build zlib - run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3 - - name: Install zlib - run: cmake --build ${{ github.workspace }}/BinaryCache/zlib-1.3 --target install - - - uses: actions/upload-artifact@v4 - with: - name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 - path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr - - curl: - needs: [context, zlib] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} curl - - steps: - - uses: actions/checkout@v4 - with: - repository: curl/curl - ref: ${{ needs.context.outputs.curl_revision }} - path: ${{ github.workspace }}/SourceCache/curl - show-progress: false - - - uses: actions/download-artifact@v4 - with: - name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 - path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-curl - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure curl - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/curl-7.77.0 ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/curl ` - -D BUILD_TESTING=NO ` - -D BUILD_CURL_EXE=NO ` - -D CURL_CA_BUNDLE="none" ` - -D CURL_CA_FALLBACK=NO ` - -D CURL_CA_PATH="none" ` - -D CURL_BROTLI=NO ` - -D CURL_DISABLE_ALTSVC=NO ` - -D CURL_DISABLE_AWS=YES ` - -D CURL_DISABLE_BASIC_AUTH=NO ` - -D CURL_DISABLE_BEARER_AUTH=NO ` - -D CURL_DISABLE_COOKIES=NO ` - -D CURL_DISABLE_DICT=YES ` - -D CURL_DISABLE_DIGEST_AUTH=NO ` - -D CURL_DISABLE_DOH=NO ` - -D CURL_DISABLE_FILE=YES ` - -D CURL_DISABLE_FORM_API=NO ` - -D CURL_DISABLE_FTP=YES ` - -D CURL_DISABLE_GETOPTIONS=NO ` - -D CURL_DISABLE_GOPHER=YES ` - -D CURL_DISABLE_HSTS=NO ` - -D CURL_DISABLE_HTTP=NO ` - -D CURL_DISABLE_HTTP_AUTH=NO ` - -D CURL_DISABLE_IMAP=YES ` - -D CURL_DISABLE_KERBEROS_AUTH=NO ` - -D CURL_DISABLE_LDAP=YES ` - -D CURL_DISABLE_LDAPS=YES ` - -D CURL_DISABLE_MIME=NO ` - -D CURL_DISABLE_MQTT=YES ` - -D CURL_DISABLE_NEGOTIATE_AUTH=NO ` - -D CURL_DISABLE_NETRC=NO ` - -D CURL_DISABLE_NTLM=NO ` - -D CURL_DISABLE_PARSEDATE=NO ` - -D CURL_DISABLE_POP3=YES ` - -D CURL_DISABLE_PROGRESS_METER=YES ` - -D CURL_DISABLE_PROXY=NO ` - -D CURL_DISABLE_RTSP=YES ` - -D CURL_DISABLE_SHUFFLE_DNS=YES ` - -D CURL_DISABLE_SMB=YES ` - -D CURL_DISABLE_SMTP=YES ` - -D CURL_DISABLE_SOCKETPAIR=YES ` - -D CURL_DISABLE_SRP=NO ` - -D CURL_DISABLE_TELNET=YES ` - -D CURL_DISABLE_TFTP=YES ` - -D CURL_DISABLE_VERBOSE_STRINGS=NO ` - -D CURL_LTO=NO ` - -D CURL_USE_BEARSSL=NO ` - -D CURL_USE_GNUTLS=NO ` - -D CURL_USE_GSSAPI=NO ` - -D CURL_USE_LIBPSL=NO ` - -D CURL_USE_LIBSSH=NO ` - -D CURL_USE_LIBSSH2=NO ` - -D CURL_USE_MBEDTLS=NO ` - -D CURL_USE_OPENSSL=NO ` - -D CURL_USE_SCHANNEL=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` - -D CURL_USE_WOLFSSL=NO ` - -D CURL_WINDOWS_SSPI=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` - -D CURL_ZLIB=YES ` - -D CURL_ZSTD=NO ` - -D ENABLE_ARES=NO ` - -D ENABLE_CURLDEBUG=NO ` - -D ENABLE_DEBUG=NO ` - -D ENABLE_IPV6=YES ` - -D ENABLE_MANUAL=NO ` - -D ENABLE_THREADED_RESOLVER=NO ` - -D ENABLE_UNICODE=YES ` - -D ENABLE_UNIX_SOCKETS=NO ` - -D ENABLE_WEBSOCKETS=NO ` - -D HAVE_POLL_FINE=NO ` - -D USE_IDN2=NO ` - -D USE_MSH3=NO ` - -D USE_NGHTTP2=NO ` - -D USE_NGTCP2=NO ` - -D USE_QUICHE=NO ` - -D USE_WIN32_IDN=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` - -D USE_WIN32_LARGE_FILES=${{ matrix.os == 'Windows' && 'YES' || 'NO' }} ` - -D USE_WIN32_LDAP=NO ` - -D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` - -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/zlibstatic.lib ` - -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` - -D CMAKE_ANDROID_NDK=$NDKPATH - - name: Build curl - run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 - - name: Install curl - run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 --target install - - - uses: actions/upload-artifact@v4 - with: - name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 - path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr - - libxml2: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} libxml2 - - steps: - - uses: actions/checkout@v4 - with: - repository: gnome/libxml2 - ref: ${{ needs.context.outputs.libxml2_revision }} - path: ${{ github.workspace }}/SourceCache/libxml2 - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-libxml2 - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure libxml2 - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/libxml2 ` - -D LIBXML2_WITH_ICONV=NO ` - -D LIBXML2_WITH_ICU=NO ` - -D LIBXML2_WITH_LZMA=NO ` - -D LIBXML2_WITH_PYTHON=NO ` - -D LIBXML2_WITH_TESTS=NO ` - -D LIBXML2_WITH_THREADS=YES ` - -D LIBXML2_WITH_ZLIB=NO ` - -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` - -D CMAKE_ANDROID_NDK=$NDKPATH - - name: Build libxml2 - run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 - - name: Install libxml2 - run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 --target install - - - uses: actions/upload-artifact@v4 - with: - name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 - path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr - - sdk: - continue-on-error: ${{ matrix.arch != 'amd64' }} - needs: [context, icu, libxml2, curl, zlib, compilers, cmark_gfm] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cpu: 'x86_64' - triple: 'x86_64-unknown-windows-msvc' - triple_no_api_level: 'x86_64-unknown-windows-msvc' - cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} - os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: - - - arch: arm64 - cpu: 'aarch64' - triple: 'aarch64-unknown-windows-msvc' - triple_no_api_level: 'aarch64-unknown-windows-msvc' - cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} - os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: - - - arch: x86 - cpu: 'i686' - triple: 'i686-unknown-windows-msvc' - triple_no_api_level: 'i686-unknown-windows-msvc' - cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} - os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: - - - arch: arm64 - cpu: 'aarch64' - triple: 'aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' - triple_no_api_level: aarch64-unknown-linux-android - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g - os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cpu: armv7 - triple: 'armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }}' - triple_no_api_level: armv7-unknown-linux-androideabi - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g - os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cpu: i686 - triple: 'i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' - triple_no_api_level: i686-unknown-linux-android - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g - os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cpu: 'x86_64' - triple: 'x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' - triple_no_api_level: x86_64-unknown-linux-android - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g - os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 - - name: ${{ matrix.os }} ${{ matrix.arch }} SDK - - steps: - - uses: actions/download-artifact@v4 - with: - name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 - path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr - - uses: actions/download-artifact@v4 - with: - name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 - path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr - - uses: actions/download-artifact@v4 - with: - name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 - path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr - - uses: actions/download-artifact@v4 - with: - name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 - path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr - - name: Download Compilers - uses: actions/download-artifact@v4 - with: - name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/Library - - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - name: cmark-gfm Setup - run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - - - uses: actions/checkout@v4 - with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} - path: ${{ github.workspace }}/SourceCache/llvm-project - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-syntax - ref: ${{ needs.context.outputs.swift_syntax_revision }} - path: ${{ github.workspace }}/SourceCache/swift-syntax - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-corelibs-libdispatch - ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch - show-progress: false - - uses: actions/checkout@v4 - if: matrix.os == 'Windows' - with: - repository: apple/swift-corelibs-foundation - ref: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation - show-progress: false - - uses: actions/checkout@v4 - if: matrix.os == 'Android' - with: - repository: apple/swift-corelibs-foundation - ref: a515f3e15c81d029411c540df7edf52d427ff2cb - path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-corelibs-xctest - ref: ${{ needs.context.outputs.swift_corelibs_xctest_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-xctest - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-experimental-string-processing - ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} - path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Install Swift Toolchain - uses: compnerd/gha-setup-swift@main - with: - github-repo: thebrowsercompany/swift-build - github-token: ${{ secrets.GITHUB_TOKEN }} - release-asset-name: installer-amd64.exe - release-tag-name: '20231016.0' - - # workaround CMake 3.30 issue - - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.29' - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure LLVM - run: | - $CLANG_CL = "cl" - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/llvm ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - ${{ matrix.llvm_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` - -D LLVM_ENABLE_ASSERTIONS=YES - - - name: Configure Swift Standard Library - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/swift ` - -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-${{ matrix.os }}-${{ matrix.cpu }}.cmake ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/swift/lib/swift ${{ matrix.swiftflags }}" ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` - ${{ matrix.linker_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift ` - -D LLVM_DIR=${{ github.workspace }}/BinaryCache/llvm/lib/cmake/llvm ` - -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` - -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` - -D SWIFT_ENABLE_VOLATILE=YES ` - -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ` - -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` - -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` - -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing - - name: Build Swift Standard Library - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/swift - - name: Install Swift Standard Library - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/swift --target install - - - name: Configure libdispatch - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } - - $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/libdispatch ` - -D BUILD_SHARED_LIBS=YES ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` - ${{ matrix.linker_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` - -D BUILD_TESTING=NO ` - -D ENABLE_SWIFT=YES - - name: Build libdispatch - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/libdispatch - - - name: Configure Foundation - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - $DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" } - - $zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" } - $xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" } - $icu_data_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicudt69.lib" } else { "libicudt69.a" } - $icu_i18n_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuuc69.lib" } else { "libicuin69.a" } - $icu_lib_release = if ("${{ matrix.os }}" -eq "Windows") { "sicuin69.lib" } else { "libicuuc69.a" } - $build_tools = if ("${{ matrix.os }}" -eq "Windows") { "YES" } else { "NO" } - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/foundation ` - -D BUILD_SHARED_LIBS=YES ` - -D CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL="/MD" ` - -D CMAKE_ASM_FLAGS="--target=${{ matrix.triple }}" ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` - ${{ matrix.linker_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-corelibs-foundation ` - -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` - -D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr/lib/cmake/CURL ` - -D FOUNDATION_BUILD_TOOLS=${build_tools} ` - -D ENABLE_TESTING=NO ` - -D ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_data_lib_release ` - -D ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_i18n_lib_release ` - -D ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -D ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include ` - -D ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/$icu_lib_release ` - -D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" ` - -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 ` - -D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib ` - -D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` - -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$zlib_lib - - name: Build foundation - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/foundation - - # TODO(compnerd) correctly version XCTest - - name: Configure xctest - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } - - $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/xctest ` - -D BUILD_SHARED_LIBS=YES ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_BUILD_WITH_INSTALL_RPATH=YES ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` - ${{ matrix.linker_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-corelibs-xctest ` - -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` - -D Foundation_DIR=${{ github.workspace }}/BinaryCache/foundation/cmake/modules ` - -D ENABLE_TESTING=NO - - name: Build xctest - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/xctest - - - name: Install xctest - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/xctest --target install - - name: Install foundation - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/foundation --target install - - name: Install libdispatch - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/libdispatch --target install - - - uses: actions/setup-python@v5 - - uses: jannekem/run-python-script-action@v1 - with: - script: | - import os - import plistlib - - info_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Info.plist' - with open(os.path.normpath(info_plist), 'wb') as plist: - # TODO(compnerd) derive this from the install directory - plistlib.dump({ 'DefaultProperties': { 'XCTEST_VERSION': 'development', 'SWIFTC_FLAGS': ['-use-ld=lld'] } }, plist) - - sdk_settings_plist = r'${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/SDKSettings.plist' - with open(os.path.normpath(sdk_settings_plist), 'wb') as plist: - # TODO(compnerd) derive this from the CMAKE_BUILD_TYPE for the - # runtime. - plistlib.dump({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }, plist) - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.os }}-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform - - - name: Upload PDBs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache - searchPattern: '**/*.pdb' - - - name: Upload DLLs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache - searchPattern: '**/*.dll' - - devtools: - needs: [context, sqlite, compilers, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: 'amd64' - cpu: 'x86_64' - triple: 'x86_64-unknown-windows-msvc' - - - arch: 'arm64' - cpu: 'aarch64' - triple: 'aarch64-unknown-windows-msvc' - - steps: - - uses: actions/download-artifact@v4 - with: - name: sqlite-Windows-${{ matrix.arch }}-3.43.2 - path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr - - name: Download Compilers - uses: actions/download-artifact@v4 - with: - name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/Library - - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BinaryCache - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - - name: Downlaod swift-syntax - uses: actions/download-artifact@v4 - with: - name: swift-syntax-${{ matrix.arch }} - path: ${{ github.workspace }}/BinaryCache/swift-syntax - - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - name: cmark-gfm Setup - run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - - - uses: actions/download-artifact@v4 - if: matrix.arch == 'arm64' - with: - name: cmark-gfm-arm64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - uses: actions/checkout@v4 - with: - repository: apple/indexstore-db - ref: ${{ needs.context.outputs.indexstore_db_revision }} - path: ${{ github.workspace }}/SourceCache/indexstore-db - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/sourcekit-lsp - ref: ${{ needs.context.outputs.sourcekit_lsp_revision }} - path: ${{ github.workspace }}/SourceCache/sourcekit-lsp - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-argument-parser - ref: ${{ needs.context.outputs.swift_argument_parser_revision }} - path: ${{ github.workspace }}/SourceCache/swift-argument-parser - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-asn1 - ref: ${{ needs.context.outputs.swift_asn1_revision }} - path: ${{ github.workspace }}/SourceCache/swift-asn1 - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-certificates - ref: ${{ needs.context.outputs.swift_certificates_revision }} - path: ${{ github.workspace }}/SourceCache/swift-certificates - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-collections - ref: ${{ needs.context.outputs.swift_collections_revision }} - path: ${{ github.workspace }}/SourceCache/swift-collections - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-crypto - ref: ${{ needs.context.outputs.swift_crypto_revision }} - path: ${{ github.workspace }}/SourceCache/swift-crypto - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-driver - ref: ${{ needs.context.outputs.swift_driver_revision }} - path: ${{ github.workspace }}/SourceCache/swift-driver - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-format - ref: ${{ needs.context.outputs.swift_format_revision }} - path: ${{ github.workspace }}/SourceCache/swift-format - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-llbuild - ref: ${{ needs.context.outputs.swift_llbuild_revision }} - path: ${{ github.workspace }}/SourceCache/swift-llbuild - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-markdown - ref: ${{ needs.context.outputs.swift_markdown_revision }} - path: ${{ github.workspace }}/SourceCache/swift-markdown - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-package-manager - ref: ${{ needs.context.outputs.swift_package_manager_revision }} - path: ${{ github.workspace }}/SourceCache/swift-package-manager - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-system - ref: ${{ needs.context.outputs.swift_system_revision }} - path: ${{ github.workspace }}/SourceCache/swift-system - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift-tools-support-core - ref: ${{ needs.context.outputs.swift_tools_support_core_revision }} - path: ${{ github.workspace }}/SourceCache/swift-tools-support-core - show-progress: false - - uses: actions/checkout@v4 - with: - repository: jpsim/Yams - ref: ${{ needs.context.outputs.yams_revision }} - path: ${{ github.workspace }}/SourceCache/Yams - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift - show-progress: false - - - run: | - $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin - echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - run: | - $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" - mv ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ - mv ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ - - - name: Configure swift-argument-parser - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-argument-parser ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-argument-parser - - name: Build swift-argument-parser - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser - - - name: Configure swift-collections - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-collections ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-collections - - name: Build swift-collections - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections - - - name: Configure swift-crypto - run: | - # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-crypto ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-crypto - - name: Build swift-crypto - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-crypto - - - name: Configure Yams - run: | - # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/yams ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/Yams - - name: Build Yams - run: cmake --build ${{ github.workspace }}/BinaryCache/yams - - - name: Configure swift-llbuild - run: | - # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-llbuild ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-llbuild ` - -D LLBUILD_SUPPORT_BINDINGS=Swift ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include - - name: Build swift-llbuild - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild - - - name: Configure swift-system - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-system ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-system - - name: Build swift-system - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system - - - name: Configure swift-tools-support-core - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-tools-support-core ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-tools-support-core ` - -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include - - name: Build swift-tools-support-core - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core - - - name: Configure swift-driver - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-driver ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-driver ` - -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` - -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` - -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules ` - -D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules - - name: Build swift-driver - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver - - - name: Configure swift-asn1 - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-asn1 ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-asn1 - - name: Build swift-asn1 - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-asn1 - - - name: Configure swift-certificates - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-certificates ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-certificates ` - -D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules ` - -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules - - name: Build swift-certificates - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-certificates - - - name: extract swift-syntax - run: | - $module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake" - $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax - (Get-Content $module).Replace('', "${bindir}") | Set-Content $module - - - name: Configure swift-package-manager - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-package-manager ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-package-manager ` - -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules ` - -D SwiftCertificates_DIR=${{ github.workspace }}/BinaryCache/swift-certificates/cmake/modules ` - -D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules ` - -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules ` - -D SwiftDriver_DIR=${{ github.workspace }}/BinaryCache/swift-driver/cmake/modules ` - -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules ` - -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules ` - -D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules - - name: Build swift-package-manager - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager - - - name: Configure Markdown - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-markdown ` - -D BUILD_SHARED_LIBS=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-markdown ` - -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake - - name: Build Markdown - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown - - - name: Configure Format - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/swift-format ` - -D BUILD_SHARED_LIBS=YES ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift-format ` - -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` - -D SwiftMarkdown_DIR=${{ github.workspace }}/BinaryCache/swift-markdown/cmake/modules ` - -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules - - name: Build swift-format - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format - - - name: Configure IndexStoreDB - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/indexstore-db ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include/Block" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/indexstore-db - - name: Build indexstore-db - run: cmake --build ${{ github.workspace }}/BinaryCache/indexstore-db - - - name: Configure SourceKit-LSP - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - - cmake -B ${{ github.workspace }}/BinaryCache/sourcekit-lsp ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${CLANG_CL} ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` - -D CMAKE_CXX_COMPILER=${CLANG_CL} ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` - -D CMAKE_SYSTEM_NAME=Windows ` - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/sourcekit-lsp ` - -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D IndexStoreDB_DIR=${{ github.workspace }}/BinaryCache/indexstore-db/cmake/modules ` - -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` - -D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules ` - -D SwiftCrypto_DIR=${{ github.workspace }}/BinaryCache/swift-crypto/cmake/modules ` - -D SwiftPM_DIR=${{ github.workspace }}/BinaryCache/swift-package-manager/cmake/modules ` - -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules ` - -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules - - name: Build SourceKit-LSP - run: cmake --build ${{ github.workspace }}/BinaryCache/SourceKit-LSP - - - name: Install swift-argument-parser - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-argument-parser --target install - - name: Install swift-collections - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-collections --target install - - name: Install swift-llbuild - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild --target install - - name: Install swift-system - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-system --target install - - name: Install swift-tools-support-core - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core --target install - - name: Install swift-driver - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-driver --target install - - name: Install swift-package-manager - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-package-manager --target install - - name: Install SourceKit-LSP - run: cmake --build ${{ github.workspace }}/BinaryCache/sourcekit-lsp --target install - - name: Install swift-format - run: cmake --build ${{ github.workspace }}/BinaryCache/swift-format --target install - - - uses: actions/upload-artifact@v4 - with: - name: devtools-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot-DevTools/Library - - - name: Upload PDBs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache - searchPattern: '**/*.pdb' - - - name: Upload DLLs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache - searchPattern: '**/*.dll' - - - name: Upload EXEs to Azure - uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} - with: - accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} - personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache - searchPattern: '**/*.exe' - - - debugging_tools: - name: Debugging Tools - needs: [context, compilers, devtools, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - cpu: x86_64 - triple: x86_64-unknown-windows-msvc - - arch: arm64 - cpu: aarch64 - triple: aarch64-unknown-windows-msvc - - steps: - - name: Download build compilers - uses: actions/download-artifact@v4 - with: - name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/ - - - name: Download build devtools - uses: actions/download-artifact@v4 - with: - name: devtools-amd64 - path: ${{ github.workspace }}/BuildRoot/ - - # We're using the runtime libraries from this one. - - name: Download Windows SDK (AMD64) - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BinaryCache/ - - - name: Copy Windows SDK (AMD64) to BuildRoot - run: Copy-Item -Recurse -Force -Path ${{ github.workspace }}/BinaryCache/* -Destination ${{ github.workspace }}/BuildRoot/ - - - name: Update environment variables - run: | - $SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/SDKs/Windows.sdk" - $ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin" - $RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin" - - echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "TOOLCHAIN_PATH=${ToolchainPath}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "AR=${ToolchainPath}\llvm-ar.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "${ToolchainPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "${RTLPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 - run: | - mv ${{ env.SDKROOT }}/usr/lib/swift/dispatch ${{ env.SDKROOT }}/usr/include/ - mv ${{ env.SDKROOT }}/usr/lib/swift/os ${{ env.SDKROOT }}/usr/include/ - mv ${{ env.SDKROOT }}/usr/lib/swift/Block ${{ env.SDKROOT }}/usr/include/ - - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - mv ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/x86_64/ - - - name: Download ${{ matrix.arch }} Windows SDK - # Only necessary when cross-compiling - if: ${{ matrix.arch != 'amd64' }} - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/ - - - name: Patch the SDK to workaround https://github.com/thebrowsercompany/swift-build#50 - # Only necessary when cross-compiling - if: ${{ matrix.arch != 'amd64' }} - run: | - # We already copied these above. - # Remove them to prevent 'module defined more than once' errors. - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/dispatch - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/os - rm -Force -Recurse ${{ env.SDKROOT }}/usr/lib/swift/Block - - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/BlocksRuntime.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/dispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/swiftDispatch.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/Foundation.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationXML.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - mv -Force ${{ env.SDKROOT }}/usr/lib/swift/windows/FoundationNetworking.lib ${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/ - - - name: Checkout apple/swift - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift - show-progress: false - - # Note: We didn't need to explicitly download cmark-gfm above because it's packaged inside - # compilers-${{ matrix.arch }}. - - name: Setup cmark-gfm - run: Copy-Item ${{ github.workspace }}/BuildRoot/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ env.TOOLCHAIN_PATH }} - - - name: Build swift-inspect - id: swift_inspect - shell: cmd - run: | - swift build ^ - --triple=${{ matrix.triple }} ^ - --scratch-path="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect" ^ - --sdk="${{ env.SDKROOT }}" ^ - --package-path="${{ github.workspace }}/SourceCache/swift/tools/swift-inspect" ^ - -c="release" ^ - -Xbuild-tools-swiftc="-L${{ env.SDKROOT }}/usr/lib/swift/windows" ^ - -Xbuild-tools-swiftc="-I${{ env.SDKROOT }}/usr/lib/swift -use-ld=lld" ^ - -Xcc="-I${{ env.SDKROOT }}/usr/include/swift/SwiftRemoteMirror" ^ - -Xlinker="${{ env.SDKROOT }}/usr/lib/swift/windows/${{ matrix.cpu }}/swiftRemoteMirror.lib" ^ - -Xswiftc="-use-ld=lld" - - - name: Copy swift-inspect executable - run: | - New-Item -Path ${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect -ItemType Directory -Force | Out-Null - $SwiftInspectPath="${{ github.workspace }}/BinaryCache/${{ matrix.arch }}/swift-inspect/${{ matrix.triple }}/release/swift-inspect.exe" - Copy-Item ${SwiftInspectPath} -Destination "${{ github.workspace }}/BuildRoot-DebuggingTools/swift-inspect/" - - - uses: actions/upload-artifact@v4 - with: - name: debugging_tools-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot-DebuggingTools - - package_tools: - name: Package Tools - needs: [context, compilers, debugging_tools, devtools] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - arch: ['amd64' , 'arm64'] - - steps: - - name: Download Debugging Tools - uses: actions/download-artifact@v4 - with: - name: debugging_tools-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/DebuggingTools - - - name: Download Compilers - uses: actions/download-artifact@v4 - with: - name: compilers-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library - - - name: Download DevTools - uses: actions/download-artifact@v4 - with: - name: devtools-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library - - - name: Download cmark-gfm - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - name: cmark-gfm Setup - run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - run: | - $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 - $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx - Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' - certutil -decode $CertificatePath $PFXPath - Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} - - - name: Install WixToolset.Sdk - run: | - if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force - } - - - name: Package Build Tools - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bld/bld.wixproj - - - name: Package CLI Tools - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/cli/cli.wixproj - - - name: Package Debugging Tools - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:INCLUDE_SWIFT_INSPECT=true ` - -p:SWIFT_INSPECT_BUILD=${{ github.workspace }}/BuildRoot/DebuggingTools/swift-inspect ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/dbg/dbg.wixproj - - - name: Package IDE Tools - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/ide/ide.wixproj - - - uses: actions/upload-artifact@v4 - with: - name: bld-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/bld.cab - - - uses: actions/upload-artifact@v4 - with: - name: cli-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/cli.cab - - - uses: actions/upload-artifact@v4 - with: - name: dbg-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/dbg.cab - - - uses: actions/upload-artifact@v4 - with: - name: ide-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.cab - - package_sdk_runtime: - name: Package SDK & Runtime - needs: [context, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - platform: x64 - - arch: arm64 - platform: arm64 - - arch: x86 - platform: x86 - - steps: - - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - run: | - $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 - $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx - Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' - certutil.exe -decode $CertificatePath $PFXPath - Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} - - - name: Install WixToolset.Sdk - run: | - if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force - } - - - name: Package SDK - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` - -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - -p:ProductArchitecture=${{ matrix.arch }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/sdk/sdk.wixproj - - - name: Package Runtime - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` - -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:VCRedistDir="${env:VCToolsRedistDir}\${env:VSCMD_ARG_TGT_ARCH}\Microsoft.VC143.CRT\" ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/rtl/msi/rtlmsi.wixproj - - - uses: actions/upload-artifact@v4 - with: - name: sdk-windows-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/sdk.${{ matrix.arch }}.cab - - uses: actions/upload-artifact@v4 - with: - name: rtl-windows-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.cab - - uses: actions/upload-artifact@v4 - with: - name: rtl-windows-${{ matrix.arch }}-msm - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.msm - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.cab - - package_android_sdk: - name: Package Android SDK - needs: [context, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: arm64 - cpu: aarch64 - - arch: x86_64 - cpu: x86_64 - - arch: armv7 - cpu: armv7 - - arch: i686 - cpu: i686 - - steps: - - uses: actions/download-artifact@v4 - with: - name: Android-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform - - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: e1adc0d5dde137fa5941316e89a3ed139a273dde - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - run: | - $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 - $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx - Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' - certutil.exe -decode $CertificatePath $PFXPath - Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} - - - name: Install WixToolset.Sdk - run: | - if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force - } - - - name: Package SDK - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform ` - -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` - -p:ProductArchitecture=${{ matrix.cpu }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/android_sdk/android_sdk.wixproj - - - uses: actions/upload-artifact@v4 - with: - name: sdk-android-${{ matrix.arch }}-msi - path: | - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.msi - ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.cab - - installer: - needs: [context, package_tools, package_sdk_runtime, package_android_sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - arch: ['amd64' , 'arm64'] - - steps: - - uses: actions/download-artifact@v4 - with: - name: bld-${{ matrix.arch }}-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} - - uses: actions/download-artifact@v4 - with: - name: cli-${{ matrix.arch }}-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} - - uses: actions/download-artifact@v4 - with: - name: dbg-${{ matrix.arch }}-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} - - uses: actions/download-artifact@v4 - with: - name: ide-${{ matrix.arch }}-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} - - - uses: actions/download-artifact@v4 - with: - name: rtl-windows-${{ matrix.arch }}-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }} - - uses: actions/download-artifact@v4 - with: - name: rtl-windows-amd64-msm - path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64 - - uses: actions/download-artifact@v4 - with: - name: rtl-windows-x86-msm - path: ${{ github.workspace }}/BinaryCache/installer/Release/x86 - - uses: actions/download-artifact@v4 - with: - name: rtl-windows-arm64-msm - path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64 - - - uses: actions/download-artifact@v4 - with: - name: sdk-windows-amd64-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/amd64 - - uses: actions/download-artifact@v4 - with: - name: sdk-windows-x86-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/x86 - - uses: actions/download-artifact@v4 - with: - name: sdk-windows-arm64-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/arm64 - - uses: actions/download-artifact@v4 - with: - name: sdk-android-arm64-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/aarch64 - - uses: actions/download-artifact@v4 - with: - name: sdk-android-x86_64-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/x86_64 - - uses: actions/download-artifact@v4 - with: - name: sdk-android-armv7-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/armv7 - - uses: actions/download-artifact@v4 - with: - name: sdk-android-i686-msi - path: ${{ github.workspace }}/BinaryCache/installer/Release/i686 - - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - run: | - $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 - $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx - Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' - certutil -decode $CertificatePath $PFXPath - Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} - - # The installer bundle needs the shared project for localization strings, - # but it won't build the dependency on its own due to -p:BuildProjectReferences=false. - - name: Build shared project - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/shared/shared.wixproj - - - name: Build installer bundle - run: | - msbuild -nologo -restore -maxCpuCount ` - -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` - -p:Configuration=Release ` - -p:BuildProjectReferences=false ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` - -p:CERTIFICATE=${env:CERTIFICATE} ` - -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` - -p:BundleFlavor=offline ` - -p:INCLUDE_AMD64_SDK=true ` - -p:INCLUDE_X86_SDK=true ` - -p:INCLUDE_ARM64_SDK=true ` - -p:ANDROID_INCLUDE_ARM64_SDK=true ` - -p:ANDROID_INCLUDE_x86_64_SDK=true ` - -p:ANDROID_INCLUDE_ARM_SDK=true ` - -p:ANDROID_INCLUDE_X86_SDK=true ` - -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` - ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj - - - uses: actions/upload-artifact@v4 - with: - name: installer-${{ matrix.arch }} - path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe - - smoke_test: - needs: [context, installer] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - steps: - - uses: actions/download-artifact@v4 - with: - name: installer-amd64 - path: ${{ github.workspace }}/tmp - - # TODO(compnerd): migrate this to compnerd/gha-setup-swift after the work that @mangini is doing is completed - - run: | - function Update-EnvironmentVariables { - foreach ($level in "Machine", "User") { - [Environment]::GetEnvironmentVariables($level).GetEnumerator() | % { - # For Path variables, append the new values, if they're not already in there - if ($_.Name -Match 'Path$') { - $_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';' - } - $_ - } | Set-Content -Path { "Env:$($_.Name)" } - } - } - - try { - Write-Host "Starting Install installer.exe..." - $Process = Start-Process -FilePath ${{ github.workspace }}/tmp/installer.exe -ArgumentList ("-q") -Wait -PassThru - $ExitCode = $Process.ExitCode - if ($ExitCode -eq 0 -or $ExitCode -eq 3010) { - Write-Host "Installation successful" - } else { - Write-Host "non-zero exit code returned by the installation process: $ExitCode" - exit $ExitCode - } - } catch { - Write-Host "Failed to install: $($_.Exception.Message)" - exit 1 - } - Update-EnvironmentVariables - - # Reset Path and environment - echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 - Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append } - - - uses: actions/checkout@v4 - with: - repository: compnerd/swift-win32 - ref: refs/heads/main - path: ${{ github.workspace }}/SourceCache/swift-win32 - show-progress: false - - - run: swift build - working-directory: ${{ github.workspace }}/SourceCache/swift-win32 - - - run: swift test -Xswiftc -DENABLE_TESTING - working-directory: ${{ github.workspace }}/SourceCache/swift-win32 - - snapshot: - runs-on: ubuntu-latest - needs: [context, smoke_test] - if: github.event_name == 'schedule' - steps: - - uses: actions/checkout@v4 - with: - ref: release/6.0 - show-progress: false - - - uses: actions/download-artifact@v4 - with: - name: stable.xml - - - run: | - git config --global user.name 'github-action[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - if ! git diff --exit-code ; then - git add stable.xml - git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" - git push origin HEAD:release/6.0 - fi - - release: - runs-on: ubuntu-latest - needs: [context, smoke_test] - if: inputs.create_release == true - steps: - - uses: actions/download-artifact@v4 - with: - name: installer-amd64 - path: ${{ github.workspace }}/tmp/amd64 - - - uses: actions/download-artifact@v4 - with: - name: installer-arm64 - path: ${{ github.workspace }}/tmp/arm64 - - - name: Create Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Create Release - gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} - - # AMD64 - cd ${{ github.workspace }}/tmp/amd64 - - mv installer.exe installer-amd64.exe - gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }} - - shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256 - gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }} - - # ARM64 - cd ${{ github.workspace }}/tmp/arm64 - - mv installer.exe installer-arm64.exe - gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }} - - shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256 - gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }} From 17e660dd7ccaa221fb8739736676619cf98fcb4c Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Fri, 26 Jul 2024 10:14:17 -0700 Subject: [PATCH 10/20] GHA: correct SDKROOT handling We were miscomputing the SDKROOT which would fail to find necessary modules when trying to build swift-inspect. Correct the computation and simplify the rules a small amount. Cherry pick commmit https://github.com/compnerd/swift-build/commit/96c7ba3814e0a976882574c2663dece4c479120b --- .github/workflows/swift-toolchain.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 5fe57307e..6b7f9ab30 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -2727,13 +2727,11 @@ jobs: with: name: compilers-amd64 path: ${{ github.workspace }}/BuildRoot/Library - - name: Download Devtools uses: actions/download-artifact@v4 with: name: devtools-amd64 path: ${{ github.workspace }}/BuildRoot/Library - - uses: actions/download-artifact@v4 with: name: Windows-sdk-amd64 @@ -2757,12 +2755,9 @@ jobs: name: cmark-gfm-arm64-0.29.0.gfm.13 path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - name: Copy Windows SDK (AMD64) to BuildRoot - run: Copy-Item -Recurse -Force -Path ${{ github.workspace }}/BinaryCache/* -Destination ${{ github.workspace }}/BuildRoot/ - - name: Update environment variables run: | - $SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Developer/SDKs/Windows.sdk" + $SDKRoot = cygpath -w "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append $ToolchainPath = cygpath -w "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin" @@ -2773,8 +2768,6 @@ jobs: echo "${RTLPath}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - run: | - $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" - Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ @@ -2791,6 +2784,7 @@ jobs: Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + - name: Checkout apple/swift uses: actions/checkout@v4 with: From 1074ebc402ee440de61be890950d7a64a350ae95 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Fri, 26 Jul 2024 16:11:23 -0700 Subject: [PATCH 11/20] GHA: download the SDK to the proper location We would previously download the AMD64 SDK to the wrong location and would thus fail to find the necessary content. Cherry pick commit https://github.com/compnerd/swift-build/commit/e108a13b914eff4b87c538cefca606933432921d --- .github/workflows/swift-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 6b7f9ab30..e60a82195 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -2735,7 +2735,7 @@ jobs: - uses: actions/download-artifact@v4 with: name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BinaryCache + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - name: Download SDK uses: actions/download-artifact@v4 with: From ac0cdf587a695c51b4edfa2599d8c62a05b901ea Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Thu, 1 Aug 2024 09:28:51 -0700 Subject: [PATCH 12/20] fix swift-inspect build * fix swift-inspect build * Use single globbed move-item Cherry pick commit https://github.com/compnerd/swift-build/commit/61ad739531d63fabe840a9e4eb8af467e0c07c20 --- .github/workflows/swift-toolchain.yml | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index e60a82195..d7f94c434 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -2732,10 +2732,6 @@ jobs: with: name: devtools-amd64 path: ${{ github.workspace }}/BuildRoot/Library - - uses: actions/download-artifact@v4 - with: - name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - name: Download SDK uses: actions/download-artifact@v4 with: @@ -2784,6 +2780,36 @@ jobs: Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + # Download host SDK on top of the target SDK, so that the runtime DLLs are the host ones. + - uses: actions/download-artifact@v4 + with: + name: Windows-sdk-amd64 + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform + + - name: Move host libs to the host architecture directory + if: matrix.arch == 'arm64' + run: | + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/ + + - name: Move host runtime DLLs to the runtime binary directory. + run: | + Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/dispatch -Recurse -Force + Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/os -Recurse -Force + Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/Block -Recurse -Force + Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/_foundation_unicode -Recurse -Force + Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/_FoundationCShims -Recurse -Force + + $RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin" + mkdir $RTLPath + Get-ChildItem -Path ${env:SDKROOT}/usr/bin -Filter "*.dll" | Move-Item -Destination $RTLPath - name: Checkout apple/swift uses: actions/checkout@v4 From 83e32da42edc20d79f8e4c986cb7c157efb2ca29 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Tue, 6 Aug 2024 10:32:31 -0700 Subject: [PATCH 13/20] Update android corelibs-foundation pinned checkout * Update android corelibs-foundation pinned checkout The checkout needs to be updated after the posix_filesystem apinote fix landed in Swift. I needed to switch to my own remote as I could no longer push a new branch into the Apple remote. * also update swift-installer script pin Cherry pick commit https://github.com/compnerd/swift-build/commit/c6e86cf57d7e1797e9f0cc74f855010d8cb6c249 --- .github/workflows/swift-toolchain.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index d7f94c434..3c74c8c8d 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -1653,8 +1653,8 @@ jobs: - uses: actions/checkout@v4 if: matrix.os == 'Android' with: - repository: apple/swift-corelibs-foundation - ref: a515f3e15c81d029411c540df7edf52d427ff2cb + repository: hyp/swift-corelibs-foundation + ref: 6bf677693eb23030eb3646c9b121c665f40aa8b0 path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation show-progress: false - uses: actions/checkout@v4 @@ -3128,7 +3128,7 @@ jobs: - uses: actions/checkout@v4 with: repository: apple/swift-installer-scripts - ref: e1adc0d5dde137fa5941316e89a3ed139a273dde + ref: 633843b00fc8024dd86674fe43373ae4fd0f2229 path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false From a79081c417ca506b134829fcb233b75619df7a18 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Wed, 7 Aug 2024 10:27:19 -0700 Subject: [PATCH 14/20] Update default.xml Remove ICU from the checkout. This has been superseded by swift-foundation-icu. Cherry pick commit https://github.com/compnerd/swift-build/commit/5183f3207356090be3e17baf620bc26cdb738043 --- default.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/default.xml b/default.xml index 98ad11acf..9b796cb62 100644 --- a/default.xml +++ b/default.xml @@ -63,6 +63,4 @@ - - From 199b9c83089b8973b0fd724049d0b21002d18a3c Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Mon, 7 Oct 2024 12:25:01 -0700 Subject: [PATCH 15/20] release/6.0 build changes cherry-picks (#823) * Update default.xml Remove ICU from the checkout. This has been superseded by swift-foundation-icu. (cherry picked from commit 5183f3207356090be3e17baf620bc26cdb738043) * Update default.xml Add swift-toolchain-sqlite to the toolchain manifest. (cherry picked from commit 4dc9f92d2e480bf9c00aee9f1ca6c6558d711ac5) * GHA: timestamp the caches Enable the timestamp in the caches to make sure that the correct cache is restored. This should hopefully help increase the cache hit rate. (cherry picked from commit aada331f05e057f06c5ed500bb24688e08eadffa) * repo: update the organisations for migrated repositories Update the organisation for the repositories which have migrated from apple to swiftlang. (cherry picked from commit 73d15011dcffca08091250c125af63fc85bd23ca) * GHA: update workflow for swiftlang/swift#75823 Update to use the new sqlite mirror for the swift toolchain. This ensures that we keep in sync with the official toolchain builds. (cherry picked from commit e6268721752100f4c31f3acfc976efdee0dcc446) * GHA: remove ICU build after the re-core transition Remove the ICU dependency as it has been removed from the repo manifest. This now requires that we use the re-cored Foundation. (cherry picked from commit a5135660b0daa180aac270e49b69aac4a62860bb) * Update default.xml (cherry picked from commit 9f72dc7fad99a44f670e8870875a81090fce860c) * [android] checkout unpinned installer script The pin will no longer be needed since we're switching to swift-foundation (cherry picked from commit b49b33707a95fb5481bcec7b83e9f4e638ee7267) * [GHA workflow] only create a latest release when running on main branch version (cherry picked from commit ea62eb9519532d6c1ce57b777e1aece6bdcf3477) * GHA: update curl version CURL was updated to 8.9.1 upstream. Update the build rules to reflect that. (cherry picked from commit 1b5a7bbd3952af3d672e94b397e97c91053aba6a) * GHA: split out standard library phase Split out the standard library build phase to allow us to build the macros for the correct hosts. This is required to allow us to build the macros for distribution and for the build of the SDK. Co-authored-by: Alex Lorenz (cherry picked from commit 1093ac83d51097c23f62c7d0347a4ca78fec5315) * [sqlite] Remove Android builds These are not consumed by any other step. (cherry picked from commit 1177dfa8ca963b8884fbd84d87e37d633958f99f) * GHA: introduce a new macros build phase Introduce a new macros build phase for the Foundation (and eventually Testing) macros. This depends on the previously introduced stdlib phase as the macros use the standard library. We build the macros for the compiler hosts, reusing them to build the SDK content. Wire this into the packaging step for the build tools as well. Co-authored-by: Alex Lorenz (cherry picked from commit 400fce1228698237cd64b4297e5399c6987bdca4) * [Mac build] Rename builder to a generic name (#797) `windows_build_runner` is too Windows-specific. This renames the variable to `default_build_runner`, to make space for future Darwin builds. The variable is kept to its original name in the `context` step, since this step will eventually also output Darwin variables. (cherry picked from commit e0239e11bf58eee56f2a3c100ca0744281c62d70) * [Mac build] Move build to sub-workflow This is a preliminary step to eventually add the Mac build. The Mac build will be using a separate job with its own matrix. Co-authored-by: Saleem Abdulrasool (cherry picked from commit 0cc87cee2a817d04d9289d232b1415c47178e4af) * GHA: enable HCS on Windows toolchains Now that the just built clang should no longer perform HCS on scoped EH functions, we should be able to enable this optimization globally. (cherry picked from commit d558028e518fd0058a89fea36eee51bf439f5953) * Make runners configurable via workflow input (cherry picked from commit a75c14efe0390f8344e88b6c1a0a4db248de183f) * GHA: tweak some names (NFC) Clean up the job names to be consistent throughout. (cherry picked from commit ecbfb22419037ab0069158646fb6d81e72296c80) * GHA: adjustments for the SDK phase Adjust the paths for the SDK phase, unify the swift-corelibs-foundation checkout. Co-authored-by: Alex Lorenz (cherry picked from commit 876ec4a989947beaa867c226b54d904dfeb93ae3) * GHA: update repositories for swiftlang migration Update the repositories which have migrated to the swiftlang organisation. (cherry picked from commit 2395959a9bd4791cb8ceca0d6fb2f4b4b4b48cc1) * Properly set SQLite version This was broken in #796 (cherry picked from commit 8c02c260e3e54e219baa920e6746f2e6d45e24ef) * GHA: repair the Windows runtime/SDK packaging We now need to download the standard library and the SDK to get the same content that we used to previously have in just the SDK. Adjust that accordingly. (cherry picked from commit b91b97e6e26c605798a6678d7a3af1c3cc3dd38a) * GHA: wire up Foundation macros to swift-corelibs-foundation We are already building the Foundation macros but did not pass that along to the Foundation build. This is now required and failure to pass it along results in a build failure. Wire it up so that we can build and avoid another build of the macros. (cherry picked from commit 04633887a6a9ac44e0ae185290aca8dfc2b1d475) * GHA: setup builds for swift-testing Introduce a build of swift-testing in the SDK as that is now distributed as part of the SDKs upstream. This allows us to have parity with the official builds. (cherry picked from commit 034d28fdbd3d405eb284dde6ad8960de319899da) * Add the workspace hash to ccache key (#811) Depending on the runner configuration, `github.workspace` might be set up differently, resulting in issues when restoring previous builds from sccache. In order to work around this issue, this adds a hash of `github.workspace` to the sccache key to uniquely identify the build between different runner types. (cherry picked from commit 0579aa8cb89ca6645edaddf2e0735048c1dd15ff) * Use runners from vars if available (#812) This was removed in #801 to bring the file in line with downstream. However, it is better to rely on the vars environment when invoking the main workflow from dispatch, while offering an override when invoking the workflow as a sub-workflow. (cherry picked from commit 67bb06c4658157f06e034333426f83504bfe5eb1) * GHA: correct swift-testing macro provider The plugin name is `TestingMacros.dll` not `SwiftTesting.dll`. Correct the spelling for the build. (cherry picked from commit 4ca63bb722976bc6cbfaa1dcec4ee1a0ba3e8e6a) * GHA: specify Swift compile target, C++ compiler, install location Add missing flags for swift-testing configuration. This is primarily the C++ compiler, target triple, and the install location. (cherry picked from commit 921033808c86f02d6ba8611e23d1ff66ca898a4a) * GHA: remove swift-syntax dependency for SDK This is no longer needed as we pre-build the macros and no longer need to match up the swift-syntax build from the toolchain. (cherry picked from commit e6a86827641d2537ce202885cd7aca7ebf65acc7) * GHA: fork swift-testing for Android fixes Pull the future main branch for Android fixes. (cherry picked from commit 8336d102a9885ac5bcf2c063d326a88e8ac42eec) * GHA: restructure devtools build Setup `SDKROOT` environment variable rather than inlining that at each site. This greatly simplifies the CMake invocation. Additionally, extract prebuilt content into `BinaryCache` rather than `BuildRoot` which allows us to easily isolate the built artifacts for upload. (cherry picked from commit 105a9e43f204b38d4285e7c30fe749b66a14404a) * GHA: add a workaround for old Swift driver workaround the issue with missing new swift driver when building swift testing for android by disabling CMP0157. (cherry picked from commit 0b18205342ae4073067c5e091f6e96092a7bc1e9) * GHA: download additional images when packaging Pull in the Android stdlib when building Android installer MSI. (cherry picked from commit 3f2b15dea4880df2b2effc6f10b9f628f3956932) * Fix devtools stage (#815) * build with explicit -sdk passed into Swift * The SDKROOT environment variable isn't enough when using the old driver * checkout latest swift testing * pass c++ flags and c++ compiler for the markdown build * download devtools host sdk after the target libs are setup correctly * fix cmark path * debugging tools: download stdlib as well (cherry picked from commit 6ba7e5f93369864bc25b1312702a3b9a8ca3e503) --------- Co-authored-by: Saleem Abdulrasool Co-authored-by: Fabrice de Gans Co-authored-by: Fabrice de Gans Co-authored-by: Saleem Abdulrasool --- .github/workflows/build-toolchain.yml | 395 ++++ .github/workflows/swift-toolchain.yml | 2557 +++++++++++++------------ cmake/SQLite/CMakeLists.txt | 23 - default.xml | 47 +- 4 files changed, 1785 insertions(+), 1237 deletions(-) create mode 100644 .github/workflows/build-toolchain.yml delete mode 100644 cmake/SQLite/CMakeLists.txt diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml new file mode 100644 index 000000000..dbe47fb87 --- /dev/null +++ b/.github/workflows/build-toolchain.yml @@ -0,0 +1,395 @@ +name: Development Snapshot + +on: + workflow_dispatch: + inputs: + swift_version: + description: 'Swift Version' + default: '6.0.0' + required: false + type: string + + android_api_level: + description: 'Android API Level' + default: 28 + required: false + type: number + + swift_tag: + description: 'Swift Build Tag' + required: false + type: string + + debug_info: + description: 'Emit PDBs (Debug Info)' + default: false + type: boolean + + signed: + description: 'Code Sign' + default: false + type: boolean + + create_release: + description: 'Create Release' + type: boolean + default: true + required: false + + workflow_call: + inputs: + swift_version: + description: 'Swift Version' + default: '0.0.0' + required: false + type: string + + android_api_level: + description: 'Android API Level' + default: 28 + required: false + type: number + + swift_tag: + description: 'Swift Build Tag' + required: false + type: string + + debug_info: + description: 'Emit PDBs (Debug Info)' + default: true + type: boolean + + signed: + description: 'Code Sign' + default: false + type: boolean + + create_release: + description: 'Create Release' + type: boolean + default: true + required: false + + windows_default_runner: + description: 'Build runner' + required: false + type: string + + windows_compilers_runner: + description: 'Build runner for `compilers` job' + type: string + required: false + + secrets: + SYMBOL_SERVER_PAT: + required: true + CERTIFICATE: + required: true + PASSPHRASE: + required: true + +env: + SCCACHE_DIRECT: yes + +jobs: + context: + runs-on: ubuntu-latest + outputs: + curl_revision: ${{ steps.context.outputs.curl_revision }} + indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }} + libxml2_revision: ${{ steps.context.outputs.libxml2_revision }} + llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }} + sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }} + swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }} + swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }} + swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }} + swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }} + swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }} + swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }} + swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }} + swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }} + swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }} + swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }} + swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} + swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} + swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} + swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }} + swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }} + swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} + swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} + swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} + swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }} + swift_revision: ${{ steps.context.outputs.swift_revision }} + swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }} + swift_system_revision: ${{ steps.context.outputs.swift_system_revision }} + swift_testing_revision: ${{ steps.context.outputs.swift_testing_revision }} + swift_toolchain_sqlite_revision: ${{ steps.context.outputs.swift_toolchain_sqlite_revision }} + swift_toolchain_sqlite_version: ${{ steps.context.outputs.swift_toolchain_sqlite_version }} + swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }} + yams_revision: ${{ steps.context.outputs.yams_revision }} + zlib_revision: ${{ steps.context.outputs.zlib_revision }} + ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }} + WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} + ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }} + ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} + ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} + CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }} + debug_info: ${{ steps.context.outputs.debug_info }} + signed: ${{ steps.context.outputs.signed }} + swift_version: ${{ steps.context.outputs.swift_version }} + swift_tag: ${{ steps.context.outputs.swift_tag }} + windows_build_runner: ${{ steps.context.outputs.windows_build_runner }} + compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }} + steps: + - id: context + name: Generate Build Context + run: | + # TODO(compnerd) can we make this more silent? + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils + + # Which branch is this workflow based on + branch_version_string=${{ inputs.swift_version || '0.0.0' }} + if [[ $branch_version_string == *.* ]]; then + branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }') + else + branch_name="release/$branch_version_string" + fi + + repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name + repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all) + + if [[ "${{ inputs.swift_tag }}" != "" ]] ; then + tee -a "${GITHUB_OUTPUT}" <<-EOF + indexstore_db_revision=refs/tags/${{ inputs.swift_tag }} + llvm_project_revision=refs/tags/${{ inputs.swift_tag }} + sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }} + swift_revision=refs/tags/${{ inputs.swift_tag }} + swift_argument_parser_revision=refs/tags/1.4.0 + swift_asn1_revision=refs/tags/0.7.0 + swift_atomics_revision=refs/tags/1.2.0 + swift_certificates_revision=refs/tags/0.1.0 + swift_cmark_revision=refs/tags/${{ inputs.swift_tag }} + swift_collections_revision=refs/tags/1.1.2 + swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }} + swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }} + swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }} + swift_crypto_revision=refs/tags/3.0.0 + swift_driver_revision=refs/tags/${{ inputs.swift_tag }} + swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} + swift_format_revision=refs/heads/main + swift_foundation_revison=refs/heads/main + swift_foundation_icu_revision=refs/tags/0.0.8 + swift_installer_scripts_revision=refs/heads/main + swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} + swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} + swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }} + swift_syntax_revision=refs/tags/${{ inputs.swift_tag }} + swift_system_revision=refs/tags/1.3.0 + swift_testing_revision=refs/heads/main + swift_toolchain_sqlite_revision=refs/tags/main + swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }} + curl_revision=refs/tags/curl-8_5_0 + libxml2_revision=refs/tags/v2.11.5 + yams_revision=refs/tags/5.0.6 + zlib_revision=refs/tags/v1.3.1 + EOF + else + repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \ + xmllint --xpath "//project/@name | //project/@revision" - | \ + xargs -n2 | \ + awk -F'[= ]' '{ + split($2, repo, "/"); + gsub(/-/, "_", repo[2]); + print tolower(repo[2]) "_revision=" $4 + }' | tee -a "${GITHUB_OUTPUT}" + repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml + fi + + echo swift_toolchain_sqlite_version=3.46.0 >> ${GITHUB_OUTPUT} + + # FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1. + # see: https://github.com/actions/runner-images/issues/10004 + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then + echo debug_info=true >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} + echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} + else + echo debug_info=false >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} + fi + echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} + + if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then + # FIXME(compnerd) enable this when requested + echo signed=false >> ${GITHUB_OUTPUT} + else + echo signed=false >> ${GITHUB_OUTPUT} + fi + + echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT} + if [[ -n "${{ inputs.swift_tag }}" ]] ; then + echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} + else + if [[ "$branch_name" == "main" ]] ; then + echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} + else + echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} + fi + fi + + echo windows_build_runner=${{ inputs.windows_default_runner || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} + echo compilers_build_runner=${{ inputs.windows_compilers_runner || inputs.windows_default_runner || vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} + + echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT} + + - uses: actions/upload-artifact@v4 + with: + name: stable.xml + path: stable.xml + if-no-files-found: ignore + + windows-build: + needs: [context] + name: Windows Swift Toolchains Build + uses: ./.github/workflows/swift-toolchain.yml + with: + curl_revision: ${{ needs.context.outputs.curl_revision }} + indexstore_db_revision: ${{ needs.context.outputs.indexstore_db_revision }} + libxml2_revision: ${{ needs.context.outputs.libxml2_revision }} + llvm_project_revision: ${{ needs.context.outputs.llvm_project_revision }} + sourcekit_lsp_revision: ${{ needs.context.outputs.sourcekit_lsp_revision }} + swift_argument_parser_revision: ${{ needs.context.outputs.swift_argument_parser_revision }} + swift_asn1_revision: ${{ needs.context.outputs.swift_asn1_revision }} + swift_atomics_revision: ${{ needs.context.outputs.swift_atomics_revision }} + swift_certificates_revision: ${{ needs.context.outputs.swift_certificates_revision }} + swift_cmark_revision: ${{ needs.context.outputs.swift_cmark_revision }} + swift_collections_revision: ${{ needs.context.outputs.swift_collections_revision }} + swift_corelibs_foundation_revision: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} + swift_corelibs_libdispatch_revision: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} + swift_corelibs_xctest_revision: ${{ needs.context.outputs.swift_corelibs_xctest_revision }} + swift_crypto_revision: ${{ needs.context.outputs.swift_crypto_revision }} + swift_driver_revision: ${{ needs.context.outputs.swift_driver_revision }} + swift_experimental_string_processing_revision: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} + swift_format_revision: ${{ needs.context.outputs.swift_format_revision }} + swift_foundation_revision: ${{ needs.context.outputs.swift_foundation_revision }} + swift_foundation_icu_revision: ${{ needs.context.outputs.swift_foundation_icu_revision }} + swift_installer_scripts_revision: ${{ needs.context.outputs.swift_installer_scripts_revision }} + swift_llbuild_revision: ${{ needs.context.outputs.swift_llbuild_revision }} + swift_markdown_revision: ${{ needs.context.outputs.swift_markdown_revision }} + swift_package_manager_revision: ${{ needs.context.outputs.swift_package_manager_revision }} + swift_revision: ${{ needs.context.outputs.swift_revision }} + swift_syntax_revision: ${{ needs.context.outputs.swift_syntax_revision }} + swift_system_revision: ${{ needs.context.outputs.swift_system_revision }} + swift_testing_revision: ${{ needs.context.outputs.swift_testing_revision }} + swift_toolchain_sqlite_revision: ${{ needs.context.outputs.swift_toolchain_sqlite_revision }} + swift_toolchain_sqlite_version: ${{ needs.context.outputs.swift_toolchain_sqlite_version }} + swift_tools_support_core_revision: ${{ needs.context.outputs.swift_tools_support_core_revision }} + yams_revision: ${{ needs.context.outputs.yams_revision }} + zlib_revision: ${{ needs.context.outputs.zlib_revision }} + ANDROID_API_LEVEL: ${{ needs.context.outputs.ANDROID_API_LEVEL }} + WINDOWS_CMAKE_C_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + WINDOWS_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} + ANDROID_CMAKE_C_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} + ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} + CMAKE_Swift_FLAGS: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + debug_info: ${{ needs.context.outputs.debug_info }} + signed: ${{ needs.context.outputs.signed }} + swift_version: ${{ needs.context.outputs.swift_version }} + swift_tag: ${{ needs.context.outputs.swift_tag }} + default_build_runner: ${{ needs.context.outputs.windows_build_runner }} + compilers_build_runner: ${{ needs.context.outputs.compilers_build_runner }} + secrets: + SYMBOL_SERVER_PAT: ${{ secrets.SYMBOL_SERVER_PAT }} + CERTIFICATE: ${{ secrets.CERTIFICATE }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} + + snapshot: + runs-on: ubuntu-latest + needs: [context, windows-build] + if: github.event_name == 'schedule' + steps: + - uses: actions/checkout@v4 + with: + ref: release/6.0 + show-progress: false + + - uses: actions/download-artifact@v4 + with: + name: stable.xml + + - run: | + git config --global user.name 'github-action[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + if ! git diff --exit-code ; then + git add stable.xml + git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" + git push origin HEAD:release/6.0 + fi + + release: + runs-on: ubuntu-latest + needs: [context, windows-build] + if: inputs.create_release == true + steps: + - uses: actions/download-artifact@v4 + with: + name: installer-amd64 + path: ${{ github.workspace }}/tmp/amd64 + + - uses: actions/download-artifact@v4 + with: + name: installer-arm64 + path: ${{ github.workspace }}/tmp/arm64 + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + branch_version_string=${{ inputs.swift_version || '0.0.0' }} + if [[ $branch_version_string == "0.0.0" ]]; then + latest="true" + else + latest="false" + fi + # Create Release + gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} --latest=${latest} + + # AMD64 + cd ${{ github.workspace }}/tmp/amd64 + + mv installer.exe installer-amd64.exe + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }} + + shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256 + gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }} + + # ARM64 + cd ${{ github.workspace }}/tmp/arm64 + + mv installer.exe installer-arm64.exe + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }} + + shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256 + gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }} diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 3c74c8c8d..e66d6661c 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -1,75 +1,204 @@ -name: swift-toolchain +name: Swift Toolchain Build on: - workflow_dispatch: + workflow_call: inputs: - swift_version: - description: 'Swift Version' - default: '6.0.0' - required: false + curl_revision: + required: true type: string - android_api_level: - description: 'Android API Level' - default: 28 - required: false - type: number + indexstore_db_revision: + required: true + type: string - swift_tag: - description: 'Swift Build Tag' - required: false + libxml2_revision: + required: true type: string - debug_info: - description: 'Emit PDBs (Debug Info)' - default: false - type: boolean + llvm_project_revision: + required: true + type: string - signed: - description: 'Code Sign' - default: false - type: boolean + sourcekit_lsp_revision: + required: true + type: string - create_release: - description: 'Create Release' - type: boolean - default: true - required: false + swift_argument_parser_revision: + required: true + type: string - workflow_call: - inputs: - swift_version: - description: 'Swift Version' - default: '0.0.0' - required: false + swift_asn1_revision: + required: true type: string - android_api_level: - description: 'Android API Level' - default: 28 - required: false - type: number + swift_atomics_revision: + required: true + type: string - swift_tag: - description: 'Swift Build Tag' - required: false + swift_certificates_revision: + required: true + type: string + + swift_cmark_revision: + required: true + type: string + + swift_collections_revision: + required: true + type: string + + swift_corelibs_foundation_revision: + required: true + type: string + + swift_corelibs_libdispatch_revision: + required: true + type: string + + swift_corelibs_xctest_revision: + required: true + type: string + + swift_crypto_revision: + required: true + type: string + + swift_driver_revision: + required: true + type: string + + swift_experimental_string_processing_revision: + required: true + type: string + + swift_format_revision: + required: true + type: string + + swift_foundation_revision: + required: true + type: string + + swift_foundation_icu_revision: + required: true + type: string + + swift_installer_scripts_revision: + required: true + type: string + + swift_llbuild_revision: + required: true + type: string + + swift_markdown_revision: + required: true + type: string + + swift_package_manager_revision: + required: true + type: string + + swift_revision: + required: true + type: string + + swift_syntax_revision: + required: true + type: string + + swift_system_revision: + required: true + type: string + + swift_testing_revision: + required: true + type: string + + swift_toolchain_sqlite_revision: + required: true + type: string + + swift_toolchain_sqlite_version: + required: true + type: string + + swift_tools_support_core_revision: + required: true + type: string + + yams_revision: + required: true + type: string + + zlib_revision: + required: true + type: string + + ANDROID_API_LEVEL: + required: true + type: string + + WINDOWS_CMAKE_C_FLAGS: + required: true + type: string + + WINDOWS_CMAKE_CXX_FLAGS: + required: true + type: string + + WINDOWS_CMAKE_EXE_LINKER_FLAGS: + required: true + type: string + + WINDOWS_CMAKE_SHARED_LINKER_FLAGS: + required: true + type: string + + ANDROID_CMAKE_C_FLAGS: + required: true + type: string + + ANDROID_CMAKE_CXX_FLAGS: + required: true + type: string + + ANDROID_CMAKE_EXE_LINKER_FLAGS: + required: true + type: string + + ANDROID_CMAKE_SHARED_LINKER_FLAGS: + required: true + type: string + + CMAKE_Swift_FLAGS: + required: true type: string debug_info: - description: 'Emit PDBs (Debug Info)' - default: true - type: boolean + required: true + type: string signed: - description: 'Code Sign' - default: false - type: boolean + required: true + type: string + + swift_version: + required: true + type: string + + swift_tag: + required: true + type: string + + default_build_runner: + required: true + type: string + + compilers_build_runner: + required: true + type: string - create_release: - description: 'Create Release' - type: boolean - default: true - required: false secrets: SYMBOL_SERVER_PAT: @@ -83,177 +212,8 @@ env: SCCACHE_DIRECT: yes jobs: - context: - runs-on: ubuntu-latest - outputs: - curl_revision: ${{ steps.context.outputs.curl_revision }} - icu_revision: ${{ steps.context.outputs.icu_revision }} - indexstore_db_revision: ${{ steps.context.outputs.indexstore_db_revision }} - libxml2_revision: ${{ steps.context.outputs.libxml2_revision }} - llvm_project_revision: ${{ steps.context.outputs.llvm_project_revision }} - sourcekit_lsp_revision: ${{ steps.context.outputs.sourcekit_lsp_revision }} - swift_argument_parser_revision: ${{ steps.context.outputs.swift_argument_parser_revision }} - swift_asn1_revision: ${{ steps.context.outputs.swift_asn1_revision }} - swift_atomics_revision: ${{ steps.context.outputs.swift_atomics_revision }} - swift_certificates_revision: ${{ steps.context.outputs.swift_certificates_revision }} - swift_cmark_revision: ${{ steps.context.outputs.swift_cmark_revision }} - swift_collections_revision: ${{ steps.context.outputs.swift_collections_revision }} - swift_corelibs_foundation_revision: ${{ steps.context.outputs.swift_corelibs_foundation_revision }} - swift_corelibs_libdispatch_revision: ${{ steps.context.outputs.swift_corelibs_libdispatch_revision }} - swift_corelibs_xctest_revision: ${{ steps.context.outputs.swift_corelibs_xctest_revision }} - swift_crypto_revision: ${{ steps.context.outputs.swift_crypto_revision }} - swift_driver_revision: ${{ steps.context.outputs.swift_driver_revision }} - swift_experimental_string_processing_revision: ${{ steps.context.outputs.swift_experimental_string_processing_revision }} - swift_format_revision: ${{ steps.context.outputs.swift_format_revision }} - swift_foundation_revision: ${{ steps.context.outputs.swift_foundation_revision }} - swift_foundation_icu_revision: ${{ steps.context.outputs.swift_foundation_icu_revision }} - swift_installer_scripts_revision: ${{ steps.context.outputs.swift_installer_scripts_revision }} - swift_llbuild_revision: ${{ steps.context.outputs.swift_llbuild_revision }} - swift_markdown_revision: ${{ steps.context.outputs.swift_markdown_revision }} - swift_package_manager_revision: ${{ steps.context.outputs.swift_package_manager_revision }} - swift_revision: ${{ steps.context.outputs.swift_revision }} - swift_syntax_revision: ${{ steps.context.outputs.swift_syntax_revision }} - swift_system_revision: ${{ steps.context.outputs.swift_system_revision }} - swift_tools_support_core_revision: ${{ steps.context.outputs.swift_tools_support_core_revision }} - yams_revision: ${{ steps.context.outputs.yams_revision }} - zlib_revision: ${{ steps.context.outputs.zlib_revision }} - ANDROID_API_LEVEL: ${{ steps.context.outputs.ANDROID_API_LEVEL }} - WINDOWS_CMAKE_C_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - WINDOWS_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - WINDOWS_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }} - WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }} - ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }} - ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }} - ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }} - CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }} - debug_info: ${{ steps.context.outputs.debug_info }} - signed: ${{ steps.context.outputs.signed }} - swift_version: ${{ steps.context.outputs.swift_version }} - swift_tag: ${{ steps.context.outputs.swift_tag }} - windows_build_runner: ${{ steps.context.outputs.windows_build_runner }} - compilers_build_runner: ${{ steps.context.outputs.compilers_build_runner }} - steps: - - id: context - name: Generate Build Context - run: | - # TODO(compnerd) can we make this more silent? - sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -yq - sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils - - # Which branch is this workflow based on - branch_version_string=${{ inputs.swift_version || '0.0.0' }} - if [[ $branch_version_string == *.* ]]; then - branch_name=$(echo ${branch_version_string} | awk -F. '{ ver=$1"."$2; print (ver == "0.0") ? "main" : "release/"ver }') - else - branch_name="release/$branch_version_string" - fi - - repo init --quiet --groups default --depth 1 -u https://github.com/compnerd/swift-build -b $branch_name - repo sync --quiet --no-clone-bundle --no-tags --jobs $(nproc --all) - - if [[ "${{ inputs.swift_tag }}" != "" ]] ; then - tee -a "${GITHUB_OUTPUT}" <<-EOF - indexstore_db_revision=refs/tags/${{ inputs.swift_tag }} - llvm_project_revision=refs/tags/${{ inputs.swift_tag }} - sourcekit_lsp_revision=refs/tags/${{ inputs.swift_tag }} - swift_revision=refs/tags/${{ inputs.swift_tag }} - swift_argument_parser_revision=refs/tags/1.4.0 - swift_asn1_revision=refs/tags/0.7.0 - swift_atomics_revision=refs/tags/1.2.0 - swift_certificates_revision=refs/tags/0.1.0 - swift_cmark_revision=refs/tags/${{ inputs.swift_tag }} - swift_collections_revision=refs/tags/1.1.2 - swift_corelibs_foundation_revision=refs/tags/${{ inputs.swift_tag }} - swift_corelibs_libdispatch_revision=refs/tags/${{ inputs.swift_tag }} - swift_corelibs_xctest_revision=refs/tags/${{ inputs.swift_tag }} - swift_crypto_revision=refs/tags/3.0.0 - swift_driver_revision=refs/tags/${{ inputs.swift_tag }} - swift_experimental_string_processing_revision=refs/tags/${{ inputs.swift_tag }} - swift_format_revision=refs/heads/main - swift_foundation_revison=refs/heads/main - swift_foundation_icu_revision=refs/tags/0.0.8 - swift_installer_scripts_revision=refs/heads/main - swift_llbuild_revision=refs/tags/${{ inputs.swift_tag }} - swift_markdown_revision=refs/tags/${{ inputs.swift_tag }} - swift_package_manager_revision=refs/tags/${{ inputs.swift_tag }} - swift_syntax_revision=refs/tags/${{ inputs.swift_tag }} - swift_system_revision=refs/tags/1.3.0 - swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }} - curl_revision=refs/tags/curl-8_5_0 - libxml2_revision=refs/tags/v2.11.5 - yams_revision=refs/tags/5.0.6 - zlib_revision=refs/tags/v1.3.1 - icu_revision=refs/heads/maint/maint-69 - EOF - else - repo manifest -r --suppress-upstream-revision --suppress-dest-branch | \ - xmllint --xpath "//project/@name | //project/@revision" - | \ - xargs -n2 | \ - awk -F'[= ]' '{ - split($2, repo, "/"); - gsub(/-/, "_", repo[2]); - print tolower(repo[2]) "_revision=" $4 - }' | tee -a "${GITHUB_OUTPUT}" - repo manifest -r --suppress-upstream-revision --suppress-dest-branch -o - | sed -E 's,[[:space:]]+$,,' > stable.xml - fi - - # FIXME(z2oh): Remove /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR when GitHub runner image updates to 20240610.1. - # see: https://github.com/actions/runner-images/issues/10004 - if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then - echo debug_info=true >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT} - echo CMAKE_Swift_FLAGS="-g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} - else - echo debug_info=false >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo WINDOWS_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT} - fi - echo ANDROID_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - echo ANDROID_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT} - - if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.signed }}" == "true" ]]; then - # FIXME(compnerd) enable this when requested - echo signed=false >> ${GITHUB_OUTPUT} - else - echo signed=false >> ${GITHUB_OUTPUT} - fi - - echo swift_version=${{ inputs.swift_version || '0.0.0' }} | tee -a ${GITHUB_OUTPUT} - if [[ -n "${{ inputs.swift_tag }}" ]] ; then - echo swift_tag=${{ inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} - else - if [[ "$branch_name" == "main" ]] ; then - echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} - else - echo swift_tag=swift-"$branch_version_string"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} - fi - fi - - echo windows_build_runner=${{ vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} - echo compilers_build_runner=${{ vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT} - - echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT} - - - uses: actions/upload-artifact@v4 - with: - name: stable.xml - path: stable.xml - if-no-files-found: ignore - sqlite: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -261,59 +221,17 @@ jobs: include: - arch: amd64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows - extra_flags: - arch: arm64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 name: ${{ matrix.os }} ${{ matrix.arch }} SQLite3 @@ -323,14 +241,12 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-build show-progress: false - - name: download sqlite - run: | - curl.exe -sL "https://sqlite.org/2023/sqlite-amalgamation-3430200.zip" -o $env:TEMP\sqlite-amalgamation-3430200.zip - New-Item -ItemType Directory -Path ${{ github.workspace }}\SourceCache\sqlite-3.43.2 - unzip.exe -j -o $env:TEMP\sqlite-amalgamation-3430200.zip -d ${{ github.workspace }}\SourceCache\sqlite-3.43.2 - - - name: Copy CMakeLists.txt - run: Copy-Item ${{ github.workspace }}\SourceCache\swift-build\cmake\SQLite\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\sqlite-3.43.2\CMakeLists.txt + - uses: actions/checkout@v4 + with: + repository: swiftlang/swift-toolchain-sqlite + ref: ${{ inputs.swift_toolchain_sqlite_revision }} + path: ${{ github.workspace }}/SourceCache/swift-toolchain-sqlite + show-progress: false - uses: compnerd/gha-setup-vsdevenv@main with: @@ -338,23 +254,28 @@ jobs: components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-sqlite + key: ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-sqlite variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - name: Configure SQLite run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 ` + cmake -B ${{ github.workspace }}/BinaryCache/sqlite-${{ inputs.swift_toolchain_sqlite_version }} ` -D BUILD_SHARED_LIBS=NO ` -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${{ matrix.cc }} ` @@ -364,311 +285,134 @@ jobs: -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - ${{ matrix.extra_flags }} ` -G Ninja ` - -S ${{ github.workspace }}/SourceCache/sqlite-3.43.2 + -S ${{ github.workspace }}/SourceCache/swift-toolchain-sqlite - name: Build SQLite - run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 + run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-${{ inputs.swift_toolchain_sqlite_version }} - name: Install SQLite - run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 --target install + run: cmake --build ${{ github.workspace }}/BinaryCache/sqlite-${{ inputs.swift_toolchain_sqlite_version }} --target install - uses: actions/upload-artifact@v4 with: - name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-3.43.2 - path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr + name: sqlite-${{ matrix.os }}-${{ matrix.arch }}-${{ inputs.swift_toolchain_sqlite_version }} + path: ${{ github.workspace }}/BuildRoot/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr + + cmark_gfm: + runs-on: ${{ inputs.default_build_runner }} - # TODO(compnerd): remove this once android migrates to swift-foundation - icu_tools: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + strategy: + fail-fast: false + matrix: + arch: ['amd64', 'arm64'] - steps: - - uses: actions/checkout@v4 - with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false + name: Windows ${{ matrix.arch }} CMark GFM + steps: - uses: actions/checkout@v4 with: - repository: unicode-org/icu - ref: ${{ needs.context.outputs.icu_revision }} - path: ${{ github.workspace }}/SourceCache/icu + repository: swiftlang/swift-cmark + ref: ${{ inputs.swift_cmark_revision }} + path: ${{ github.workspace }}/SourceCache/cmark-gfm show-progress: false - - name: Copy CMakeLists.txt - run: Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt - - uses: compnerd/gha-setup-vsdevenv@main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: amd64 + arch: ${{ matrix.arch }} + + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: - max-size: 100M - key: windows-amd64-icu_tools + max-size: 1M + key: ${{ steps.workspace_hash.outputs.hash }}-windows-${{ matrix.arch }}-cmark-gfm variant: sccache - append-timestamp: false - - name: Configure ICU Build Tools - run: - cmake -B ${{ github.workspace }}/BinaryCache/icu-tools-69.1 ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TOOLS=YES ` + - name: Configure cmark-gfm + run: > + cmake -B ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 ` + -D BUILD_SHARED_LIBS=YES ` + -D BUILD_TESTING=NO ` -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_COMPILER_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/icu/icu4c - - - name: Build ICU Tools - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-tools-69.1 - + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr ` + -D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES ` + -S ${{ github.workspace }}/SourceCache/cmark-gfm ` + -G Ninja + - name: Build cmark-gfm + run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 + - name: Install cmark-gfm + run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 --target install - uses: actions/upload-artifact@v4 with: - name: icu-tools-69.1 - path: | - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genbrk.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencfu.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gencnval.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gendict.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genrb.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/gensprep.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/icupkg.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/makeconv.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/pkgdata.exe - ${{ github.workspace }}/BinaryCache/icu-tools-69.1/genccode.exe - - # TODO(compnerd): remove this once android migrates to swift-foundation - icu: - needs: [context, icu_tools] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - include: - - arch: arm64 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - - - arch: armv7 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - - - arch: i686 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - arch: x86_64 - BUILD_TOOLS: NO - BUILD_DATA: NO - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + build_tools: + needs: [cmark_gfm] + runs-on: ${{ inputs.default_build_runner }} - name: ${{ matrix.os }} ${{ matrix.arch }} ICU + name: Windows amd64 Compiler Build Tools steps: - uses: actions/download-artifact@v4 with: - name: icu-tools-69.1 - path: ${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - uses: actions/checkout@v4 with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} - path: ${{ github.workspace }}/SourceCache/swift-installer-scripts - show-progress: false - - - uses: actions/checkout@v4 - with: - repository: unicode-org/icu - ref: ${{ needs.context.outputs.icu_revision }} - path: ${{ github.workspace }}/SourceCache/icu - show-progress: false - - - name: Copy CMakeLists.txt - run: | - Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\CMakeLists.txt -destination ${{ github.workspace }}\SourceCache\icu\icu4c\CMakeLists.txt - Copy-Item ${{ github.workspace }}\SourceCache\swift-installer-scripts\shared\ICU\icupkg.inc.cmake -destination ${{ github.workspace }}\SourceCache\icu\icu4c\icupkg.inc.cmake - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 200M - key: ${{ matrix.os }}-${{ matrix.arch }}-icu - variant: sccache - append-timestamp: false - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b - - - name: Configure ICU - run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/icu-69.1 ` - -D BUILD_SHARED_LIBS=NO ` - -D BUILD_TOOLS=${{ matrix.BUILD_TOOLS }} ` - -D BUILD_DATA=${{ matrix.BUILD_DATA }} ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D ICU_TOOLS_DIR=${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - ${{ matrix.extra_flags }} ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/icu/icu4c - - name: Build ICU - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 - - name: Install ICU - run: cmake --build ${{ github.workspace }}/BinaryCache/icu-69.1 --target install - - - uses: actions/upload-artifact@v4 - with: - name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 - path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr - - cmark_gfm: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - strategy: - fail-fast: false - matrix: - arch: ['amd64', 'arm64'] - - steps: - - uses: actions/checkout@v4 - with: - repository: apple/swift-cmark - ref: ${{ needs.context.outputs.swift_cmark_revision }} - path: ${{ github.workspace }}/SourceCache/cmark-gfm - show-progress: false - - - uses: compnerd/gha-setup-vsdevenv@main - with: - host_arch: amd64 - components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' - arch: ${{ matrix.arch }} - - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 1M - key: windows-${{ matrix.arch }}-cmark-gfm - variant: sccache - append-timestamp: false - - - name: Configure cmark-gfm - run: > - cmake -B ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 ` - -D BUILD_SHARED_LIBS=YES ` - -D BUILD_TESTING=NO ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=cl ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_COMPILER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` - -D CMAKE_CXX_COMPILER=cl ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr ` - -D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=YES ` - -S ${{ github.workspace }}/SourceCache/cmark-gfm ` - -G Ninja - - name: Build cmark-gfm - run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 - - name: Install cmark-gfm - run: cmake --build ${{ github.workspace }}/BinaryCache/cmark-gfm-0.29.0.gfm.13 --target install - - uses: actions/upload-artifact@v4 - with: - name: cmark-gfm-${{ matrix.arch }}-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - build_tools: - needs: [context, cmark_gfm] - runs-on: ${{ needs.context.outputs.windows_build_runner }} - - steps: - - uses: actions/download-artifact@v4 - with: - name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr - - - uses: actions/checkout@v4 - with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} + repository: swiftlang/llvm-project + ref: ${{ inputs.llvm_project_revision }} path: ${{ github.workspace }}/SourceCache/llvm-project show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} path: ${{ github.workspace }}/SourceCache/swift show-progress: false - uses: compnerd/gha-setup-vsdevenv@main + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: max-size: 100M - key: windows-amd64-build_tools + key: ${{ steps.workspace_hash.outputs.hash }}-windows-amd64-build_tools variant: sccache - append-timestamp: false - name: Configure Tools run: | @@ -676,10 +420,10 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` -G Ninja ` @@ -741,8 +485,8 @@ jobs: ${{ github.workspace }}/BinaryCache/0/bin/swift-compatibility-symbols.exe compilers: - needs: [context, build_tools, cmark_gfm] - runs-on: ${{ needs.context.outputs.compilers_build_runner }} + needs: [build_tools, cmark_gfm] + runs-on: ${{ inputs.compilers_build_runner }} env: # Must be a full version string from https://www.nuget.org/packages/pythonarm64 @@ -760,6 +504,8 @@ jobs: cpu: 'aarch64' triple: 'aarch64-unknown-windows-msvc' + name: Windows ${{ matrix.arch }} Toolchain + steps: - uses: actions/download-artifact@v4 with: @@ -772,32 +518,32 @@ jobs: - uses: actions/checkout@v4 with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} + repository: swiftlang/llvm-project + ref: ${{ inputs.llvm_project_revision }} path: ${{ github.workspace }}/SourceCache/llvm-project show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} path: ${{ github.workspace }}/SourceCache/swift show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-experimental-string-processing - ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} + repository: swiftlang/swift-experimental-string-processing + ref: ${{ inputs.swift_experimental_string_processing_revision }} path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-syntax - ref: ${{ needs.context.outputs.swift_syntax_revision }} + repository: swiftlang/swift-syntax + ref: ${{ inputs.swift_syntax_revision }} path: ${{ github.workspace }}/SourceCache/swift-syntax show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-corelibs-libdispatch - ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} + ref: ${{ inputs.swift_corelibs_libdispatch_revision }} path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch show-progress: false @@ -844,13 +590,24 @@ jobs: with: ndk-version: r26b + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: max-size: 500M - key: windows-${{ matrix.arch }}-compilers + key: ${{ steps.workspace_hash.outputs.hash }}-windows-${{ matrix.arch }}-compilers variant: sccache - append-timestamp: false - name: Configure Compilers env: @@ -876,17 +633,17 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` -D CMAKE_MT=mt ` -D CMAKE_Swift_COMPILER="${SWIFTC}" ` -D CMAKE_Swift_COMPILER_WORKS=YES ` -D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` - -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` + -D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` - -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" ` + -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" ` ${CMAKE_SYSTEM_NAME} ` ${CMAKE_SYSTEM_PROCESSOR} ` -G Ninja ` @@ -965,7 +722,7 @@ jobs: # TODO(compnerd) this takes ~1h due to the size, see if we can compress first - uses: actions/upload-artifact@v4 - if: false # ${{ needs.context.outputs.debug_info }} + if: false # ${{ inputs.debug_info }} with: name: compilers-${{ matrix.arch }}-debug-info path: | @@ -973,7 +730,7 @@ jobs: - name: Upload PDBs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -982,7 +739,7 @@ jobs: - name: Upload DLLs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -991,7 +748,7 @@ jobs: - name: Upload EXEs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -999,8 +756,7 @@ jobs: searchPattern: '**/*.exe' zlib: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -1008,59 +764,59 @@ jobs: include: - arch: amd64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: arm64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: x86 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: arm64 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - arch: armv7 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - arch: i686 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - arch: x86_64 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 name: ${{ matrix.os }} ${{ matrix.arch }} zlib @@ -1068,7 +824,7 @@ jobs: - uses: actions/checkout@v4 with: repository: madler/zlib - ref: ${{ needs.context.outputs.zlib_revision }} + ref: ${{ inputs.zlib_revision }} path: ${{ github.workspace }}/SourceCache/zlib show-progress: false @@ -1078,13 +834,24 @@ jobs: components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-zlib + key: ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-zlib variant: sccache - append-timestamp: false - uses: nttld/setup-ndk@v1 id: setup-ndk @@ -1123,8 +890,8 @@ jobs: path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr curl: - needs: [context, zlib] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [zlib] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -1132,59 +899,59 @@ jobs: include: - arch: amd64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: arm64 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: x86 cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} os: Windows extra_flags: - arch: arm64 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - arch: armv7 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - arch: i686 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - arch: x86_64 cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 name: ${{ matrix.os }} ${{ matrix.arch }} curl @@ -1192,7 +959,7 @@ jobs: - uses: actions/checkout@v4 with: repository: curl/curl - ref: ${{ needs.context.outputs.curl_revision }} + ref: ${{ inputs.curl_revision }} path: ${{ github.workspace }}/SourceCache/curl show-progress: false @@ -1207,13 +974,24 @@ jobs: components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + - name: Setup sccache uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 with: max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-curl + key: ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-curl variant: sccache - append-timestamp: false - uses: nttld/setup-ndk@v1 id: setup-ndk @@ -1223,7 +1001,7 @@ jobs: - name: Configure curl run: | $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/curl-7.77.0 ` + cmake -B ${{ github.workspace }}/BinaryCache/curl-8.9.1 ` -D BUILD_SHARED_LIBS=NO ` -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${{ matrix.cc }} ` @@ -1233,7 +1011,7 @@ jobs: -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-8.9.1/usr ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` ${{ matrix.extra_flags }} ` -G Ninja ` @@ -1319,149 +1097,607 @@ jobs: -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` -D CMAKE_ANDROID_NDK=$NDKPATH - name: Build curl - run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 + run: cmake --build ${{ github.workspace }}/BinaryCache/curl-8.9.1 - name: Install curl - run: cmake --build ${{ github.workspace }}/BinaryCache/curl-7.77.0 --target install + run: cmake --build ${{ github.workspace }}/BinaryCache/curl-8.9.1 --target install + + - uses: actions/upload-artifact@v4 + with: + name: curl-${{ matrix.os }}-${{ matrix.arch }}-8.9.1 + path: ${{ github.workspace }}/BuildRoot/Library/curl-8.9.1/usr + + libxml2: + runs-on: ${{ inputs.default_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cc: cl + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: cl + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: x86 + cc: cl + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: cl + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + os: Windows + extra_flags: + + - arch: arm64 + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + os: Android + extra_flags: -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} libxml2 + + steps: + - uses: actions/checkout@v4 + with: + repository: gnome/libxml2 + ref: ${{ inputs.libxml2_revision }} + path: ${{ github.workspace }}/SourceCache/libxml2 + show-progress: false + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - name: Compute workspace hash + id: workspace_hash + shell: pwsh + run: | + $stringAsStream = [System.IO.MemoryStream]::new() + $writer = [System.IO.StreamWriter]::new($stringAsStream) + $writer.write("${{ github.workspace }}") + $writer.Flush() + $stringAsStream.Position = 0 + $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash + echo "hash=$hash" >> $env:GITHUB_OUTPUT + + - name: Setup sccache + uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 + with: + max-size: 100M + key: ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-libxml2 + variant: sccache + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure libxml2 + run: | + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 ` + -D BUILD_SHARED_LIBS=NO ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_COMPILER_LAUNCHER=sccache ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + ${{ matrix.extra_flags }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/libxml2 ` + -D LIBXML2_WITH_ICONV=NO ` + -D LIBXML2_WITH_ICU=NO ` + -D LIBXML2_WITH_LZMA=NO ` + -D LIBXML2_WITH_PYTHON=NO ` + -D LIBXML2_WITH_TESTS=NO ` + -D LIBXML2_WITH_THREADS=YES ` + -D LIBXML2_WITH_ZLIB=NO ` + -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` + -D CMAKE_ANDROID_NDK=$NDKPATH + - name: Build libxml2 + run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 + - name: Install libxml2 + run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 --target install + + - uses: actions/upload-artifact@v4 + with: + name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 + path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr + + stdlib: + needs: [compilers, cmark_gfm] + runs-on: ${{ inputs.default_build_runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + cpu: 'x86_64' + triple: 'x86_64-unknown-windows-msvc' + triple_no_api_level: 'x86_64-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: arm64 + cpu: 'aarch64' + triple: 'aarch64-unknown-windows-msvc' + triple_no_api_level: 'aarch64-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: x86 + cpu: 'i686' + triple: 'i686-unknown-windows-msvc' + triple_no_api_level: 'i686-unknown-windows-msvc' + cc: '$CLANG_CL' + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} + cxx: '$CLANG_CL' + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} + os: Windows + llvm_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: + + - arch: arm64 + cpu: 'aarch64' + triple: 'aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' + triple_no_api_level: aarch64-unknown-linux-android + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + + - arch: armv7 + cpu: armv7 + triple: 'armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }}' + triple_no_api_level: armv7-unknown-linux-androideabi + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + + - arch: i686 + cpu: i686 + triple: 'i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' + triple_no_api_level: i686-unknown-linux-android + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + + - arch: x86_64 + cpu: 'x86_64' + triple: 'x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' + triple_no_api_level: x86_64-unknown-linux-android + cc: clang + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} + cxx: clang++ + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + os: Android + llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + + name: ${{ matrix.os }} ${{ matrix.arch }} Standard Library + + steps: + - name: Download Compilers + uses: actions/download-artifact@v4 + with: + name: compilers-amd64 + path: ${{ github.workspace }}/BuildRoot/Library + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + + - uses: actions/checkout@v4 + with: + repository: swiftlang/llvm-project + ref: ${{ inputs.llvm_project_revision }} + path: ${{ github.workspace }}/SourceCache/llvm-project + show-progress: false + - uses: actions/checkout@v4 + with: + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-corelibs-libdispatch + ref: ${{ inputs.swift_corelibs_libdispatch_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch + show-progress: false + - uses: actions/checkout@v4 + with: + repository: swiftlang/swift-experimental-string-processing + ref: ${{ inputs.swift_experimental_string_processing_revision }} + path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing + show-progress: false + + # NOTE(compnerd) While we do not have ABI stability on Windows yet, we use + # Swift in the compiler, which requires that we have the Swift runtime. As + # we have not yet built the runtime, this requires that we use the runtime + # from the previous build. + - name: Install Swift Toolchain + uses: compnerd/gha-setup-swift@main + with: + github-repo: thebrowsercompany/swift-build + github-token: ${{ secrets.GITHUB_TOKEN }} + release-asset-name: installer-amd64.exe + release-tag-name: '20231016.0' + + # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + # NOTE(compnerd): we execute unconditionally as we reference outputs + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26b + + - name: Configure LLVM + run: | + # NOTE: used by `matrix.cc` + $CLANG_CL = "cl" + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + cmake -B ${{ github.workspace }}/BinaryCache/llvm ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + ${{ matrix.llvm_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=${NDKPATH} ` + -D SWIFT_ANDROID_NDK_PATH=${NDKPATH} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` + -D LLVM_ENABLE_ASSERTIONS=YES + + - name: Configure Swift Standard Library + run: | + # NOTE: used by `matrix.cc` + $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + + $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { + "armv7-a" + } else { + "${{ matrix.cpu }}" + } + + Remove-Item env:\SDKROOT + cmake -B ${{ github.workspace }}/BinaryCache/swift ` + -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-${{ matrix.os }}-${{ matrix.cpu }}.cmake ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_C_COMPILER=${{ matrix.cc }} ` + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` + -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_MT=mt ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_WORKS=YES ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/swift/lib/swift ${{ matrix.swiftflags }}" ` + -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` + -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=${NDKPATH} ` + -D SWIFT_ANDROID_NDK_PATH=${NDKPATH} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift ` + -D LLVM_DIR=${{ github.workspace }}/BinaryCache/llvm/lib/cmake/llvm ` + -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` + -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` + -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` + -D SWIFT_ENABLE_VOLATILE=YES ` + -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ` + -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` + -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` + -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing + - name: Build Swift Standard Library + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/swift + - name: Install Swift Standard Library + run: | + Remove-Item env:\SDKROOT + cmake --build ${{ github.workspace }}/BinaryCache/swift --target install - uses: actions/upload-artifact@v4 with: - name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 - path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr + name: ${{ matrix.os }}-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform - libxml2: - needs: [context] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + - uses: actions/upload-artifact@v4 + if: matrix.os == 'Windows' + with: + name: windows-vfs-overlay-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + + - name: Upload PDBs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ inputs.debug_info && matrix.os == 'Windows' }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.pdb' + + - name: Upload DLLs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ inputs.debug_info && matrix.os == 'Windows' }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache + searchPattern: '**/*.dll' + + macros: + needs: [compilers, cmark_gfm, stdlib] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false matrix: include: - - arch: amd64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: x86 - cc: cl - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} - cxx: cl - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - os: Windows - extra_flags: - - - arch: arm64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + - arch: 'amd64' + cpu: 'x86_64' + triple: 'x86_64-unknown-windows-msvc' - - arch: armv7 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + - arch: 'arm64' + cpu: 'aarch64' + triple: 'aarch64-unknown-windows-msvc' - - arch: i686 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + name: Windows ${{ matrix.arch }} Macros - - arch: x86_64 - cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} - cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - os: Android - extra_flags: -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + steps: + - name: Download Compilers + uses: actions/download-artifact@v4 + with: + name: compilers-amd64 + path: ${{ github.workspace }}/BinaryCache/Library + - name: Download swift-syntax + uses: actions/download-artifact@v4 + with: + name: swift-syntax-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift-syntax + - uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + if: matrix.arch == 'arm64' + with: + name: Windows-stdlib-amd64 + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + with: + name: windows-vfs-overlay-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift/stdlib + - uses: actions/download-artifact@v4 + with: + name: cmark-gfm-amd64-0.29.0.gfm.13 + path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr - name: ${{ matrix.os }} ${{ matrix.arch }} libxml2 + - name: cmark-gfm Setup + run: Copy-Item ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - steps: - uses: actions/checkout@v4 with: - repository: gnome/libxml2 - ref: ${{ needs.context.outputs.libxml2_revision }} - path: ${{ github.workspace }}/SourceCache/libxml2 + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} + path: ${{ github.workspace }}/SourceCache/swift + show-progress: false + - uses: actions/checkout@v4 + with: + repository: apple/swift-foundation + ref: ${{ inputs.swift_foundation_revision }} + path: ${{ github.workspace }}/SourceCache/swift-foundation + show-progress: false + - uses: actions/checkout@v4 + with: + repository: swiftlang/swift-testing + ref: ${{ inputs.swift_testing_revision }} + path: ${{ github.workspace }}/SourceCache/swift-testing show-progress: false + # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - uses: compnerd/gha-setup-vsdevenv@main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} - - name: Setup sccache - uses: hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6 - with: - max-size: 100M - key: ${{ matrix.os }}-${{ matrix.arch }}-libxml2 - variant: sccache - append-timestamp: false + - run: | + $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin + echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r26b + - name: extract swift-syntax + run: | + $module = "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules/SwiftSyntaxConfig.cmake" + $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/swift-syntax + (Get-Content $module).Replace('', "${bindir}") | Set-Content $module - - name: Configure libxml2 + - name: Configure Foundation Macros run: | - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 ` - -D BUILD_SHARED_LIBS=NO ` + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-foundation-macros ` -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_COMPILER_LAUNCHER=sccache ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_COMPILER_LAUNCHER=sccache ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - ${{ matrix.extra_flags }} ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift/windows -vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ inputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` -G Ninja ` - -S ${{ github.workspace }}/SourceCache/libxml2 ` - -D LIBXML2_WITH_ICONV=NO ` - -D LIBXML2_WITH_ICU=NO ` - -D LIBXML2_WITH_LZMA=NO ` - -D LIBXML2_WITH_PYTHON=NO ` - -D LIBXML2_WITH_TESTS=NO ` - -D LIBXML2_WITH_THREADS=YES ` - -D LIBXML2_WITH_ZLIB=NO ` - -D CMAKE_POSITION_INDEPENDENT_CODE=YES ` - -D CMAKE_ANDROID_NDK=$NDKPATH - - name: Build libxml2 - run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 - - name: Install libxml2 - run: cmake --build ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 --target install + -S ${{ github.workspace }}/SourceCache/swift-foundation/Sources/FoundationMacros ` + -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules + - name: Build Foundation Macros + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-foundation-macros - - uses: actions/upload-artifact@v4 + - name: Configure Testing Macros + run: | + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + cmake -B ${{ github.workspace }}/BinaryCache/swift-testing-macros ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift/windows -vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ inputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_SYSTEM_NAME=Windows ` + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-testing/Sources/TestingMacros ` + -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules + - name: Build Testing Macros + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros + + - name: Install Foundation Macros + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-foundation-macros --target install + - name: Install Testing Macros + run: cmake --build ${{ github.workspace }}/BinaryCache/swift-testing-macros --target install + + - name: Upload macros + uses: actions/upload-artifact@v4 with: - name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 - path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr + name: macros-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library + + - name: Upload PDBs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ inputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/swift-foundation-macros + searchPattern: '**/*.pdb' + + - name: Upload DLLs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ inputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/swift-foundation-macros + searchPattern: '**/*.dll' + + - name: Upload EXEs to Azure + uses: microsoft/action-publish-symbols@v2.1.6 + if: ${{ inputs.debug_info }} + with: + accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} + personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} + symbolsFolder: ${{ github.workspace }}/BinaryCache/swift-foundation-macros + searchPattern: '**/*.exe' sdk: - continue-on-error: ${{ matrix.arch != 'amd64' }} - needs: [context, icu, libxml2, curl, zlib, compilers, cmark_gfm] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [libxml2, curl, zlib, compilers, cmark_gfm, stdlib, macros] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -1472,13 +1708,12 @@ jobs: triple: 'x86_64-unknown-windows-msvc' triple_no_api_level: 'x86_64-unknown-windows-msvc' cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' extra_flags: - arch: arm64 @@ -1486,190 +1721,191 @@ jobs: triple: 'aarch64-unknown-windows-msvc' triple_no_api_level: 'aarch64-unknown-windows-msvc' cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: - arch: x86 cpu: 'i686' triple: 'i686-unknown-windows-msvc' triple_no_api_level: 'i686-unknown-windows-msvc' cc: '$CLANG_CL' - cflags: ${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} + cflags: ${{ inputs.WINDOWS_CMAKE_C_FLAGS }} cxx: '$CLANG_CL' - cxxflags: ${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} - swiftflags: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }} + cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} + swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }} os: Windows - llvm_flags: - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: - arch: arm64 cpu: 'aarch64' - triple: 'aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple: 'aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' triple_no_api_level: aarch64-unknown-linux-android cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a - arch: armv7 cpu: armv7 - triple: 'armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple: 'armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }}' triple_no_api_level: armv7-unknown-linux-androideabi cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a - arch: i686 cpu: i686 - triple: 'i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple: 'i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' triple_no_api_level: i686-unknown-linux-android cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86 - arch: x86_64 cpu: 'x86_64' - triple: 'x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }}' + triple: 'x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}' triple_no_api_level: x86_64-unknown-linux-android cc: clang - cflags: ${{ needs.context.outputs.ANDROID_CMAKE_C_FLAGS }} + cflags: ${{ inputs.ANDROID_CMAKE_C_FLAGS }} cxx: clang++ - cxxflags: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }} - swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g + cxxflags: ${{ inputs.ANDROID_CMAKE_CXX_FLAGS }} + swiftflags: -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g os: Android - llvm_flags: -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ needs.context.outputs.ANDROID_API_LEVEL }} - linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' - extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ needs.context.outputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 + linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}"' + extra_flags: -DSWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT=YES -DLLVM_ENABLE_LIBCXX=YES -DSWIFT_USE_LINKER=lld -DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64 name: ${{ matrix.os }} ${{ matrix.arch }} SDK steps: - - uses: actions/download-artifact@v4 - if: matrix.os == 'Android' - with: - name: icu-${{ matrix.os }}-${{ matrix.arch }}-69.1 - path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr - uses: actions/download-artifact@v4 with: name: libxml2-${{ matrix.os }}-${{ matrix.arch }}-2.11.5 path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr - uses: actions/download-artifact@v4 with: - name: curl-${{ matrix.os }}-${{ matrix.arch }}-7.77.0 - path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr + name: curl-${{ matrix.os }}-${{ matrix.arch }}-8.9.1 + path: ${{ github.workspace }}/BuildRoot/Library/curl-8.9.1/usr - uses: actions/download-artifact@v4 with: name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr + - name: Download Compilers uses: actions/download-artifact@v4 with: name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/Library + path: ${{ github.workspace }}/BinaryCache/Library + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.os }}-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform + - uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-amd64 + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + if: matrix.os == 'Windows' + with: + name: windows-vfs-overlay-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/swift/stdlib + - uses: actions/download-artifact@v4 + with: + name: macros-amd64 + path: ${{ github.workspace }}/BinaryCache/Library - uses: actions/download-artifact@v4 with: name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr - name: cmark-gfm Setup - run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + run: Copy-Item ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - uses: actions/checkout@v4 with: - repository: apple/llvm-project - ref: ${{ needs.context.outputs.llvm_project_revision }} - path: ${{ github.workspace }}/SourceCache/llvm-project - show-progress: false - - uses: actions/checkout@v4 - with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift + repository: apple/swift-corelibs-libdispatch + ref: ${{ inputs.swift_corelibs_libdispatch_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch show-progress: false - uses: actions/checkout@v4 + if: matrix.os != 'Android' with: - repository: apple/swift-syntax - ref: ${{ needs.context.outputs.swift_syntax_revision }} - path: ${{ github.workspace }}/SourceCache/swift-syntax + repository: apple/swift-corelibs-foundation + ref: ${{ inputs.swift_corelibs_foundation_revision }} + path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation show-progress: false - uses: actions/checkout@v4 + if: matrix.os == 'Android' with: - repository: apple/swift-corelibs-libdispatch - ref: ${{ needs.context.outputs.swift_corelibs_libdispatch_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch + repository: hyp/swift-corelibs-foundation + ref: eng/recore-android-build + path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation show-progress: false - uses: actions/checkout@v4 - if: matrix.os == 'Windows' + if: matrix.os != 'Android' with: - repository: apple/swift-corelibs-foundation - ref: ${{ needs.context.outputs.swift_corelibs_foundation_revision }} - path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation + repository: apple/swift-foundation + ref: ${{ inputs.swift_foundation_revision }} + path: ${{ github.workspace }}/SourceCache/swift-foundation show-progress: false - uses: actions/checkout@v4 - if: matrix.os == 'Windows' + if: matrix.os == 'Android' with: - repository: apple/swift-foundation - ref: ${{ needs.context.outputs.swift_foundation_revision }} + repository: hyp/swift-foundation + ref: android-wmo-merged path: ${{ github.workspace }}/SourceCache/swift-foundation show-progress: false - uses: actions/checkout@v4 - if: matrix.os == 'Windows' with: repository: apple/swift-foundation-icu - ref: ${{ needs.context.outputs.swift_foundation_icu_revision }} + ref: ${{ inputs.swift_foundation_icu_revision }} path: ${{ github.workspace }}/SourceCache/swift-foundation-icu show-progress: false - uses: actions/checkout@v4 - if: matrix.os == 'Windows' with: repository: apple/swift-collections - ref: ${{ needs.context.outputs.swift_collections_revision }} + ref: ${{ inputs.swift_collections_revision }} path: ${{ github.workspace }}/SourceCache/swift-collections show-progress: false - - uses: actions/checkout@v4 - if: matrix.os == 'Android' - with: - repository: hyp/swift-corelibs-foundation - ref: 6bf677693eb23030eb3646c9b121c665f40aa8b0 - path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation - show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-corelibs-xctest - ref: ${{ needs.context.outputs.swift_corelibs_xctest_revision }} + repository: swiftlang/swift-corelibs-xctest + ref: ${{ inputs.swift_corelibs_xctest_revision }} path: ${{ github.workspace }}/SourceCache/swift-corelibs-xctest show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-experimental-string-processing - ref: ${{ needs.context.outputs.swift_experimental_string_processing_revision }} - path: ${{ github.workspace }}/SourceCache/swift-experimental-string-processing + repository: swiftlang/swift-testing + ref: ${{ inputs.swift_testing_revision }} + path: ${{ github.workspace }}/SourceCache/swift-testing show-progress: false + - run: | + $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin + echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + $SDKRoot = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk + echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - uses: compnerd/gha-setup-vsdevenv@main with: @@ -1682,18 +1918,14 @@ jobs: with: github-repo: thebrowsercompany/swift-build github-token: ${{ secrets.GITHUB_TOKEN }} - release-asset-name: installer-amd64.exe - release-tag-name: '20231016.0' - - # workaround CMake 3.30 issue - - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.29' + release-asset-name: installer-amd64.exe + release-tag-name: '20231016.0' # FIXME(compnerd): workaround CMake 3.30 issue + # FIXME(compnerd): workaround CMake 3.29-3.30 issue - uses: jwlawson/actions-setup-cmake@v2 with: - cmake-version: '3.29' + cmake-version: '3.28' # NOTE(compnerd): we execute unconditionally as we reference outputs - uses: nttld/setup-ndk@v1 @@ -1701,100 +1933,23 @@ jobs: with: ndk-version: r26b - - name: Configure LLVM - run: | - $CLANG_CL = "cl" - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/llvm ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - ${{ matrix.llvm_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` - -D LLVM_ENABLE_ASSERTIONS=YES - - - name: Configure Swift Standard Library - run: | - # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - - $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - - Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/swift ` - -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-${{ matrix.os }}-${{ matrix.cpu }}.cmake ` - -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_C_COMPILER=${{ matrix.cc }} ` - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" ` - -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` - -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` - -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` - -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` - -D CMAKE_Swift_COMPILER=${SWIFTC} ` - -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/swift/lib/swift ${{ matrix.swiftflags }}" ` - -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` - -D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} ` - ${{ matrix.linker_flags }} ` - ${{ matrix.extra_flags }} ` - -D CMAKE_ANDROID_NDK=$NDKPATH ` - -D SWIFT_ANDROID_NDK_PATH=$NDKPATH ` - -G Ninja ` - -S ${{ github.workspace }}/SourceCache/swift ` - -D LLVM_DIR=${{ github.workspace }}/BinaryCache/llvm/lib/cmake/llvm ` - -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=YES ` - -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=YES ` - -D SWIFT_ENABLE_SYNCHRONIZATION=YES ` - -D SWIFT_ENABLE_VOLATILE=YES ` - -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ` - -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}/SourceCache/swift-corelibs-libdispatch ` - -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ github.workspace }}/SourceCache/swift-syntax ` - -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ github.workspace }}/SourceCache/swift-experimental-string-processing - - name: Build Swift Standard Library - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/swift - - name: Install Swift Standard Library - run: | - Remove-Item env:\SDKROOT - cmake --build ${{ github.workspace }}/BinaryCache/swift --target install - - name: Configure libdispatch run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { + "-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" + } else { + "" + } $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - Remove-Item env:\SDKROOT cmake -B ${{ github.workspace }}/BinaryCache/libdispatch ` -D BUILD_SHARED_LIBS=YES ` -D CMAKE_BUILD_TYPE=Release ` @@ -1808,7 +1963,7 @@ jobs: -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` @@ -1824,41 +1979,35 @@ jobs: -D ENABLE_SWIFT=YES - name: Build libdispatch run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/libdispatch - name: Configure Foundation run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe - $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { + "-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" + } else { + "" + } + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - $DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" } - $zlib_lib = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" } - $xml_lib = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" } + $DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" } + $LIBZ = if ("${{ matrix.os }}" -eq "Windows") { "zlibstatic.lib" } else { "libz.a" } + $LIBXML = if ("${{ matrix.os }}" -eq "Windows") { "libxml2s.lib" } else { "libxml2.a" } $SWIFT_FOUNDATION_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation $SWIFT_FOUNDATION_ICU_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-foundation-icu $SWIFT_COLLECTIONS_SOURCE_DIR = cygpath -m ${{ github.workspace }}/SourceCache/swift-collections - $ICU_FLAGS = if ("${{ matrix.os }}" -eq "Android") { - "-D","ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicudt69.a", - "-D","ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuin69.a", - "-D","ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr", - "-D","ICU_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/include", - "-D","ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/libicuuc69.a" - } else { - @() - } - $build_tools = if ("${{ matrix.os }}" -eq "Windows") { "YES" } else { "NO" } - Remove-Item env:\SDKROOT cmake -B ${{ github.workspace }}/BinaryCache/foundation ` -D BUILD_SHARED_LIBS=YES ` -D CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL="/MD" ` @@ -1870,12 +2019,12 @@ jobs: -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` - -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` + -D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` -D CMAKE_MT=mt ` -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` @@ -1888,37 +2037,41 @@ jobs: -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-corelibs-foundation ` -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` - -D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr/lib/cmake/CURL ` + -D CURL_DIR=${{ github.workspace }}/BuildRoot/Library/curl-8.9.1/usr/lib/cmake/CURL ` -D FOUNDATION_BUILD_TOOLS=${build_tools} ` + -D Foundation_MACRO=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ` -D ENABLE_TESTING=NO ` - @ICU_FLAGS ` -D _SwiftFoundation_SourceDIR=$SWIFT_FOUNDATION_SOURCE_DIR ` -D _SwiftFoundationICU_SourceDIR=$SWIFT_FOUNDATION_ICU_SOURCE_DIR ` -D _SwiftCollections_SourceDIR=$SWIFT_COLLECTIONS_SOURCE_DIR ` -D LIBXML2_DEFINITIONS="${DEFINITION_FLAG}LIBXML_STATIC" ` -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/include/libxml2 ` - -D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$xml_lib ` + -D LIBXML2_LIBRARY=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr/lib/$LIBXML ` -D ZLIB_ROOT=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr ` - -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$zlib_lib + -D ZLIB_LIBRARY=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr/lib/$LIBZ ` + -D SwiftFoundation_MACRO=${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin - name: Build foundation run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/foundation # TODO(compnerd) correctly version XCTest - name: Configure xctest run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} - $WIN_OVERLAY_PATH = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml - $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { "-vfsoverlay ${WIN_OVERLAY_PATH} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" } else { "" } + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { + "-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" + } else { + "" + } $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } - Remove-Item env:\SDKROOT cmake -B ${{ github.workspace }}/BinaryCache/xctest ` -D BUILD_SHARED_LIBS=YES ` -D CMAKE_BUILD_TYPE=Release ` @@ -1933,7 +2086,7 @@ jobs: -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` @@ -1948,20 +2101,64 @@ jobs: -D ENABLE_TESTING=NO - name: Build xctest run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/xctest + - name: Configure Testing + run: | + # Workaround CMake 3.20 issue + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + + $NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }} + + $WINDOWS_VFS_OVERLAY = cygpath -m ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml + $OVERLAY_FLAGS = if ("${{ matrix.os }}" -eq "Windows") { + "-vfsoverlay ${WINDOWS_VFS_OVERLAY} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules" + } else { + "" + } + + # Workaround the issue of not using the new Swift driver , that forces us to disable the CMP0157 policy. + (Get-Content -Path "${{ github.workspace }}\SourceCache\swift-testing\CMakeLists.txt") -replace 'cmake_policy\(SET CMP0157 NEW\)', 'cmake_policy(SET CMP0157 OLD)' | Set-Content -Path "${{ github.workspace }}\SourceCache\swift-testing\CMakeLists.txt" + + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } + + cmake -B ${{ github.workspace }}/BinaryCache/testing ` + -D BUILD_SHARED_LIBS=YES ` + -D CMAKE_BUILD_TYPE=Release ` + -D CMAKE_BUILD_WITH_INSTALL_RPATH=YES ` + -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr ` + -D CMAKE_Swift_COMPILER=${SWIFTC} ` + -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` + -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` + -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` + ${{ matrix.linker_flags }} ` + ${{ matrix.extra_flags }} ` + -D CMAKE_ANDROID_NDK=${NDKPATH} ` + -D SWIFT_ANDROID_NDK_PATH=${NDKPATH} ` + -G Ninja ` + -S ${{ github.workspace }}/SourceCache/swift-testing ` + -D SwiftTesting_MACRO=${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/TestingMacros.dll + - name: Build Testing + run: | + cmake --build ${{ github.workspace }}/BinaryCache/testing + + - name: Install Testing + run: | + cmake --build ${{ github.workspace }}/BinaryCache/testing --target install - name: Install xctest run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/xctest --target install - name: Install foundation run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/foundation --target install - name: Install libdispatch run: | - Remove-Item env:\SDKROOT cmake --build ${{ github.workspace }}/BinaryCache/libdispatch --target install - uses: actions/setup-python@v5 @@ -1989,7 +2186,7 @@ jobs: - name: Upload PDBs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} + if: ${{ inputs.debug_info && matrix.os == 'Windows' }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -1998,7 +2195,7 @@ jobs: - name: Upload DLLs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info && matrix.os == 'Windows' }} + if: ${{ inputs.debug_info && matrix.os == 'Windows' }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -2006,8 +2203,8 @@ jobs: searchPattern: '**/*.dll' devtools: - needs: [context, sqlite, compilers, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [sqlite, compilers, stdlib, sdk] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -2021,145 +2218,153 @@ jobs: cpu: 'aarch64' triple: 'aarch64-unknown-windows-msvc' + name: Windows ${{ matrix.arch }} Developer Tools + steps: - uses: actions/download-artifact@v4 with: - name: sqlite-Windows-${{ matrix.arch }}-3.43.2 - path: ${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr + name: sqlite-Windows-${{ matrix.arch }}-${{ inputs.swift_toolchain_sqlite_version }} + path: ${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr + - name: Download Compilers uses: actions/download-artifact@v4 with: name: compilers-amd64 - path: ${{ github.workspace }}/BuildRoot/Library + path: ${{ github.workspace }}/BinaryCache/Library - uses: actions/download-artifact@v4 with: - name: Windows-sdk-amd64 - path: ${{ github.workspace }}/BinaryCache - - name: Download SDK - uses: actions/download-artifact@v4 + name: Windows-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 with: name: Windows-sdk-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - - name: Downlaod swift-syntax - uses: actions/download-artifact@v4 + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + with: + name: macros-amd64 + path: ${{ github.workspace }}/BinaryCache/Library + - uses: actions/download-artifact@v4 with: name: swift-syntax-${{ matrix.arch }} path: ${{ github.workspace }}/BinaryCache/swift-syntax - uses: actions/download-artifact@v4 with: name: cmark-gfm-amd64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr - name: cmark-gfm Setup - run: Copy-Item ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ + run: Copy-Item ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/bin/*.dll ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/ - uses: actions/download-artifact@v4 if: matrix.arch == 'arm64' with: name: cmark-gfm-arm64-0.29.0.gfm.13 - path: ${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr + path: ${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr - uses: actions/checkout@v4 with: - repository: apple/indexstore-db - ref: ${{ needs.context.outputs.indexstore_db_revision }} + repository: swiftlang/indexstore-db + ref: ${{ inputs.indexstore_db_revision }} path: ${{ github.workspace }}/SourceCache/indexstore-db show-progress: false - uses: actions/checkout@v4 with: - repository: apple/sourcekit-lsp - ref: ${{ needs.context.outputs.sourcekit_lsp_revision }} + repository: swiftlang/sourcekit-lsp + ref: ${{ inputs.sourcekit_lsp_revision }} path: ${{ github.workspace }}/SourceCache/sourcekit-lsp show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-argument-parser - ref: ${{ needs.context.outputs.swift_argument_parser_revision }} + ref: ${{ inputs.swift_argument_parser_revision }} path: ${{ github.workspace }}/SourceCache/swift-argument-parser show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-asn1 - ref: ${{ needs.context.outputs.swift_asn1_revision }} + ref: ${{ inputs.swift_asn1_revision }} path: ${{ github.workspace }}/SourceCache/swift-asn1 show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-certificates - ref: ${{ needs.context.outputs.swift_certificates_revision }} + ref: ${{ inputs.swift_certificates_revision }} path: ${{ github.workspace }}/SourceCache/swift-certificates show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-collections - ref: ${{ needs.context.outputs.swift_collections_revision }} + ref: ${{ inputs.swift_collections_revision }} path: ${{ github.workspace }}/SourceCache/swift-collections show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-crypto - ref: ${{ needs.context.outputs.swift_crypto_revision }} + ref: ${{ inputs.swift_crypto_revision }} path: ${{ github.workspace }}/SourceCache/swift-crypto show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-driver - ref: ${{ needs.context.outputs.swift_driver_revision }} + repository: swiftlang/swift-driver + ref: ${{ inputs.swift_driver_revision }} path: ${{ github.workspace }}/SourceCache/swift-driver show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-format - ref: ${{ needs.context.outputs.swift_format_revision }} + repository: swiftlang/swift-format + ref: ${{ inputs.swift_format_revision }} path: ${{ github.workspace }}/SourceCache/swift-format show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-llbuild - ref: ${{ needs.context.outputs.swift_llbuild_revision }} + repository: swiftlang/swift-llbuild + ref: ${{ inputs.swift_llbuild_revision }} path: ${{ github.workspace }}/SourceCache/swift-llbuild show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-markdown - ref: ${{ needs.context.outputs.swift_markdown_revision }} + repository: swiftlang/swift-markdown + ref: ${{ inputs.swift_markdown_revision }} path: ${{ github.workspace }}/SourceCache/swift-markdown show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-package-manager - ref: ${{ needs.context.outputs.swift_package_manager_revision }} + repository: swiftlang/swift-package-manager + ref: ${{ inputs.swift_package_manager_revision }} path: ${{ github.workspace }}/SourceCache/swift-package-manager show-progress: false - uses: actions/checkout@v4 with: repository: apple/swift-system - ref: ${{ needs.context.outputs.swift_system_revision }} + ref: ${{ inputs.swift_system_revision }} path: ${{ github.workspace }}/SourceCache/swift-system show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift-tools-support-core - ref: ${{ needs.context.outputs.swift_tools_support_core_revision }} + repository: swiftlang/swift-tools-support-core + ref: ${{ inputs.swift_tools_support_core_revision }} path: ${{ github.workspace }}/SourceCache/swift-tools-support-core show-progress: false - uses: actions/checkout@v4 with: repository: jpsim/Yams - ref: ${{ needs.context.outputs.yams_revision }} + ref: ${{ inputs.yams_revision }} path: ${{ github.workspace }}/SourceCache/Yams show-progress: false - uses: actions/checkout@v4 with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} path: ${{ github.workspace }}/SourceCache/swift show-progress: false - run: | - $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin + $RTLPath = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/bin echo ${RTLPath} | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $SDKRoot = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk + echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - uses: compnerd/gha-setup-vsdevenv@main with: host_arch: amd64 @@ -2167,8 +2372,6 @@ jobs: arch: ${{ matrix.arch }} - run: | - $env:SDKROOT="${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" - Move-Item ${env:SDKROOT}/usr/lib/swift/dispatch ${env:SDKROOT}/usr/include/ Move-Item ${env:SDKROOT}/usr/lib/swift/os ${env:SDKROOT}/usr/include/ Move-Item ${env:SDKROOT}/usr/lib/swift/Block ${env:SDKROOT}/usr/include/ @@ -2185,11 +2388,21 @@ jobs: Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ + # Download host libraries for the windows amd64 host, after moving the target libraries to the target-specific directory. + - uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-amd64 + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - uses: actions/download-artifact@v4 + with: + name: Windows-sdk-amd64 + path: ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform + - name: Configure swift-argument-parser run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-argument-parser ` -D BUILD_SHARED_LIBS=YES ` @@ -2197,16 +2410,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2218,8 +2431,8 @@ jobs: - name: Configure swift-collections run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-collections ` -D BUILD_SHARED_LIBS=YES ` @@ -2227,16 +2440,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2248,7 +2461,7 @@ jobs: - name: Configure swift-crypto run: | # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-crypto ` -D BUILD_SHARED_LIBS=NO ` @@ -2256,16 +2469,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2277,7 +2490,7 @@ jobs: - name: Configure Yams run: | # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/yams ` -D BUILD_SHARED_LIBS=NO ` @@ -2285,16 +2498,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2306,7 +2519,7 @@ jobs: - name: Configure swift-llbuild run: | # Workaround CMake 3.20 issue - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-llbuild ` -D BUILD_SHARED_LIBS=YES ` @@ -2314,32 +2527,32 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=cl ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-llbuild ` -D LLBUILD_SUPPORT_BINDINGS=Swift ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include + -D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include - name: Build swift-llbuild run: cmake --build ${{ github.workspace }}/BinaryCache/swift-llbuild - name: Configure swift-system run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-system ` -D BUILD_SHARED_LIBS=YES ` @@ -2347,16 +2560,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2368,8 +2581,8 @@ jobs: - name: Configure swift-tools-support-core run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-tools-support-core ` -D BUILD_SHARED_LIBS=YES ` @@ -2377,32 +2590,32 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-tools-support-core ` -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include + -D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include - name: Build swift-tools-support-core run: cmake --build ${{ github.workspace }}/BinaryCache/swift-tools-support-core - name: Configure swift-driver run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-driver ` -D BUILD_SHARED_LIBS=YES ` @@ -2410,16 +2623,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2428,8 +2641,8 @@ jobs: -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` -D SwiftSystem_DIR=${{ github.workspace }}/BinaryCache/swift-system/cmake/modules ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include ` -D TSC_DIR=${{ github.workspace }}/BinaryCache/swift-tools-support-core/cmake/modules ` -D Yams_DIR=${{ github.workspace }}/BinaryCache/yams/cmake/modules - name: Build swift-driver @@ -2438,8 +2651,8 @@ jobs: - name: Configure swift-asn1 run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-asn1 ` -D BUILD_SHARED_LIBS=NO ` @@ -2447,7 +2660,7 @@ jobs: -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2459,8 +2672,8 @@ jobs: - name: Configure swift-certificates run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-certificates ` -D BUILD_SHARED_LIBS=NO ` @@ -2468,7 +2681,7 @@ jobs: -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2488,8 +2701,8 @@ jobs: - name: Configure swift-package-manager run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-package-manager ` -D BUILD_SHARED_LIBS=YES ` @@ -2497,16 +2710,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2514,8 +2727,8 @@ jobs: -S ${{ github.workspace }}/SourceCache/swift-package-manager ` -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` -D LLBuild_DIR=${{ github.workspace }}/BinaryCache/swift-llbuild/cmake/modules ` - -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/include ` - -D SQLite3_LIBRARY=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr/lib/SQLite3.lib ` + -D SQLite3_INCLUDE_DIR=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/include ` + -D SQLite3_LIBRARY=${{ github.workspace }}/BinaryCache/Library/sqlite-${{ inputs.swift_toolchain_sqlite_version }}/usr/lib/SQLite3.lib ` -D SwiftASN1_DIR=${{ github.workspace }}/BinaryCache/swift-asn1/cmake/modules ` -D SwiftCertificates_DIR=${{ github.workspace }}/BinaryCache/swift-certificates/cmake/modules ` -D SwiftCollections_DIR=${{ github.workspace }}/BinaryCache/swift-collections/cmake/modules ` @@ -2531,54 +2744,57 @@ jobs: - name: Configure Markdown run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-markdown ` -D BUILD_SHARED_LIBS=NO ` -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_CXX_COMPILER=${CLANG_CL} ` + -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-markdown ` -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake + -D cmark-gfm_DIR=${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake - name: Build Markdown run: cmake --build ${{ github.workspace }}/BinaryCache/swift-markdown - name: Configure Format run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/swift-format ` -D BUILD_SHARED_LIBS=YES ` -D CMAKE_BUILD_TYPE=Release ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }}" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-format ` -D ArgumentParser_DIR=${{ github.workspace }}/BinaryCache/swift-argument-parser/cmake/modules ` - -D cmark-gfm_DIR=${{ github.workspace }}/BuildRoot/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` + -D cmark-gfm_DIR=${{ github.workspace }}/BinaryCache/Library/cmark-gfm-0.29.0.gfm.13/usr/lib/cmake ` -D SwiftMarkdown_DIR=${{ github.workspace }}/BinaryCache/swift-markdown/cmake/modules ` -D SwiftSyntax_DIR=${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules - name: Build swift-format @@ -2587,8 +2803,8 @@ jobs: - name: Configure IndexStoreDB run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/indexstore-db ` -D BUILD_SHARED_LIBS=NO ` @@ -2596,16 +2812,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include -I ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/include/Block" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }} -I${env:SDKROOT}/usr/include -I${env:SDKROOT}/usr/include/Block" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2617,8 +2833,8 @@ jobs: - name: Configure SourceKit-LSP run: | # Workaround CMake 3.20 issue - $CLANG_CL = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe - $SWIFTC = cygpath -m ${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe + $CLANG_CL = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang-cl.exe + $SWIFTC = cygpath -m ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe cmake -B ${{ github.workspace }}/BinaryCache/sourcekit-lsp ` -D BUILD_SHARED_LIBS=YES ` @@ -2626,16 +2842,16 @@ jobs: -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=${CLANG_CL} ` -D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_C_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_C_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" ` -D CMAKE_CXX_COMPILER=${CLANG_CL} ` -D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} ` - -D CMAKE_CXX_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }} -Xclang -fno-split-cold-code" ` + -D CMAKE_CXX_FLAGS="${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}" ` -D CMAKE_MT=mt ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot-DevTools/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} ` -D CMAKE_Swift_COMPILER_WORKS=YES ` - -D CMAKE_Swift_FLAGS="-sdk ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" ` + -D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" ` -D CMAKE_Swift_FLAGS_RELEASE="-O" ` -D CMAKE_SYSTEM_NAME=Windows ` -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} ` @@ -2675,11 +2891,11 @@ jobs: - uses: actions/upload-artifact@v4 with: name: devtools-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot-DevTools/Library + path: ${{ github.workspace }}/BuildRoot/Library - name: Upload PDBs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -2688,7 +2904,7 @@ jobs: - name: Upload DLLs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} @@ -2697,18 +2913,16 @@ jobs: - name: Upload EXEs to Azure uses: microsoft/action-publish-symbols@v2.1.6 - if: ${{ needs.context.outputs.debug_info }} + if: ${{ inputs.debug_info }} with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} symbolsFolder: ${{ github.workspace }}/BinaryCache searchPattern: '**/*.exe' - debugging_tools: - name: Debugging Tools - needs: [context, compilers, devtools, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [compilers, devtools, stdlib, sdk] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -2721,6 +2935,8 @@ jobs: cpu: aarch64 triple: aarch64-unknown-windows-msvc + name: Windows ${{ matrix.arch }} Debugging Tools + steps: - name: Download Compilers uses: actions/download-artifact@v4 @@ -2732,6 +2948,11 @@ jobs: with: name: devtools-amd64 path: ${{ github.workspace }}/BuildRoot/Library + - name: Download stdlib + uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - name: Download SDK uses: actions/download-artifact@v4 with: @@ -2781,6 +3002,10 @@ jobs: Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/ # Download host SDK on top of the target SDK, so that the runtime DLLs are the host ones. + - uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-amd64 + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - uses: actions/download-artifact@v4 with: name: Windows-sdk-amd64 @@ -2811,11 +3036,10 @@ jobs: mkdir $RTLPath Get-ChildItem -Path ${env:SDKROOT}/usr/bin -Filter "*.dll" | Move-Item -Destination $RTLPath - - name: Checkout apple/swift - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - repository: apple/swift - ref: ${{ needs.context.outputs.swift_revision }} + repository: swiftlang/swift + ref: ${{ inputs.swift_revision }} path: ${{ github.workspace }}/SourceCache/swift show-progress: false @@ -2849,8 +3073,8 @@ jobs: package_tools: name: Package Tools - needs: [context, compilers, debugging_tools, devtools] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [compilers, macros, debugging_tools, devtools] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -2876,6 +3100,12 @@ jobs: name: devtools-${{ matrix.arch }} path: ${{ github.workspace }}/BuildRoot/Library + - name: Download Macros + uses: actions/download-artifact@v4 + with: + name: macros-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library + - name: Download cmark-gfm uses: actions/download-artifact@v4 with: @@ -2887,8 +3117,8 @@ jobs: - uses: actions/checkout@v4 with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + repository: swiftlang/swift-installer-scripts + ref: ${{ inputs.swift_installer_scripts_revision }} path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false @@ -2904,7 +3134,7 @@ jobs: Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' certutil -decode $CertificatePath $PFXPath Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} + if: ${{ inputs.signed }} - name: Install WixToolset.Sdk run: | @@ -2920,13 +3150,13 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bld/bld.wixproj - name: Package CLI Tools @@ -2934,13 +3164,13 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/cli/cli.wixproj - name: Package Debugging Tools @@ -2948,7 +3178,7 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` @@ -2956,7 +3186,7 @@ jobs: -p:INCLUDE_SWIFT_INSPECT=true ` -p:SWIFT_INSPECT_BUILD=${{ github.workspace }}/BuildRoot/DebuggingTools/swift-inspect ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/dbg/dbg.wixproj - name: Package IDE Tools @@ -2964,13 +3194,13 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:DEVTOOLS_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:TOOLCHAIN_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/ide/ide.wixproj - uses: actions/upload-artifact@v4 @@ -3001,10 +3231,10 @@ jobs: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.msi ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/ide.cab - package_sdk_runtime: + package_windows_sdk_runtime: name: Package Windows SDK & Runtime - needs: [context, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [stdlib, sdk] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -3018,6 +3248,10 @@ jobs: platform: x86 steps: + - uses: actions/download-artifact@v4 + with: + name: Windows-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform - uses: actions/download-artifact@v4 with: name: Windows-sdk-${{ matrix.arch }} @@ -3025,8 +3259,8 @@ jobs: - uses: actions/checkout@v4 with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + repository: swiftlang/swift-installer-scripts + ref: ${{ inputs.swift_installer_scripts_revision }} path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false @@ -3042,7 +3276,7 @@ jobs: Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' certutil.exe -decode $CertificatePath $PFXPath Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} + if: ${{ inputs.signed }} - name: Install WixToolset.Sdk run: | @@ -3058,12 +3292,12 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` -p:ProductArchitecture=${{ matrix.arch }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/sdk/sdk.wixproj @@ -3072,12 +3306,12 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform ` -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` -p:ProductArchitecture=${{ matrix.arch }} ` -p:VCRedistDir="${env:VCToolsRedistDir}\${env:VSCMD_ARG_TGT_ARCH}\Microsoft.VC143.CRT\" ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/rtl/msi/rtlmsi.wixproj @@ -3101,10 +3335,10 @@ jobs: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.msm ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/rtl.${{ matrix.arch }}.cab - package_android_sdk: + package_android_sdk_runtime: name: Package Android SDK & Runtime - needs: [context, sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [stdlib, sdk] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -3120,6 +3354,10 @@ jobs: cpu: x86_64 steps: + - uses: actions/download-artifact@v4 + with: + name: Android-stdlib-${{ matrix.arch }} + path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform - uses: actions/download-artifact@v4 with: name: Android-sdk-${{ matrix.arch }} @@ -3127,8 +3365,8 @@ jobs: - uses: actions/checkout@v4 with: - repository: apple/swift-installer-scripts - ref: 633843b00fc8024dd86674fe43373ae4fd0f2229 + repository: swiftlang/swift-installer-scripts + ref: ${{ inputs.swift_installer_scripts_revision }} path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false @@ -3144,7 +3382,7 @@ jobs: Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' certutil.exe -decode $CertificatePath $PFXPath Write-Output CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} + if: ${{ inputs.signed }} - name: Install WixToolset.Sdk run: | @@ -3160,12 +3398,12 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:PLATFORM_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform ` -p:SDK_ROOT=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }} ` + -p:ProductVersion=${{ inputs.swift_version }} ` -p:ProductArchitecture=${{ matrix.cpu }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/android_sdk/android_sdk.wixproj @@ -3177,8 +3415,8 @@ jobs: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.cpu }}/android_sdk.${{ matrix.cpu }}.cab installer: - needs: [context, package_tools, package_sdk_runtime, package_android_sdk] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [package_tools, package_windows_sdk_runtime, package_android_sdk_runtime] + runs-on: ${{ inputs.default_build_runner }} strategy: fail-fast: false @@ -3251,8 +3489,8 @@ jobs: - uses: actions/checkout@v4 with: - repository: apple/swift-installer-scripts - ref: ${{ needs.context.outputs.swift_installer_scripts_revision }} + repository: swiftlang/swift-installer-scripts + ref: ${{ inputs.swift_installer_scripts_revision }} path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false @@ -3268,7 +3506,7 @@ jobs: Set-Content -Path $CertificatePath -Value '${{ secrets.CERTIFICATE }}' certutil -decode $CertificatePath $PFXPath Echo CERTIFICATE=$PFXPath | Out-File -FilePath ${env:GITHUB_ENV} -Encoding utf8 -Append - if: ${{ needs.context.outputs.signed }} + if: ${{ inputs.signed }} # The installer bundle needs the shared project for localization strings, # but it won't build the dependency on its own due to -p:BuildProjectReferences=false. @@ -3277,11 +3515,11 @@ jobs: msbuild -nologo -restore -maxCpuCount ` -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` + -p:ProductVersion=${{ inputs.swift_version }}-${{ inputs.swift_tag }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/shared/shared.wixproj - name: Build installer bundle @@ -3290,7 +3528,7 @@ jobs: -p:BaseOutputPath=${{ github.workspace }}\BinaryCache\installer\ ` -p:Configuration=Release ` -p:BuildProjectReferences=false ` - -p:SignOutput=${{ needs.context.outputs.signed }} ` + -p:SignOutput=${{ inputs.signed }} ` -p:CERTIFICATE=${env:CERTIFICATE} ` -p:PASSPHRASE=${{ secrets.PASSPHRASE }} ` -p:BundleFlavor=offline ` @@ -3302,7 +3540,7 @@ jobs: -p:ANDROID_INCLUDE_ARM_SDK=true ` -p:ANDROID_INCLUDE_X86_SDK=true ` -p:ProductArchitecture=${{ matrix.arch }} ` - -p:ProductVersion=${{ needs.context.outputs.swift_version }}-${{ needs.context.outputs.swift_tag }} ` + -p:ProductVersion=${{ inputs.swift_version }}-${{ inputs.swift_tag }} ` ${{ github.workspace }}/SourceCache/swift-installer-scripts/platforms/Windows/bundle/installer.wixproj - uses: actions/upload-artifact@v4 @@ -3311,8 +3549,8 @@ jobs: path: ${{ github.workspace }}/BinaryCache/installer/Release/${{ matrix.arch }}/installer.exe smoke_test: - needs: [context, installer] - runs-on: ${{ needs.context.outputs.windows_build_runner }} + needs: [installer] + runs-on: ${{ inputs.default_build_runner }} steps: - uses: actions/download-artifact@v4 @@ -3366,66 +3604,3 @@ jobs: - run: swift test -Xswiftc -DENABLE_TESTING working-directory: ${{ github.workspace }}/SourceCache/swift-win32 - - snapshot: - runs-on: ubuntu-latest - needs: [context, smoke_test] - if: github.event_name == 'schedule' - steps: - - uses: actions/checkout@v4 - with: - ref: release/6.0 - show-progress: false - - - uses: actions/download-artifact@v4 - with: - name: stable.xml - - - run: | - git config --global user.name 'github-action[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - if ! git diff --exit-code ; then - git add stable.xml - git commit -m "repo: update stable revision snapshot ${{ needs.context.outputs.swift_tag }}" - git push origin HEAD:release/6.0 - fi - - release: - runs-on: ubuntu-latest - needs: [context, smoke_test] - if: inputs.create_release == true - steps: - - uses: actions/download-artifact@v4 - with: - name: installer-amd64 - path: ${{ github.workspace }}/tmp/amd64 - - - uses: actions/download-artifact@v4 - with: - name: installer-arm64 - path: ${{ github.workspace }}/tmp/arm64 - - - name: Create Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Create Release - gh release create ${{ needs.context.outputs.swift_tag }} -R ${{ github.repository }} - - # AMD64 - cd ${{ github.workspace }}/tmp/amd64 - - mv installer.exe installer-amd64.exe - gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe -R ${{ github.repository }} - - shasum -a 256 installer-amd64.exe > installer-amd64.exe.sha256 - gh release upload ${{ needs.context.outputs.swift_tag }} installer-amd64.exe.sha256 -R ${{ github.repository }} - - # ARM64 - cd ${{ github.workspace }}/tmp/arm64 - - mv installer.exe installer-arm64.exe - gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe -R ${{ github.repository }} - - shasum -a 256 installer-arm64.exe > installer-arm64.exe.sha256 - gh release upload ${{ needs.context.outputs.swift_tag }} installer-arm64.exe.sha256 -R ${{ github.repository }} diff --git a/cmake/SQLite/CMakeLists.txt b/cmake/SQLite/CMakeLists.txt deleted file mode 100644 index 68c893c8a..000000000 --- a/cmake/SQLite/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2019 Saleem Abdulrasool. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.12.3) - -project(SQLite LANGUAGES C) - -set(CMAKE_POSITION_INDEPENDENT_CODE YES) - -add_library(SQLite3 - sqlite3.c) -if(CMAKE_SYSTEM_NAME STREQUAL Windows AND BUILD_SHARED_LIBS) - target_compile_definitions(SQLite3 PRIVATE - "SQLITE_API=__declspec(dllexport)") -endif() - -install(TARGETS SQLite3 - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -install(FILES sqlite3.h sqlite3ext.h - DESTINATION include) - diff --git a/default.xml b/default.xml index 9b796cb62..7eb9aafec 100644 --- a/default.xml +++ b/default.xml @@ -6,50 +6,51 @@ - - - - + + + + - + - + - - - - - - - - + + + + + + + + - - - + + + - + - + - + - - + + + - + From e1bdb7635b3aba5385a7f73ef373669d4f1e7e2b Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Thu, 7 Nov 2024 15:56:04 -0800 Subject: [PATCH 16/20] Fix the swift-testing branch in release/6.0 It should be `release/6.0` as opposed to `main` as per https://github.com/swiftlang/swift/blob/555c00a7317764f8fa2e587af4f0f9f68df7a178/utils/update_checkout/update-checkout-config.json#L195 and https://github.com/swiftlang/swift/pull/76026 --- default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.xml b/default.xml index 7eb9aafec..d27d3ac4c 100644 --- a/default.xml +++ b/default.xml @@ -41,7 +41,7 @@ - + From 51b3c12dc1f45329421c530f7672604f68cdea6e Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 20 Nov 2024 08:59:15 -0800 Subject: [PATCH 17/20] [workflow] fixes required to build swift 6 branch (#848) * [swift 6] update the baseline compiler to 20231016.5 to resolve 'declval' assertion * [swift 6] drop extraneous base toolchain installation in the sdk step this was placed there erroneously during conflict resolution * [swift 6] workaround swift 6 crash on x86 windows build * [swift 6] add wix toolset installation for the installer step * Fix a swift-testing build issue This follows https://github.com/swiftlang/swift/commit/ff0f9232aa77f14614a20631364f61fd53d0fb7d (cherry picked from commit 34a9cdcaea3d719e9895732c6182d322a29e68aa) --------- Co-authored-by: Hiroshi Yamauchi --- .github/workflows/swift-toolchain.yml | 41 ++++++++++++++++++--------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index e66d6661c..cc293d2a4 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -583,7 +583,7 @@ jobs: github-repo: thebrowsercompany/swift-build github-token: ${{ secrets.GITHUB_TOKEN }} release-asset-name: installer-amd64.exe - release-tag-name: '20231016.0' + release-tag-name: '20231016.5' - uses: nttld/setup-ndk@v1 id: setup-ndk @@ -1913,14 +1913,6 @@ jobs: components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} - - name: Install Swift Toolchain - uses: compnerd/gha-setup-swift@main - with: - github-repo: thebrowsercompany/swift-build - github-token: ${{ secrets.GITHUB_TOKEN }} - release-asset-name: installer-amd64.exe - release-tag-name: '20231016.0' - # FIXME(compnerd): workaround CMake 3.30 issue # FIXME(compnerd): workaround CMake 3.29-3.30 issue - uses: jwlawson/actions-setup-cmake@v2 @@ -1996,6 +1988,10 @@ jobs: "" } + # Workaround an x86 crash: https://github.com/swiftlang/swift/issues/77722 . + # FIXME: Remove when a fix lands on swift 6 branch. + $OPT_FLAGS = if ("${{ matrix.cpu }}" -eq "i686" -and "${{ matrix.os }}" -eq "Windows") { "-Onone" } else { "-O" } + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } $DEFINITION_FLAG = if ("${{ matrix.os }}" -eq "Windows") { "/D" } else { "-D" } @@ -2025,7 +2021,7 @@ jobs: -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_Swift_FLAGS_RELEASE="${OPT_FLAGS}" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` -D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} ` @@ -2070,6 +2066,10 @@ jobs: "" } + # Workaround an x86 crash: https://github.com/swiftlang/swift/issues/77722 . + # FIXME: Remove when a fix lands on swift 6 branch. + $OPT_FLAGS = if ("${{ matrix.cpu }}" -eq "i686" -and "${{ matrix.os }}" -eq "Windows") { "-Onone" } else { "-O" } + $CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" } cmake -B ${{ github.workspace }}/BinaryCache/xctest ` @@ -2087,7 +2087,7 @@ jobs: -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_Swift_FLAGS_RELEASE="$OPT_FLAGS" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` ${{ matrix.linker_flags }} ` @@ -2118,6 +2118,10 @@ jobs: "" } + # Workaround an x86 crash: https://github.com/swiftlang/swift/issues/77722 . + # FIXME: Remove when a fix lands on swift 6 branch. + $OPT_FLAGS = if ("${{ matrix.cpu }}" -eq "i686" -and "${{ matrix.os }}" -eq "Windows") { "-Onone" } else { "-O" } + # Workaround the issue of not using the new Swift driver , that forces us to disable the CMP0157 policy. (Get-Content -Path "${{ github.workspace }}\SourceCache\swift-testing\CMakeLists.txt") -replace 'cmake_policy\(SET CMP0157 NEW\)', 'cmake_policy(SET CMP0157 OLD)' | Set-Content -Path "${{ github.workspace }}\SourceCache\swift-testing\CMakeLists.txt" @@ -2133,8 +2137,8 @@ jobs: -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr ` -D CMAKE_Swift_COMPILER=${SWIFTC} ` -D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} ` - -D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` - -D CMAKE_Swift_FLAGS_RELEASE="-O" ` + -D CMAKE_Swift_FLAGS="-load-plugin-library ${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/SwiftMacros.dll -resource-dir ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift -L${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}.sdk/usr/lib/swift/${{ matrix.os }} ${OVERLAY_FLAGS} ${{ matrix.swiftflags }}" ` + -D CMAKE_Swift_FLAGS_RELEASE="$OPT_FLAGS" ` -D CMAKE_SYSTEM_NAME=${{ matrix.os }} ` -D CMAKE_SYSTEM_PROCESSOR=${CMAKE_CPU} ` ${{ matrix.linker_flags }} ` @@ -2143,6 +2147,8 @@ jobs: -D SWIFT_ANDROID_NDK_PATH=${NDKPATH} ` -G Ninja ` -S ${{ github.workspace }}/SourceCache/swift-testing ` + -D dispatch_DIR=${{ github.workspace }}/BinaryCache/libdispatch/cmake/modules ` + -D Foundation_DIR=${{ github.workspace }}/BinaryCache/foundation/cmake/modules ` -D SwiftTesting_MACRO=${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/TestingMacros.dll - name: Build Testing run: | @@ -3500,6 +3506,15 @@ jobs: components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} + - name: Install WixToolset.Sdk + run: | + if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { + if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { + Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet + } + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + } + - run: | $CertificatePath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.b64 $PFXPath = Join-Path -Path ${env:RUNNER_TEMP} -ChildPath CodeSign.pfx From 469b815ea362e83fcc1ce12d136aab042599f3d9 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Fri, 6 Dec 2024 10:42:11 -0800 Subject: [PATCH 18/20] Partial cherry-pick: Fixes to get main working downstream again (#841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Do not attempt NuGet registration This is now failing as NuGet is registered: ``` Register-PackageSource: D:\r\_work\_temp\c04a7ca5-aa41-491b-b9ad-0e09fb799d0c.ps1:4 Line | 4 | Register-PackageSource -Name NuGet -Location https://www.nuget.or … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Package Source 'NuGet' exists. ``` https://github.com/thebrowsercompany/swift-build/actions/runs/11656344808/job/32454421580 (cherry picked from commit e2e1a79848ae6287244431e613d9121ed16a28a4) --- .github/workflows/swift-toolchain.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index cc293d2a4..901f9a693 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -3145,9 +3145,6 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force } @@ -3287,9 +3284,6 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force } @@ -3393,9 +3387,6 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force } @@ -3509,9 +3500,6 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - if ([string]::IsNullOrEmpty((Get-PackageSource | %{ $_.Location } | Select-String -Pattern api.nuget.org))) { - Register-PackageSource -Name NuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet - } Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force } From 56bdf7997ca01fd7b37eae9d75662344c50fef3e Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi <56735936+hjyamauchi@users.noreply.github.com> Date: Wed, 5 Feb 2025 11:37:06 -0800 Subject: [PATCH 19/20] Update the Wix version to 4.0.6 (#894) --- .github/workflows/swift-toolchain.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 901f9a693..1372f65e1 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -3145,7 +3145,7 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.6 -Force } - name: Package Build Tools @@ -3284,7 +3284,7 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.6 -Force } - name: Package SDK @@ -3387,7 +3387,7 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.6 -Force } - name: Package SDK @@ -3500,7 +3500,7 @@ jobs: - name: Install WixToolset.Sdk run: | if ((Get-Package -Name WixToolset.Sdk -ErrorAction SilentlyContinue) -eq $null) { - Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.1 -Force + Install-Package -Name WixToolset.Sdk -RequiredVersion 4.0.6 -Force } - run: | From d49ad2b6bcb86778cae406d40b6807df476b88d4 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi <56735936+hjyamauchi@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:46:00 -0700 Subject: [PATCH 20/20] Use commit hash for dependent actions (#917) * Refer to specific commit hashes rather than a branch like main for dependent actions. Cherry pick commit 3b0b63ade2e65d370cb385db4be3c6f37f953938 --- .github/workflows/swift-toolchain.yml | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 1372f65e1..1cca12663 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -248,7 +248,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-toolchain-sqlite show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -317,7 +317,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/cmark-gfm show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -393,7 +393,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main - name: Compute workspace hash id: workspace_hash @@ -571,14 +571,14 @@ jobs: echo "PYTHON_LOCATION_amd64=$env:pythonLocation" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "PYTHON_LOCATION_arm64=${{ github.workspace }}\pythonarm64.${{ env.PYTHON_VERSION }}\tools" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' arch: ${{ matrix.arch }} - name: Install Swift Toolchain - uses: compnerd/gha-setup-swift@main + uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main with: github-repo: thebrowsercompany/swift-build github-token: ${{ secrets.GITHUB_TOKEN }} @@ -828,7 +828,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/zlib show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -968,7 +968,7 @@ jobs: name: zlib-${{ matrix.os }}-${{ matrix.arch }}-1.3 path: ${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -1179,7 +1179,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/libxml2 show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -1398,7 +1398,7 @@ jobs: # we have not yet built the runtime, this requires that we use the runtime # from the previous build. - name: Install Swift Toolchain - uses: compnerd/gha-setup-swift@main + uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main with: github-repo: thebrowsercompany/swift-build github-token: ${{ secrets.GITHUB_TOKEN }} @@ -1406,7 +1406,7 @@ jobs: release-tag-name: '20231016.0' # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -1602,7 +1602,7 @@ jobs: show-progress: false # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -1907,7 +1907,7 @@ jobs: echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append # NOTE(compnerd): we execute unconditionally as we use CMake from VSDevEnv - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -2371,7 +2371,7 @@ jobs: $SDKRoot = cygpath -w ${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk echo "SDKROOT=${SDKRoot}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -3128,7 +3128,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -3267,7 +3267,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -3370,7 +3370,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' @@ -3491,7 +3491,7 @@ jobs: path: ${{ github.workspace }}/SourceCache/swift-installer-scripts show-progress: false - - uses: compnerd/gha-setup-vsdevenv@main + - uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main with: host_arch: amd64 components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'