From 93ff726114cce9390728d6ff701526f491a14709 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Nov 2022 12:51:34 -0500 Subject: Tests: Fix TryCompile bad source case for clang-cl 15 on Windows When `pass.c bad#source.c` passes through `nmake`, the compiler gets `pass.c bad`. The clang-cl 15 compiler now fails on `bad` with an error that we did not previously match. Update our regex. --- Tests/TryCompile/old_and_new_signature_tests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TryCompile/old_and_new_signature_tests.cmake b/Tests/TryCompile/old_and_new_signature_tests.cmake index ab548f7..1373ad7 100644 --- a/Tests/TryCompile/old_and_new_signature_tests.cmake +++ b/Tests/TryCompile/old_and_new_signature_tests.cmake @@ -117,7 +117,7 @@ try_compile(SHOULD_FAIL_DUE_TO_BAD_SOURCE if(SHOULD_FAIL_DUE_TO_BAD_SOURCE AND NOT CMAKE_GENERATOR MATCHES "Watcom WMake|NMake Makefiles") string(REPLACE "\n" "\n " output " ${output}") message(SEND_ERROR "try_compile with bad#source.c did not fail:\n${output}") -elseif(NOT output MATCHES [[(bad#source\.c|bad\.c|bad')]]) +elseif(NOT output MATCHES [[(bad#source\.c|bad\.c|bad[':])]]) string(REPLACE "\n" "\n " output " ${output}") message(SEND_ERROR "try_compile with bad#source.c failed without mentioning bad source:\n${output}") else() -- cgit v0.12 From bf2e4a2e857c1e9c9caf73bdf05cc1efc111c196 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Nov 2022 09:22:11 -0500 Subject: ci: Factor out helper to load ninja into environment on Windows --- .gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 | 5 +---- .gitlab/ci/ninja-env.ps1 | 4 ++++ .gitlab/os-windows.yml | 9 +++------ 3 files changed, 8 insertions(+), 10 deletions(-) create mode 100755 .gitlab/ci/ninja-env.ps1 diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 index e5f538a..44bb090 100755 --- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 @@ -2,9 +2,6 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { . ".gitlab/ci/ispc-env.ps1" } -$pwdpath = $pwd.Path -& "$pwsh" -File ".gitlab/ci/ninja.ps1" -Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" -ninja --version +. .gitlab/ci/ninja-env.ps1 Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 diff --git a/.gitlab/ci/ninja-env.ps1 b/.gitlab/ci/ninja-env.ps1 new file mode 100755 index 0000000..67c7036 --- /dev/null +++ b/.gitlab/ci/ninja-env.ps1 @@ -0,0 +1,4 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/ninja.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" +Write-Host "ninja version: $(ninja --version)" diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 5c6be11..78ebb2e 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -299,11 +299,9 @@ - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix" - (& "$pwsh" -File ".gitlab/ci/cmake.ps1") - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH" - - (& "$pwsh" -File ".gitlab/ci/ninja.ps1") - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" + - . .gitlab/ci/ninja-env.ps1 - (& "$env:WIX\bin\light.exe" -help) | Select -First 1 - cmake --version - - ninja --version - cmake -P .gitlab/ci/download_qt.cmake - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH" - cmake -P .gitlab/ci/download_python3.cmake @@ -397,11 +395,10 @@ script: - . .gitlab/ci/env.ps1 - - $pwdpath = $pwd.Path - - (& "$pwsh" -File ".gitlab/ci/ninja.ps1") - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" + - . .gitlab/ci/ninja-env.ps1 - Invoke-Expression -Command .gitlab/ci/clang.ps1 - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 + - $pwdpath = $pwd.Path - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH" - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake -- cgit v0.12 From 8ba5835c8d77b5d61847eba06feac8cfd6682b45 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Nov 2022 09:29:29 -0500 Subject: ci: Factor out helper to load clang into environment on Windows --- .gitlab/ci/clang-env.ps1 | 15 +++++++++++++++ .gitlab/ci/env_windows_clang_common.cmake | 7 ------- .gitlab/ci/env_windows_clang_ninja.cmake | 1 - .gitlab/ci/env_windows_clang_nmake.cmake | 1 - .gitlab/os-windows.yml | 5 +---- 5 files changed, 16 insertions(+), 13 deletions(-) create mode 100755 .gitlab/ci/clang-env.ps1 delete mode 100644 .gitlab/ci/env_windows_clang_common.cmake delete mode 100644 .gitlab/ci/env_windows_clang_ninja.cmake delete mode 100644 .gitlab/ci/env_windows_clang_nmake.cmake diff --git a/.gitlab/ci/clang-env.ps1 b/.gitlab/ci/clang-env.ps1 new file mode 100755 index 0000000..451fca3 --- /dev/null +++ b/.gitlab/ci/clang-env.ps1 @@ -0,0 +1,15 @@ +Invoke-Expression -Command .gitlab/ci/clang.ps1 +Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 + +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH" + +if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)gnu(_|$)") { + $env:CC = "clang" + $env:CXX = "clang++" + clang --version +} else { + $env:CC = "clang-cl" + $env:CXX = "clang-cl" + clang-cl --version +} diff --git a/.gitlab/ci/env_windows_clang_common.cmake b/.gitlab/ci/env_windows_clang_common.cmake deleted file mode 100644 index fdd668f..0000000 --- a/.gitlab/ci/env_windows_clang_common.cmake +++ /dev/null @@ -1,7 +0,0 @@ -if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)") - set(ENV{CC} clang) - set(ENV{CXX} clang++) -else() - set(ENV{CC} clang-cl) - set(ENV{CXX} clang-cl) -endif() diff --git a/.gitlab/ci/env_windows_clang_ninja.cmake b/.gitlab/ci/env_windows_clang_ninja.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_ninja.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/ci/env_windows_clang_nmake.cmake b/.gitlab/ci/env_windows_clang_nmake.cmake deleted file mode 100644 index f3834a2..0000000 --- a/.gitlab/ci/env_windows_clang_nmake.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake") diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 78ebb2e..6f9c292 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -396,10 +396,7 @@ script: - . .gitlab/ci/env.ps1 - . .gitlab/ci/ninja-env.ps1 - - Invoke-Expression -Command .gitlab/ci/clang.ps1 - - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - - $pwdpath = $pwd.Path - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH" + - . .gitlab/ci/clang-env.ps1 - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true -- cgit v0.12 From 3eb94e4d51b5f5f66518bdcaef09a75dd2305606 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Nov 2022 09:33:45 -0500 Subject: ci: Simplify LLVM/Clang CI job specs on Windows Move environment setup to job-specific scripts so we can reuse the common `.cmake_test_windows_external` code path. --- .gitlab-ci.yml | 8 ++++---- .gitlab/ci/env_windows_clang_ninja.ps1 | 2 ++ .gitlab/ci/env_windows_clang_nmake.ps1 | 1 + .gitlab/os-windows.yml | 11 ----------- 4 files changed, 7 insertions(+), 15 deletions(-) create mode 100755 .gitlab/ci/env_windows_clang_ninja.ps1 create mode 100755 .gitlab/ci/env_windows_clang_nmake.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e5824d..ca1437b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1003,7 +1003,7 @@ t:windows-borland5.8: t:windows-clang13.0-cl-ninja: extends: - .windows_clang_ninja - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1018,7 +1018,7 @@ t:windows-clang13.0-cl-ninja: t:windows-clang13.0-cl-nmake: extends: - .windows_clang_nmake - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1033,7 +1033,7 @@ t:windows-clang13.0-cl-nmake: t:windows-clang13.0-gnu-ninja: extends: - .windows_clang_ninja - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1048,7 +1048,7 @@ t:windows-clang13.0-gnu-ninja: t:windows-clang13.0-gnu-nmake: extends: - .windows_clang_nmake - - .cmake_test_windows_clang + - .cmake_test_windows_external - .windows_tags_concurrent - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/env_windows_clang_ninja.ps1 b/.gitlab/ci/env_windows_clang_ninja.ps1 new file mode 100755 index 0000000..17002ef --- /dev/null +++ b/.gitlab/ci/env_windows_clang_ninja.ps1 @@ -0,0 +1,2 @@ +. .gitlab/ci/ninja-env.ps1 +. .gitlab/ci/clang-env.ps1 diff --git a/.gitlab/ci/env_windows_clang_nmake.ps1 b/.gitlab/ci/env_windows_clang_nmake.ps1 new file mode 100755 index 0000000..89fa360 --- /dev/null +++ b/.gitlab/ci/env_windows_clang_nmake.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/clang-env.ps1 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 6f9c292..bb19de9 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -390,17 +390,6 @@ interruptible: true -.cmake_test_windows_clang: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - . .gitlab/ci/ninja-env.ps1 - - . .gitlab/ci/clang-env.ps1 - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true - .cmake_test_windows_msvc: stage: test-ext -- cgit v0.12 From 46b2849550821353f1eb513527c1f47dc761cc68 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Nov 2022 09:36:27 -0500 Subject: ci: Update LLVM/Clang to 15.0 in nightly CI jobs on Windows --- .gitlab-ci.yml | 16 ++++++++-------- .gitlab/ci/clang.ps1 | 14 +++++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca1437b..d4baba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1000,7 +1000,7 @@ t:windows-borland5.8: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-cl-ninja: +t:windows-clang15.0-cl-ninja: extends: - .windows_clang_ninja - .cmake_test_windows_external @@ -1012,10 +1012,10 @@ t:windows-clang13.0-cl-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_ninja + CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-cl-nmake: +t:windows-clang15.0-cl-nmake: extends: - .windows_clang_nmake - .cmake_test_windows_external @@ -1027,10 +1027,10 @@ t:windows-clang13.0-cl-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_nmake + CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_nmake CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-gnu-ninja: +t:windows-clang15.0-gnu-ninja: extends: - .windows_clang_ninja - .cmake_test_windows_external @@ -1042,10 +1042,10 @@ t:windows-clang13.0-gnu-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_ninja + CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang13.0-gnu-nmake: +t:windows-clang15.0-gnu-nmake: extends: - .windows_clang_nmake - .cmake_test_windows_external @@ -1057,7 +1057,7 @@ t:windows-clang13.0-gnu-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_nmake + CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_nmake CMAKE_CI_JOB_NIGHTLY: "true" t:windows-msvc-v71-nmake: diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1 index 25d64ba..29db93d 100755 --- a/.gitlab/ci/clang.ps1 +++ b/.gitlab/ci/clang.ps1 @@ -1,10 +1,10 @@ $erroractionpreference = "stop" -if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang13.0")) { - # LLVM/Clang 13.0 - # https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0 - $filename = "llvm-13.0.0-win-x86_64-1" - $sha256sum = "F1B7CE360DACBC9776D7F84BE714766D60CF3D47492AFE34C45D574D1C597264" +if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang15.0")) { + # LLVM/Clang 15.0 + # https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.4 + $filename = "llvm-15.0.4-win-x86_64-1" + $sha256sum = "9AA305084C20C27972E103E7B18AAC3F755E0534542AF62FC2F2BF5DDD3C4E1F" } else { throw ('unknown CMAKE_CI_BUILD_NAME: ' + "$env:CMAKE_CI_BUILD_NAME") } @@ -25,6 +25,7 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem Move-Item -Path "$outdir\$filename" -Destination "$outdir\llvm" $bin = "$outdir\llvm\bin" +$lib = "$outdir\llvm\lib" $null = New-Item -ItemType HardLink -Path "$bin\clang++.exe" -Target "$bin\clang.exe" $null = New-Item -ItemType HardLink -Path "$bin\clang-cl.exe" -Target "$bin\clang.exe" $null = New-Item -ItemType HardLink -Path "$bin\clang-cpp.exe" -Target "$bin\clang.exe" @@ -34,4 +35,7 @@ $null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\ $null = New-Item -ItemType HardLink -Path "$bin\llvm-lib.exe" -Target "$bin\llvm-ar.exe" $null = New-Item -ItemType HardLink -Path "$bin\llvm-ranlib.exe" -Target "$bin\llvm-ar.exe" $null = New-Item -ItemType HardLink -Path "$bin\llvm-objcopy.exe" -Target "$bin\llvm-strip.exe" +$null = New-Item -ItemType HardLink -Path "$bin\libiomp5md.dll" -Target "$bin\libomp.dll" +$null = New-Item -ItemType HardLink -Path "$lib\libiomp5md.lib" -Target "$lib\libomp.lib" Clear-Variable -Name bin +Clear-Variable -Name lib -- cgit v0.12