Skip to content

Swift Toolchain Build #230

Swift Toolchain Build

Swift Toolchain Build #230

name: swift-toolchain
on:
workflow_dispatch:
inputs:
snapshot:
description: 'Build Swift at a tagged snapshot'
default: false
type: boolean
swift_tag:
description: 'Swift Build Tag'
required: false
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: false
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
workflow_call:
inputs:
snapshot:
description: 'Build Swift at a tagged snapshot'
default: false
type: boolean
swift_version:
description: 'Swift Version'
default: '0.0.0'
required: false
type: string
debug_info:
description: 'Emit PDBs (Debug Info)'
default: true
type: boolean
signed:
description: 'Code Sign'
default: false
type: boolean
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_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 }}
CMAKE_C_FLAGS: ${{ steps.context.outputs.CMAKE_C_FLAGS }}
CMAKE_CXX_FLAGS: ${{ steps.context.outputs.CMAKE_CXX_FLAGS }}
CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.CMAKE_EXE_LINKER_FLAGS }}
CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.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.snapshot }}" == "true" ]] ; 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.2.2
swift_asn1_revision=refs/tags/0.7.0
swift_certificates_revision=refs/tags/0.1.0
swift_cmark_revision=refs/tags/${{ inputs.swift_tag }}
swift_collections_revision=refs/tags/1.0.4
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/2.4.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.1.1
swift_tools_support_core_revision=refs/tags/${{ inputs.swift_tag }}
curl_revision=refs/tags/curl-8_4_0
libxml2_revision=refs/tags/v2.11.5
yams_revision=refs/tags/5.0.4
zlib_revision=refs/tags/v1.2.13
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
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.debug_info }}" == "true" ]]; then
echo debug_info=true >> ${GITHUB_OUTPUT}
echo CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus" >> ${GITHUB_OUTPUT}
echo CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
echo 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 CMAKE_C_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor" >> ${GITHUB_OUTPUT}
echo CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus" >> ${GITHUB_OUTPUT}
echo CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
echo CMAKE_Swift_FLAGS="-Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf" >> ${GITHUB_OUTPUT}
fi
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}
- 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:
arch: ['amd64', 'arm64', 'x86']
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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-${{ matrix.arch }}-sqlite
variant: sccache
- name: Configure SQLite
run: |
cmake -B ${{ github.workspace }}/BinaryCache/sqlite-3.43.2 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/sqlite-3.43.2/usr `
-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.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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-amd64-icu_tools
variant: sccache
- 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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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
icu:
needs: [context, icu_tools]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: 'amd64'
BUILD_TOOLS: NO
- arch: 'arm64'
BUILD_TOOLS: NO
- arch: 'x86'
BUILD_TOOLS: YES
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
- 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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-${{ matrix.arch }}-icu
variant: sccache
- name: Configure ICU
run: |
cmake -B ${{ github.workspace }}/BinaryCache/icu-69.1 `
-D BUILD_SHARED_LIBS=NO `
-D BUILD_TOOLS=${{ matrix.BUILD_TOOLS }} `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D ICU_TOOLS_DIR=${{ github.workspace }}/BinaryCache/icu-tools-69.1/usr/bin `
-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.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: compnerd/[email protected]
with:
max-size: 1M
key: sccache-windows-${{ matrix.arch }}-cmark-gfm
variant: sccache
- 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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-amd64-build_tools
variant: sccache
- 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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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 }}'
# TODO(lxbndr) use actions/cache to improve this step timings
- name: Install Python ${{ env.PYTHON_VERSION }} (arm64)
if: matrix.arch == 'arm64'
run: |
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
toolset_version: 14.37.32822
components: 'Microsoft.VisualStudio.Component.VC.14.37.17.7.x86.x64;Microsoft.VisualStudio.Component.VC.14.37.17.7.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'
- name: Workaround MSVC#10444970
if: matrix.arch == 'arm64'
run: |
$clangTooling = "${{ github.workspace }}/SourceCache/llvm-project/clang/lib/Tooling/Inclusions/Stdlib/CMakeLists.txt"
Set-Content $clangTooling @"
$(Get-Content -Raw $clangTooling)
set_source_files_properties(StandardLibrary.cpp PROPERTIES
COMPILE_FLAGS "/Od /Gw /Oi /Oy /Gw /Ob2 /Ot /GF")
"@
$clangCodeGen = "${{ github.workspace }}/SourceCache/llvm-project/clang/lib/CodeGen/CMakeLists.txt"
Set-Content $clangCodeGen @"
$(Get-Content -Raw $clangCodeGen)
set_source_files_properties(CGBuiltin.cpp PROPERTIES
COMPILE_FLAGS "/Od /Gw /Oi /Oy /Gw /Ob2 /Ot /GF")
"@
- name: Setup sccache
uses: compnerd/[email protected]
with:
max-size: 500M
key: sccache-windows-${{ matrix.arch }}-compilers
variant: sccache
- name: Configure Compilers
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}
$CLANG_LOCATION = cygpath -m (Split-Path (Get-Command clang-cl).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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_Swift_COMPILER="${SWIFTC}" `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`"" `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.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.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}", '<BINARY_DIR>') | 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
- uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache/1
zlib:
needs: [context]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
arch: ['amd64', 'arm64', 'x86']
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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-${{ matrix.arch }}-zlib
variant: sccache
- name: Configure zlib
run: |
cmake -B ${{ github.workspace }}/BinaryCache/zlib-1.3 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/zlib-1.3/usr `
-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.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:
arch: ['amd64', 'arm64', 'x86']
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.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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-${{ matrix.arch }}-curl
variant: sccache
- name: Configure curl
run: |
cmake -B ${{ github.workspace }}/BinaryCache/curl-7.77.0 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr `
-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=YES `
-D CURL_USE_WOLFSSL=NO `
-D CURL_WINDOWS_SSPI=YES `
-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=YES `
-D USE_WIN32_LARGE_FILES=YES `
-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
- 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.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:
arch: ['amd64', 'arm64', 'x86']
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: compnerd/[email protected]
with:
max-size: 100M
key: sccache-windows-${{ matrix.arch }}-libxml2
variant: sccache
- name: Configure libxml2
run: |
cmake -B ${{ github.workspace }}/BinaryCache/libxml2-2.11.5 `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr `
-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
- 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.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'
- arch: 'arm64'
cpu: 'aarch64'
triple: 'aarch64-unknown-windows-msvc'
- arch: 'x86'
cpu: 'i686'
triple: 'i686-unknown-windows-msvc'
steps:
- uses: actions/download-artifact@v4
with:
name: icu-${{ matrix.arch }}-69.1
path: ${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr
- uses: actions/download-artifact@v4
with:
name: libxml2-${{ matrix.arch }}-2.11.5
path: ${{ github.workspace }}/BuildRoot/Library/libxml2-2.11.5/usr
- uses: actions/download-artifact@v4
with:
name: curl-${{ matrix.arch }}-7.77.0
path: ${{ github.workspace }}/BuildRoot/Library/curl-7.77.0/usr
- uses: actions/download-artifact@v4
with:
name: zlib-${{ 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
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
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'
- name: Configure LLVM
run: |
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/llvm `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=cl `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr `
-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
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/swift `
-C ${{ github.workspace }}/SourceCache/swift/cmake/caches/Runtime-Windows-${{ matrix.cpu }}.cmake `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_C_COMPILER=${CLANG_CL} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr `
-D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_SHARED_LINKER_FLAGS }}" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_FLAGS="${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
-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_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
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/libdispatch `
-D BUILD_SHARED_LIBS=YES `
-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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr `
-D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_SHARED_LINKER_FLAGS }}" `
-D CMAKE_SWIFT_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift/windows -vfsoverlay ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
-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
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=${CLANG_CL} `
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_C_FLAGS="${{ needs.context.outputs.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr `
-D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_SHARED_LINKER_FLAGS }}" `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift/windows -vfsoverlay ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}" `
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
-D CMAKE_SYSTEM_NAME=Windows `
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
-D MSVC_C_ARCHITECTURE_ID=${{ matrix.arch }} `
-D MSVC_CXX_ARCHITECTURE_ID=${{ matrix.arch }} `
-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 ENABLE_TESTING=NO `
-D ICU_DATA_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/sicudt69.lib `
-D ICU_I18N_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/sicuin69.lib `
-D ICU_ROOT=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr `
-D ICU_UC_LIBRARY_RELEASE=${{ github.workspace }}/BuildRoot/Library/icu-69.1/usr/lib/sicuuc69.lib `
-D LIBXML2_DEFINITIONS="/DLIBXML_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/libxml2s.lib `
-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
- 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
Remove-Item env:\SDKROOT
cmake -B ${{ github.workspace }}/BinaryCache/xctest `
-D BUILD_SHARED_LIBS=YES `
-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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.CMAKE_CXX_FLAGS }}" `
-D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_EXE_LINKER_FLAGS }}" `
-D CMAKE_MT=mt `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/Library/XCTest-development/usr `
-D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.CMAKE_SHARED_LINKER_FLAGS }}" `
-D CMAKE_Swift_COMPILER=${SWIFTC} `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_Swift_FLAGS="-resource-dir ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift -L${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift/windows -vfsoverlay ${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules ${{ 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-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/Windows.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/Windows.platform/Developer/SDKs/Windows.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: windows-sdk-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
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-${{ 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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=cl `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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: 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.CMAKE_C_FLAGS }}" `
-D CMAKE_CXX_COMPILER=${CLANG_CL} `
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
-D CMAKE_CXX_FLAGS="${{ needs.context.outputs.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 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.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: 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('<BINARY_DIR>', "${bindir}") | Set-Content $module
- 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.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.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.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.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.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
- uses: microsoft/[email protected]
if: ${{ needs.context.outputs.debug_info }}
with:
accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }}
personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }}
symbolsFolder: ${{ github.workspace }}/BinaryCache
package_tools:
name: Package Tools
needs: [context, compilers, devtools]
runs-on: ${{ needs.context.outputs.windows_build_runner }}
strategy:
fail-fast: false
matrix:
arch: ['amd64' , 'arm64']
steps:
- name: Download Compilers
uses: actions/download-artifact@v4
with:
name: compilers-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library
- uses: actions/download-artifact@v4
with:
name: devtools-${{ matrix.arch }}
path: ${{ github.workspace }}/BuildRoot/Library
- 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: 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:SWIFT_INSPECT_BUILD=false `
-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: 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
installer:
needs: [context, package_tools, package_sdk_runtime]
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/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: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]
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/main
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:main
fi
release:
runs-on: ubuntu-latest
needs: [context, smoke_test]
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
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ needs.context.outputs.swift_tag }}
tag_name: ${{ needs.context.outputs.swift_tag }}
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/octet-stream
asset_name: installer-amd64.exe
asset_path: ${{ github.workspace }}/tmp/amd64/installer.exe
upload_url: ${{ steps.create_release.outputs.upload_url }}
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: application/octet-stream
asset_name: installer-arm64.exe
asset_path: ${{ github.workspace }}/tmp/arm64/installer.exe
upload_url: ${{ steps.create_release.outputs.upload_url }}