From b5a1dc1d6ab424f1098005cb214f668301d53280 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sun, 19 Jan 2025 22:59:54 +0000 Subject: [PATCH 01/25] [Github][CI] Add Windows Premerge Job for Testing This patch adds a windows premerge job for testing. We plan to enable this by default soon once we have evaluated stability and have reasonably reason to believe the system is reliable. --- .github/workflows/premerge.yaml | 48 +++------------------------------ 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 30f4fc807f3a5..1b6b10a8b7c3e 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -12,11 +12,11 @@ on: - 'main' jobs: - premerge-checks-linux: + premerge-checks-windows: if: github.repository_owner == 'llvm' - runs-on: llvm-premerge-linux-runners + runs-on: llvm-premerge-windows-runners concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true steps: - name: Checkout LLVM @@ -25,48 +25,8 @@ jobs: fetch-depth: 2 - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2.14 - with: - max-size: "2000M" - name: Build and Test - # Mark the job as a success even if the step fails so that people do - # not get notified while the new premerge pipeline is in an - # experimental state. - # TODO(boomanaiden154): Remove this once the pipeline is stable and we - # are ready for people to start recieving notifications. continue-on-error: true run: | - git config --global --add safe.directory '*' - - modified_files=$(git diff --name-only HEAD~1...HEAD) - modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u) - - echo $modified_files - echo $modified_dirs - - . ./.ci/compute-projects.sh - - all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl" - modified_projects="$(keep-modified-projects ${all_projects})" - - linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects})) - linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) - linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) - - linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) - linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) - linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq) - - if [[ "${linux_projects}" == "" ]]; then - echo "No projects to build" - exit 0 - fi - - echo "Building projects: ${linux_projects}" - echo "Running project checks targets: ${linux_check_targets}" - echo "Building runtimes: ${linux_runtimes}" - echo "Running runtimes checks targets: ${linux_runtime_check_targets}" - - export CC=/opt/llvm/bin/clang - export CXX=/opt/llvm/bin/clang++ + echo test - ./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})" From 2ea666ec16719bfa9f56384bbe8114eb6c8b88f8 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 20 Jan 2025 06:04:30 +0000 Subject: [PATCH 02/25] change shell --- .github/workflows/premerge.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 1b6b10a8b7c3e..a353ffeb133ee 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -18,6 +18,9 @@ jobs: concurrency: group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true + defaults: + run: + shell: bash steps: - name: Checkout LLVM uses: actions/checkout@v4 From cc4a4ddd4904befaead8b65256eb3aa39ff935a2 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 20 Jan 2025 06:22:14 +0000 Subject: [PATCH 03/25] force sccache --- .github/workflows/premerge.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index a353ffeb133ee..39bc4837d2635 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -28,6 +28,8 @@ jobs: fetch-depth: 2 - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2.14 + with: + variant: "sccache" - name: Build and Test continue-on-error: true run: | From eccfebfc9bf2f976e52951edb826cb2b08100216 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 20 Jan 2025 06:27:18 +0000 Subject: [PATCH 04/25] compute projects --- .github/workflows/premerge.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 39bc4837d2635..eb33b4dbe058f 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -33,5 +33,14 @@ jobs: - name: Build and Test continue-on-error: true run: | - echo test + modified_files=$(git diff --name-only HEAD~1...HEAD) + modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u) + + echo $modified_files + echo $modified_dirs + + . ./.ci/compute-projects.sh + + all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl" + modified_projects="$(keep-modified-projects ${all_projects})" From 7ee39254c56fa7a04a56bfe61b21505c90daf041 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 20 Jan 2025 06:31:19 +0000 Subject: [PATCH 05/25] More testing --- .github/workflows/premerge.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index eb33b4dbe058f..3a3c3a71e08a4 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -44,3 +44,17 @@ jobs: all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl" modified_projects="$(keep-modified-projects ${all_projects})" + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects})) + windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) + windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) + + if [[ "${windows_projects}" == "" ]]; then + echo "No projects to build" + exit 0 + fi + + echo "Building projects: ${windows_projects}" + echo "Running project checks targets: ${windows_check_targets}" + + .ci/monolithic-windows.sh "$(echo ${windows_projects} | tr ' ' ';')" "$(echo ${windows_check_targets})" + From 5a85ff241c676594dee3901cc85044ed709259ed Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 20 Jan 2025 06:40:57 +0000 Subject: [PATCH 06/25] adapt to windows sort --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 3a3c3a71e08a4..f6b409af9c8b5 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -34,7 +34,7 @@ jobs: continue-on-error: true run: | modified_files=$(git diff --name-only HEAD~1...HEAD) - modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u) + modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort | uniq) echo $modified_files echo $modified_dirs From b80ae16cd820c9893035f189d004d358b9e60db3 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Thu, 23 Jan 2025 08:41:16 +0000 Subject: [PATCH 07/25] test --- .ci/monolithic-windows.sh | 8 +++++--- .github/workflows/premerge.yaml | 15 +++++++++++---- llvm/CMakeLists.txt | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh index 68303a3ea153a..43a8f23498718 100755 --- a/.ci/monolithic-windows.sh +++ b/.ci/monolithic-windows.sh @@ -50,6 +50,10 @@ echo "--- cmake" pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt +export CC=cl +export CXX=cl +export LD=link + # The CMAKE_*_LINKER_FLAGS to disable the manifest come from research # on fixing a build reliability issue on the build server, please # see https://github.com/llvm/llvm-project/pull/82393 and @@ -71,9 +75,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D MLIR_ENABLE_BINDINGS_PYTHON=ON \ -D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \ -D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \ - -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \ - -D LLVM_PARALLEL_COMPILE_JOBS=16 \ - -D LLVM_PARALLEL_LINK_JOBS=4 + -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index f6b409af9c8b5..f53c7615a4bf4 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -30,8 +30,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.14 with: variant: "sccache" - - name: Build and Test - continue-on-error: true + - name: Compute Projects + id: vars run: | modified_files=$(git diff --name-only HEAD~1...HEAD) modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort | uniq) @@ -56,5 +56,12 @@ jobs: echo "Building projects: ${windows_projects}" echo "Running project checks targets: ${windows_check_targets}" - .ci/monolithic-windows.sh "$(echo ${windows_projects} | tr ' ' ';')" "$(echo ${windows_check_targets})" - + #echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT + #echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT + echo "windows-projects=llvm" >> $GITHUB_OUTPUT + echo "windows-check-targets=check-llvm" >> $GITHUB_OUTPUT + - name: Build and Test + shell: cmd + run: | + call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 + bash .ci/monolithic-windows.sh "llvm;clang" "check-llvm check-clang" diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index ad12100fdb5b8..3ea8f6e17a638 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -1,5 +1,5 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. - +# comment cmake_minimum_required(VERSION 3.20.0) include(CMakeDependentOption) From 44ec1393e6bd96afa808fbac9169027d219af1cd Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 05:55:30 +0000 Subject: [PATCH 08/25] More testing --- .github/workflows/premerge.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index f53c7615a4bf4..c46fe08f6c711 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -56,12 +56,12 @@ jobs: echo "Building projects: ${windows_projects}" echo "Running project checks targets: ${windows_check_targets}" - #echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT - #echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT - echo "windows-projects=llvm" >> $GITHUB_OUTPUT - echo "windows-check-targets=check-llvm" >> $GITHUB_OUTPUT + echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT + echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT - name: Build and Test shell: cmd run: | - call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 - bash .ci/monolithic-windows.sh "llvm;clang" "check-llvm check-clang" + echo "$ {{ steps.vars.outputs.windows-projects }}" + echo "$ {{ steps.vars.outputs.windows-check-targets }}" + #call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 + #bash .ci/monolithic-windows.sh "llvm;clang" "check-llvm check-clang" From 46f060cff3fa4b02a69dfec5c4f3841aa3ef93fd Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 05:59:56 +0000 Subject: [PATCH 09/25] try tr --- .github/workflows/premerge.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index c46fe08f6c711..cd342d00dcfa6 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -45,8 +45,8 @@ jobs: modified_projects="$(keep-modified-projects ${all_projects})" windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects})) - windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) - windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) + windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr '\n' ' ') + windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr '\n' ';') if [[ "${windows_projects}" == "" ]]; then echo "No projects to build" From 6d1da7214f59f185fa60261642b56393932e7e62 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:09:10 +0000 Subject: [PATCH 10/25] testing --- .github/workflows/premerge.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index cd342d00dcfa6..ba2ff89df9927 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -45,14 +45,18 @@ jobs: modified_projects="$(keep-modified-projects ${all_projects})" windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects})) - windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr '\n' ' ') - windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr '\n' ';') + windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) + windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) if [[ "${windows_projects}" == "" ]]; then echo "No projects to build" exit 0 fi + echo blah1 + echo "${windows_projects}" | tr '\n' ';' + echo blah2 + echo "Building projects: ${windows_projects}" echo "Running project checks targets: ${windows_check_targets}" From 0b8707c4850a9ebeb2c4669ea63fa2be754a0484 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:12:35 +0000 Subject: [PATCH 11/25] windows line endings --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index ba2ff89df9927..7fafc4bc018c5 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -54,7 +54,7 @@ jobs: fi echo blah1 - echo "${windows_projects}" | tr '\n' ';' + echo "${windows_projects}" | tr '\r\n' ';' echo blah2 echo "Building projects: ${windows_projects}" From 0da5e37a86cdb1e7f417cf69d899750ab1c04767 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:16:51 +0000 Subject: [PATCH 12/25] more testing --- .github/workflows/premerge.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 7fafc4bc018c5..fffa564e74dd8 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -45,18 +45,14 @@ jobs: modified_projects="$(keep-modified-projects ${all_projects})" windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects})) - windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) - windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) + windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr '\015' ' ') + windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr '\015' ';') if [[ "${windows_projects}" == "" ]]; then echo "No projects to build" exit 0 fi - echo blah1 - echo "${windows_projects}" | tr '\r\n' ';' - echo blah2 - echo "Building projects: ${windows_projects}" echo "Running project checks targets: ${windows_check_targets}" From 79c8d86aa7b40e17aa84140a5771f58b4a0f01f7 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:20:00 +0000 Subject: [PATCH 13/25] more testing --- .github/workflows/premerge.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index fffa564e74dd8..dab775454d143 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -45,8 +45,8 @@ jobs: modified_projects="$(keep-modified-projects ${all_projects})" windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects})) - windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr '\015' ' ') - windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr '\015' ';') + windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ' ') + windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ';') if [[ "${windows_projects}" == "" ]]; then echo "No projects to build" From dc1d060e1713cd9ca27ebd3ada28e86a933fb842 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:22:46 +0000 Subject: [PATCH 14/25] Try changing vars --- .github/workflows/premerge.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index dab775454d143..03820b52950d3 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -61,7 +61,7 @@ jobs: - name: Build and Test shell: cmd run: | - echo "$ {{ steps.vars.outputs.windows-projects }}" - echo "$ {{ steps.vars.outputs.windows-check-targets }}" + echo "${{ steps.vars.outputs.windows-projects }}" + echo "${{ steps.vars.outputs.windows-check-targets }}" #call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 #bash .ci/monolithic-windows.sh "llvm;clang" "check-llvm check-clang" From 0b32e2ec5e49fe726333e45d98e6c398418c8f99 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 24 Jan 2025 06:25:58 +0000 Subject: [PATCH 15/25] maybe --- .github/workflows/premerge.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 03820b52950d3..6135946f6568c 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -61,7 +61,6 @@ jobs: - name: Build and Test shell: cmd run: | - echo "${{ steps.vars.outputs.windows-projects }}" - echo "${{ steps.vars.outputs.windows-check-targets }}" - #call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 - #bash .ci/monolithic-windows.sh "llvm;clang" "check-llvm check-clang" + call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 + bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}" + From a7a3aafc5f2c404afb9f75f06c706e26e58b1cbb Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 06:02:41 +0000 Subject: [PATCH 16/25] set flags --- .github/workflows/premerge.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 6135946f6568c..4d4f5d939e097 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -61,6 +61,8 @@ jobs: - name: Build and Test shell: cmd run: | + set MAX_PARALLEL_COMPILE_JOBS=64 + set MAX_PARALLEL_LINK_JOBS=64 call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64 bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}" From 970bcee8152d8525b72b2e7275847c97633d3fe5 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 06:16:57 +0000 Subject: [PATCH 17/25] Try using new volume --- .github/workflows/premerge.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 4d4f5d939e097..2c14502182bef 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -21,6 +21,7 @@ jobs: defaults: run: shell: bash + working-directory: C:\build steps: - name: Checkout LLVM uses: actions/checkout@v4 From d56623fce96d15e21d650e4e186e0debca5f2137 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 06:35:33 +0000 Subject: [PATCH 18/25] reset dir --- .github/workflows/premerge.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 2c14502182bef..4d4f5d939e097 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -21,7 +21,6 @@ jobs: defaults: run: shell: bash - working-directory: C:\build steps: - name: Checkout LLVM uses: actions/checkout@v4 From 674d417a548c6b6c9f16c0223de71b912d8e0628 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:33:03 +0000 Subject: [PATCH 19/25] Readd Linux --- .github/workflows/premerge.yaml | 65 +++++++++++++++++++++++++++++++++ llvm/CMakeLists.txt | 1 - 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 4d4f5d939e097..888d28bf2174d 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -12,6 +12,65 @@ on: - 'main' jobs: + premerge-checks-linux: + if: github.repository_owner == 'llvm' + runs-on: llvm-premerge-linux-runners + concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + steps: + - name: Checkout LLVM + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + max-size: "2000M" + - name: Build and Test + # Mark the job as a success even if the step fails so that people do + # not get notified while the new premerge pipeline is in an + # experimental state. + # TODO(boomanaiden154): Remove this once the pipeline is stable and we + # are ready for people to start recieving notifications. + continue-on-error: true + run: | + git config --global --add safe.directory '*' + + modified_files=$(git diff --name-only HEAD~1...HEAD) + modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u) + + echo $modified_files + echo $modified_dirs + + . ./.ci/compute-projects.sh + + all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl" + modified_projects="$(keep-modified-projects ${all_projects})" + + linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects})) + linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) + linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) + + linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) + linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) + linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq) + + if [[ "${linux_projects}" == "" ]]; then + echo "No projects to build" + exit 0 + fi + + echo "Building projects: ${linux_projects}" + echo "Running project checks targets: ${linux_check_targets}" + echo "Building runtimes: ${linux_runtimes}" + echo "Running runtimes checks targets: ${linux_runtime_check_targets}" + + export CC=/opt/llvm/bin/clang + export CXX=/opt/llvm/bin/clang++ + + ./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})" + premerge-checks-windows: if: github.repository_owner == 'llvm' runs-on: llvm-premerge-windows-runners @@ -59,6 +118,12 @@ jobs: echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT - name: Build and Test + # Mark the job as a success even if the step fails so that people do + # not get notified while the new premerge pipeline is in an + # experimental state. + # TODO(boomanaiden154): Remove this once the pipeline is stable and we + # are ready for people to start recieving notifications. + continue-on-error: true shell: cmd run: | set MAX_PARALLEL_COMPILE_JOBS=64 diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 3ea8f6e17a638..01d2f0b9a5da3 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -1,5 +1,4 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. -# comment cmake_minimum_required(VERSION 3.20.0) include(CMakeDependentOption) From f4dd685c5d34bd076bf72568b6e7fbbd04d75e21 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:34:06 +0000 Subject: [PATCH 20/25] Fix llvm changes --- llvm/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 01d2f0b9a5da3..ad12100fdb5b8 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -1,4 +1,5 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. + cmake_minimum_required(VERSION 3.20.0) include(CMakeDependentOption) From 788f16011796a8d41ca273a1c65b75fb4e6f0fb2 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:34:28 +0000 Subject: [PATCH 21/25] bump cache size --- .github/workflows/premerge.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 888d28bf2174d..779128ba7e90d 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -89,6 +89,7 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.14 with: variant: "sccache" + max-size: "2000M" - name: Compute Projects id: vars run: | From 1390ec9db08a11346cb251974efbca6426c16c31 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:36:24 +0000 Subject: [PATCH 22/25] Add OS name to concurrency group --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 779128ba7e90d..e64ea67385254 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -16,7 +16,7 @@ jobs: if: github.repository_owner == 'llvm' runs-on: llvm-premerge-linux-runners concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true steps: - name: Checkout LLVM From 557ba3d34cff9b8371db19f84175bf98b9e26f52 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:44:01 +0000 Subject: [PATCH 23/25] thing --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index e64ea67385254..deaf0480d618f 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -110,7 +110,6 @@ jobs: if [[ "${windows_projects}" == "" ]]; then echo "No projects to build" - exit 0 fi echo "Building projects: ${windows_projects}" @@ -125,6 +124,7 @@ jobs: # TODO(boomanaiden154): Remove this once the pipeline is stable and we # are ready for people to start recieving notifications. continue-on-error: true + if: ${{ steps.vars.outputs.windows-projects == "" }} shell: cmd run: | set MAX_PARALLEL_COMPILE_JOBS=64 From 777c2308c081dff023ff22a19d45d25f8cf5a518 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:46:20 +0000 Subject: [PATCH 24/25] try again --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index deaf0480d618f..7e42082e46105 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -124,7 +124,7 @@ jobs: # TODO(boomanaiden154): Remove this once the pipeline is stable and we # are ready for people to start recieving notifications. continue-on-error: true - if: ${{ steps.vars.outputs.windows-projects == "" }} + if: ${{ steps.vars.outputs.windows-projects == '' }} shell: cmd run: | set MAX_PARALLEL_COMPILE_JOBS=64 From 418a3ba5db83c75e4660e9bb12bbf905b3dadf6f Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 25 Jan 2025 07:50:04 +0000 Subject: [PATCH 25/25] get working --- .github/workflows/premerge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml index 7e42082e46105..54d6e1bf092cf 100644 --- a/.github/workflows/premerge.yaml +++ b/.github/workflows/premerge.yaml @@ -124,7 +124,7 @@ jobs: # TODO(boomanaiden154): Remove this once the pipeline is stable and we # are ready for people to start recieving notifications. continue-on-error: true - if: ${{ steps.vars.outputs.windows-projects == '' }} + if: ${{ steps.vars.outputs.windows-projects != '' }} shell: cmd run: | set MAX_PARALLEL_COMPILE_JOBS=64