diff --git a/.github/workflows/release-binaries-all.yml b/.github/workflows/release-binaries-all.yml index 0b52a08202f1a..e9a2f7fb295cc 100644 --- a/.github/workflows/release-binaries-all.yml +++ b/.github/workflows/release-binaries-all.yml @@ -88,10 +88,7 @@ jobs: # We use ubuntu-22.04 rather than the latest version to make the built # binaries more portable (eg functional aginast older glibc). runs-on: - - ubuntu-22.04 - - ubuntu-22.04-arm - - macos-13 - - macos-14 + - windows-2022 uses: ./.github/workflows/release-binaries.yml with: diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index c113b42dc8ed4..a4b5f63f1af8a 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -23,6 +23,7 @@ on: - ubuntu-22.04-arm - macos-13 - macos-14 + - windows-2022 workflow_call: inputs: @@ -66,6 +67,8 @@ jobs: test-runs-on: ${{ steps.vars.outputs.build-runs-on }} steps: + - run: | + New-Item -Path "c:\actions-runner\llvm-project\llvm-project\build\tools\clang\tools\extra\clang-tidy\misc\ConfusableTable\CMakeFiles\clang-tidy-confusable-chars-gen.dir\C_\actions-runner\llvm-project\llvm-project\llvm" -ItemType Directory # It's good practice to use setup-python, but this is also required on macos-14 # due to https://github.com/actions/runner-images/issues/10385 - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f @@ -89,6 +92,9 @@ jobs: run: | ./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user "$GITHUB_ACTOR" --user-token "$USER_TOKEN" check-permissions + - name: Check long paths + run: | + Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' - name: Collect Variables id: vars shell: bash @@ -118,9 +124,15 @@ jobs: echo "ref=$ref" >> $GITHUB_OUTPUT echo "upload=$upload" >> $GITHUB_OUTPUT + if [ "$RUNNER_OS" = "Windows" ]; then + release_binary_suffix="exe" + else + release_binary_suffix="tar.xz" + fi + release_binary_basename="LLVM-$release_version-$RUNNER_OS-$RUNNER_ARCH" echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT - echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT + echo "release-binary-filename=$release_binary_basename.$release_binary_suffix" >> $GITHUB_OUTPUT target="$RUNNER_OS-$RUNNER_ARCH" # The hendrikmuhs/ccache-action action does not support installing sccache @@ -151,15 +163,10 @@ jobs: build_flang="true" - if [ "$RUNNER_OS" = "Windows" ]; then - # The build times out on Windows, so we need to disable LTO. - target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF" - fi - echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT echo "build-flang=$build_flang" >> $GITHUB_OUTPUT case "${{ inputs.runs-on }}" in - ubuntu-22.04*) + ubuntu-22.04*|windows-2022) build_runs_on="depot-${{ inputs.runs-on }}-16" test_runs_on=$build_runs_on ;; @@ -193,7 +200,9 @@ jobs: if: github.repository_owner == 'llvm' runs-on: ${{ needs.prepare.outputs.build-runs-on }} steps: - + - name: Check long paths + run: | + Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' - name: Checkout Actions uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -241,14 +250,23 @@ jobs: ${{ needs.prepare.outputs.target-cmake-flags }} \ -C clang/cmake/caches/Release.cmake \ -DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \ + -DCMAKE_OBJECT_PATH_MAX=450 \ -DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" - - name: Build + - name: Build Unix shell: bash + if: runner.os != 'Windows' run: | ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package release_dir=`find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname 'stage2-bins'` mv $release_dir/${{ needs.prepare.outputs.release-binary-filename }} . + + # There is an issue with building on Windows with bash so we use power shell. + # ninja: error: mkdir(tools/clang/tools/extra/clang-tidy/misc/ConfusableTable/CMakeFiles/clang-tidy-confusable-chars-gen.dir/C_/actions-runner/llvm-project/llvm-project/llvm): No such file or directory + - name: Build Windows + if: runner.os == 'Windows' + run: | + ninja -v -C build stage2-package - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0 with: @@ -270,6 +288,11 @@ jobs: with: build-prefix: ${{ steps.setup-stage.outputs.build-prefix }} + - name: Check Disk + if: always() + run: | + Get-WmiObject -Class Win32_LogicalDisk -ComputerName LOCALHOST | ? {$_. DriveType -eq 3} | select DeviceID, {$_.Size /1GB}, {$_.FreeSpace /1GB} + upload-release-binaries: name: "Upload Release Binaries" needs: diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake index fb12dfcdcb5a5..97f7439f21b47 100644 --- a/clang/cmake/caches/Release.cmake +++ b/clang/cmake/caches/Release.cmake @@ -56,7 +56,7 @@ set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") set(STAGE1_PROJECTS "clang") # Build all runtimes so we can statically link them into the stage2 compiler. -set(STAGE1_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind") +set(STAGE1_RUNTIMES ${DEFAULT_RUNTIMES}) if (LLVM_RELEASE_ENABLE_PGO) list(APPEND STAGE1_PROJECTS "lld") @@ -140,7 +140,12 @@ set_final_stage_var(LLVM_ENABLE_PROJECTS "${LLVM_RELEASE_ENABLE_PROJECTS}" STRIN if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") set_final_stage_var(CLANG_BOLT "INSTRUMENT" STRING) endif() -set_final_stage_var(CPACK_GENERATOR "TXZ" STRING) +# We want to generate an installer on Windows. +if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows") + set_final_stage_var(CPACK_GENERATOR "TXZ" STRING) +else() + set_final_stage_var(CMAKE_OBJECT_PATH_MAX "1024" STRING) +endif() set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING) set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL)