diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index d8d45276c..caa5ff783 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -783,45 +783,65 @@ jobs: triple: 'aarch64-unknown-windows-msvc' steps: + - name: Create Dev Drive using ReFS + run: | + $Volume = New-VHD -Path C:/uv_dev_drive.vhdx -SizeBytes 500GB | + Mount-VHD -Passthru | + Initialize-Disk -Passthru | + New-Partition -AssignDriveLetter -UseMaximumSize | + Format-Volume -FileSystem ReFS -Confirm:$false -Force + Write-Output $Volume + Write-Output "DEV_DRIVE=$($Volume.DriveLetter):" >> $env:GITHUB_ENV + - name: Copy Git Repo to Dev Drive & Add Symbolic Link + run: | + Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}" -Recurse + mkdir "${{ github.workspace }}/refs" + New-Item -Path "${{ github.workspace }}/refs" -ItemType SymbolicLink -Value "${{ env.DEV_DRIVE }}" + - uses: actions/download-artifact@v4 with: name: build-tools - path: ${{ github.workspace }}/BinaryCache/0/bin + path: ${{ env.DEV_DRIVE }}/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 + path: ${{ env.DEV_DRIVE }}/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 + path: ${{ env.DEV_DRIVE }}/SourceCache/llvm-project show-progress: false + symlink: true - uses: actions/checkout@v4 with: repository: apple/swift ref: ${{ needs.context.outputs.swift_revision }} - path: ${{ github.workspace }}/SourceCache/swift + path: ${{ env.DEV_DRIVE }}/SourceCache/swift show-progress: false + symlink: true - 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 + path: ${{ env.DEV_DRIVE }}/SourceCache/swift-experimental-string-processing show-progress: false + symlink: true - uses: actions/checkout@v4 with: repository: apple/swift-syntax ref: ${{ needs.context.outputs.swift_syntax_revision }} - path: ${{ github.workspace }}/SourceCache/swift-syntax + path: ${{ env.DEV_DRIVE }}/SourceCache/swift-syntax show-progress: false + symlink: true - 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 + path: ${{ env.DEV_DRIVE }}/SourceCache/swift-corelibs-libdispatch show-progress: false + symlink: true - name: Install Python ${{ env.PYTHON_VERSION }} (Host) uses: actions/setup-python@v5 @@ -845,7 +865,7 @@ jobs: - 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 + echo "PYTHON_LOCATION_arm64=${{ env.DEV_DRIVE }}\pythonarm64.${{ env.PYTHON_VERSION }}\tools" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - uses: compnerd/gha-setup-vsdevenv@main with: @@ -884,7 +904,7 @@ jobs: $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 + (Get-Content ${{ env.DEV_DRIVE }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake).Replace(' runtimes', '') | Set-Content ${{ env.DEV_DRIVE }}/SourceCache/swift/cmake/caches/Windows-aarch64.cmake } else { $CACHE="Windows-x86_64.cmake" } @@ -893,8 +913,8 @@ jobs: # Use toolchain clang to avoid broken __prefetch intrinsic on arm64 in Clang 18. $CLANG_LOCATION = cygpath -m (Split-Path (Get-Command swiftc).Source) Remove-Item env:\SDKROOT - cmake -B ${{ github.workspace }}/BinaryCache/1 ` - -C ${{ github.workspace }}/SourceCache/swift/cmake/caches/${CACHE} ` + cmake -B ${{ env.DEV_DRIVE }}/BinaryCache/1 ` + -C ${{ env.DEV_DRIVE }}/SourceCache/swift/cmake/caches/${CACHE} ` -D CMAKE_BUILD_TYPE=Release ` -D CMAKE_C_COMPILER=cl ` -D CMAKE_C_COMPILER_LAUNCHER=sccache ` @@ -907,19 +927,19 @@ jobs: -D CMAKE_Swift_COMPILER_WORKS=YES ` -D CMAKE_Swift_FLAGS="-sdk `"${SDKROOT}`" -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" ` -D CMAKE_EXE_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" ` - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` + -D CMAKE_INSTALL_PREFIX=${{ env.DEV_DRIVE }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ` -D CMAKE_SHARED_LINKER_FLAGS="${{ needs.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" ` ${CMAKE_SYSTEM_NAME} ` ${CMAKE_SYSTEM_PROCESSOR} ` -G Ninja ` - -S ${{ github.workspace }}/SourceCache/llvm-project/llvm ` - -D CLANG_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tblgen.exe ` - -D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ github.workspace }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe ` - -D LLDB_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/lldb-tblgen.exe ` - -D LLVM_CONFIG_PATH=${{ github.workspace }}/BinaryCache/0/bin/llvm-config.exe ` - -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ github.workspace }}/SourceCache/swift ` - -D LLVM_NATIVE_TOOL_DIR=${{ github.workspace }}/BinaryCache/0/bin ` - -D LLVM_TABLEGEN=${{ github.workspace }}/BinaryCache/0/bin/llvm-tblgen.exe ` + -S ${{ env.DEV_DRIVE }}/SourceCache/llvm-project/llvm ` + -D CLANG_TABLEGEN=${{ env.DEV_DRIVE }}/BinaryCache/0/bin/clang-tblgen.exe ` + -D CLANG_TIDY_CONFUSABLE_CHARS_GEN=${{ env.DEV_DRIVE }}/BinaryCache/0/bin/clang-tidy-confusable-chars-gen.exe ` + -D LLDB_TABLEGEN=${{ env.DEV_DRIVE }}/BinaryCache/0/bin/lldb-tblgen.exe ` + -D LLVM_CONFIG_PATH=${{ env.DEV_DRIVE }}/BinaryCache/0/bin/llvm-config.exe ` + -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=${{ env.DEV_DRIVE }}/SourceCache/swift ` + -D LLVM_NATIVE_TOOL_DIR=${{ env.DEV_DRIVE }}/BinaryCache/0/bin ` + -D LLVM_TABLEGEN=${{ env.DEV_DRIVE }}/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 ` @@ -933,14 +953,14 @@ jobs: -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_NATIVE_SWIFT_TOOLS_PATH=${{ env.DEV_DRIVE }}/BinaryCache/0/bin ` + -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=${{ env.DEV_DRIVE }}/SourceCache/swift-corelibs-libdispatch ` + -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=${{ env.DEV_DRIVE }}/SourceCache/swift-syntax ` + -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${{ env.DEV_DRIVE }}/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 cmark-gfm_DIR=${{ env.DEV_DRIVE }}/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=8 ` @@ -956,34 +976,34 @@ jobs: -D Python3_ROOT_DIR=$env:pythonLocation - name: Build Compiler Distribution - run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target distribution + run: cmake --build ${{ env.DEV_DRIVE }}/BinaryCache/1 --target distribution - name: Install Compiler Distribution - run: cmake --build ${{ github.workspace }}/BinaryCache/1 --target install-distribution-stripped + run: cmake --build ${{ env.DEV_DRIVE }}/BinaryCache/1 --target install-distribution-stripped - name: Upload Compilers uses: actions/upload-artifact@v4 with: name: compilers-${{ matrix.arch }} - path: ${{ github.workspace }}/BuildRoot/Library + path: ${{ env.DEV_DRIVE }}/BuildRoot/Library - name: extract swift-syntax run: | - $module = "${{ github.workspace }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake" - $bindir = cygpath -m ${{ github.workspace }}/BinaryCache/1 + $module = "${{ env.DEV_DRIVE }}/BinaryCache/1/cmake/modules/SwiftSyntaxConfig.cmake" + $bindir = cygpath -m ${{ env.DEV_DRIVE }}/BinaryCache/1 (Get-Content $module).Replace("${bindir}", '') | Set-Content $module - New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib" - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" - Copy-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse - New-Item -Path ${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null - Copy-Item -Path $module -Destination "${{ github.workspace }}/BinaryCache/swift-syntax/cmake/modules" + New-Item -Path ${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax/lib/swift/host -ItemType Directory | Out-Null + Copy-Item -Path "${{ env.DEV_DRIVE }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax/lib" + Copy-Item -Path "${{ env.DEV_DRIVE }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/*.lib" -Destination "${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax/lib/swift/host" + Copy-Item -Path "${{ env.DEV_DRIVE }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/swift/host/*.swiftmodule" -Destination "${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax/lib/swift/host" -Recurse + New-Item -Path ${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax/cmake/modules -ItemType Directory | Out-Null + Copy-Item -Path $module -Destination "${{ env.DEV_DRIVE }}/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 + path: ${{ env.DEV_DRIVE }}/BinaryCache/swift-syntax # TODO(compnerd) this takes ~1h due to the size, see if we can compress first - uses: actions/upload-artifact@v4 @@ -991,7 +1011,7 @@ jobs: with: name: compilers-${{ matrix.arch }}-debug-info path: | - ${{ github.workspace }}/BinaryCache/1/**/*.pdb + ${{ env.DEV_DRIVE }}/BinaryCache/1/**/*.pdb - name: Upload PDBs to Azure uses: microsoft/action-publish-symbols@v2.1.6 @@ -999,7 +1019,7 @@ jobs: with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + symbolsFolder: ${{ env.DEV_DRIVE }}/BinaryCache/1 searchPattern: '**/*.pdb' - name: Upload DLLs to Azure @@ -1008,7 +1028,7 @@ jobs: with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + symbolsFolder: ${{ env.DEV_DRIVE }}/BinaryCache/1 searchPattern: '**/*.dll' - name: Upload EXEs to Azure @@ -1017,7 +1037,7 @@ jobs: with: accountName: ${{ vars.SYMBOL_SERVER_ACCOUNT }} personalAccessToken: ${{ secrets.SYMBOL_SERVER_PAT }} - symbolsFolder: ${{ github.workspace }}/BinaryCache/1 + symbolsFolder: ${{ env.DEV_DRIVE }}/BinaryCache/1 searchPattern: '**/*.exe' zlib: