From 82c990e9be75496e3d27203d4d092f971bf96179 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2022 17:51:08 -0400 Subject: Tests: Improve RunCMake.GetPrerequisites sample executable selection Get the runtime dependencies of an executable just built by the toolchain with which tests are running. Previously we used the `cmake` binary itself, but that might have been built for a different ABI than the tested binutils support. --- Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake | 4 +++- Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 6bf8f3f..ec144c8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -361,7 +361,7 @@ if(XCODE_VERSION) set(GeneratorToolset_ARGS -DXCODE_VERSION=${XCODE_VERSION}) endif() add_RunCMake_test(GeneratorToolset) -add_RunCMake_test(GetPrerequisites) +add_RunCMake_test(GetPrerequisites -DSAMPLE_EXE=$) add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test add_RunCMake_test(Graphviz) diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake index d1bc9b1..9cc05d0 100644 --- a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake +++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake @@ -10,7 +10,9 @@ endfunction() # Should not throw any errors # Regular executable -get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "") +if(SAMPLE_EXE) + get_prerequisites("${SAMPLE_EXE}" cmake_prereqs 1 1 "" "") +endif() # Shell script check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh) # Batch script diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake index a635e38..5550c02 100644 --- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake +++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake @@ -1,4 +1,4 @@ include(RunCMake) run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake) -run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) +run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -DSAMPLE_EXE=${SAMPLE_EXE} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) -- cgit v0.12 From 88b14c5cf4e88bddef11ed035d6d53ae1435d990 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Nov 2022 15:34:47 -0400 Subject: Tests: Improve GeneratorExpression SHELL_PATH case robustness on MSYS 1.0 Since commit ca6ba3fee5 (Genex: Add a SHELL_PATH expression, 2015-09-24, v3.4.0-rc1~37^2) and commit 21da25d2a8 (Tests: Generalize GeneratorExpression MSYS path conversion workaround, 2019-03-11, v3.15.0-rc1~407^2~1) we use a prefix string to prevent the MSYS 1.0 shell from converting absolute paths of the form `/c/...` to windows-style paths. In the newer `mingw.osdn.io` distribution of MSYS 1.0, the `bash` shell now also converts paths that appear after `:`. We have no way to add a prefix string in that context, so perform the test's check of the `SHELL_PATH` genex value at generate time instead. --- Tests/GeneratorExpression/CMakeLists.txt | 15 +++++++++++++-- Tests/GeneratorExpression/check-part4.cmake | 9 +++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ebbe288..6187966 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -261,13 +261,24 @@ else() set(test_shell_path2 /shell/path /another/path) endif() +set(test_shell_path_genex "$") +set(test_shell_path2_genex "$") +if(msys1_prefix) + # Add a prefix to the value produced by the genex so that the path does + # not look absolute, thus suppressing conversion by MSYS 1.0 bash. + set(test_shell_path_genex "${msys1_prefix}${test_shell_path_genex}") + # There is no way to suppress conversion of the second path in + # MSYS 1.0 bash, so do the comparison at generate time instead. + set(test_shell_path2_genex "$") +endif() + add_custom_target(check-part4 ALL COMMAND ${msys2_no_conv} ${CMAKE_COMMAND} # Prefix path to bypass its further conversion when being processed by # CMake as command-line argument -Dmsys1_prefix=${msys1_prefix} - -Dtest_shell_path=${msys1_prefix}$ - "-Dtest_shell_path2=$" + "-Dtest_shell_path=${test_shell_path_genex}" + "-Dtest_shell_path2=${test_shell_path2_genex}" -Dif_1=$ -Dif_2=$ -Dif_3=$,a,b> diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake index a7e0944..28f3699 100644 --- a/Tests/GeneratorExpression/check-part4.cmake +++ b/Tests/GeneratorExpression/check-part4.cmake @@ -16,8 +16,13 @@ else() check(test_shell_path [[/shell/path]]) endif() if(WIN32) - if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles" AND NOT msys1_prefix) - check(test_shell_path2 [[/c/shell/path:/d/another/path]]) + if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles") + if(msys1_prefix) + # The comparison was done at generate time with the STREQUAL genex. + check(test_shell_path2 [[1]]) + else() + check(test_shell_path2 [[/c/shell/path:/d/another/path]]) + endif() elseif(CMAKE_GENERATOR STREQUAL "Unix Makefiles") check(test_shell_path2 [[c:/shell/path;d:/another/path]]) else() -- cgit v0.12 From 01c58daec73ec3c78f9115d8055f6e16347f8446 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2022 16:53:54 -0400 Subject: ci: add MinGW Makefiles nightly CI job Use the MinGW/MSYS 1.0 distribution from `mingw.osdn.io`. --- .gitlab-ci.yml | 14 +++++++++++++ .gitlab/.gitignore | 1 + .gitlab/ci/configure_mingw_osdn_io_common.cmake | 5 +++++ .../configure_mingw_osdn_io_mingw_makefiles.cmake | 1 + .gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 | 3 +++ .gitlab/ci/mingw.ps1 | 23 ++++++++++++++++++++++ .gitlab/os-windows.yml | 16 +++++++++++++++ 7 files changed, 63 insertions(+) create mode 100644 .gitlab/ci/configure_mingw_osdn_io_common.cmake create mode 100644 .gitlab/ci/configure_mingw_osdn_io_mingw_makefiles.cmake create mode 100755 .gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 create mode 100755 .gitlab/ci/mingw.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e5824d..387a720 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1060,6 +1060,20 @@ t:windows-clang13.0-gnu-nmake: CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_nmake CMAKE_CI_JOB_NIGHTLY: "true" +t:mingw_osdn_io-mingw_makefiles: + extends: + - .mingw_osdn_io_mingw_makefiles + - .cmake_test_windows_external + - .windows_tags_concurrent + - .cmake_junit_artifacts + - .run_dependent + dependencies: + - t:windows-vs2022-x64-ninja + needs: + - t:windows-vs2022-x64-ninja + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:windows-msvc-v71-nmake: extends: - .windows_msvc_v71_nmake diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore index d62e477..4988351 100644 --- a/.gitlab/.gitignore +++ b/.gitlab/.gitignore @@ -5,6 +5,7 @@ /ispc* /jom /llvm* +/mingw /msvc* /ninja* /open-watcom* diff --git a/.gitlab/ci/configure_mingw_osdn_io_common.cmake b/.gitlab/ci/configure_mingw_osdn_io_common.cmake new file mode 100644 index 0000000..55dce1d --- /dev/null +++ b/.gitlab/ci/configure_mingw_osdn_io_common.cmake @@ -0,0 +1,5 @@ +set(CMake_TEST_Java OFF CACHE BOOL "") + +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_mingw_osdn_io_mingw_makefiles.cmake b/.gitlab/ci/configure_mingw_osdn_io_mingw_makefiles.cmake new file mode 100644 index 0000000..5ddd410 --- /dev/null +++ b/.gitlab/ci/configure_mingw_osdn_io_mingw_makefiles.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_mingw_osdn_io_common.cmake") diff --git a/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 new file mode 100755 index 0000000..e2d573e --- /dev/null +++ b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 @@ -0,0 +1,3 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/mingw.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\mingw\bin;$env:PATH" diff --git a/.gitlab/ci/mingw.ps1 b/.gitlab/ci/mingw.ps1 new file mode 100755 index 0000000..672b993 --- /dev/null +++ b/.gitlab/ci/mingw.ps1 @@ -0,0 +1,23 @@ +$erroractionpreference = "stop" + +if ("$env:CMAKE_CONFIGURATION".Contains("mingw_osdn_io")) { + $filename = "mingw.osdn.io-2022-10-03" + $sha256sum = "4DCB8C351D8D855F7D3DFC2863A235042BF3DB6E69EA0BAE51FF9378189345CD" +} else { + throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION") +} +$tarball = "$filename.zip" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' +Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball" +$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir") +Move-Item -Path "$outdir\$filename" -Destination "$outdir\mingw" +Remove-Item "$outdir\$tarball" diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 5c6be11..8ba4cc4 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -236,6 +236,22 @@ variables: CMAKE_CONFIGURATION: windows_openwatcom1.9 +.mingw_osdn_io: + extends: .windows + + variables: + # Place MinGW environment in a path without spaces. + GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake-ci-ext\\$CI_CONCURRENT_ID" + CMAKE_CI_BUILD_TYPE: Debug + CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + +.mingw_osdn_io_mingw_makefiles: + extends: .mingw_osdn_io + + variables: + CMAKE_CONFIGURATION: mingw_osdn_io_mingw_makefiles + CMAKE_GENERATOR: "MinGW Makefiles" + ## Tags .windows_tags_nonconcurrent_vs2022: -- cgit v0.12 From 3624295c9bef4562408110443214fcb048897247 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Nov 2022 14:16:41 -0400 Subject: ci: add MSYS Makefiles nightly CI job Use the MinGW/MSYS 1.0 distribution from `mingw.osdn.io`. --- .gitlab-ci.yml | 14 ++++++++++++++ .gitlab/ci/configure_mingw_osdn_io_msys_makefiles.cmake | 1 + .gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 | 5 +++++ .gitlab/ci/mingw.ps1 | 2 ++ .gitlab/os-windows.yml | 7 +++++++ 5 files changed, 29 insertions(+) create mode 100644 .gitlab/ci/configure_mingw_osdn_io_msys_makefiles.cmake create mode 100755 .gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 387a720..7f732a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1074,6 +1074,20 @@ t:mingw_osdn_io-mingw_makefiles: variables: CMAKE_CI_JOB_NIGHTLY: "true" +t:mingw_osdn_io-msys_makefiles: + extends: + - .mingw_osdn_io_msys_makefiles + - .cmake_test_windows_external + - .windows_tags_concurrent + - .cmake_junit_artifacts + - .run_dependent + dependencies: + - t:windows-vs2022-x64-ninja + needs: + - t:windows-vs2022-x64-ninja + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:windows-msvc-v71-nmake: extends: - .windows_msvc_v71_nmake diff --git a/.gitlab/ci/configure_mingw_osdn_io_msys_makefiles.cmake b/.gitlab/ci/configure_mingw_osdn_io_msys_makefiles.cmake new file mode 100644 index 0000000..5ddd410 --- /dev/null +++ b/.gitlab/ci/configure_mingw_osdn_io_msys_makefiles.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_mingw_osdn_io_common.cmake") diff --git a/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 new file mode 100755 index 0000000..6eccb72 --- /dev/null +++ b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 @@ -0,0 +1,5 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/mingw.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\mingw\msys\1.0\bin;$pwdpath\.gitlab\mingw\bin;$env:PATH" +$env:MSYSTEM = 'MINGW32' +$env:MAKE_MODE = 'unix' diff --git a/.gitlab/ci/mingw.ps1 b/.gitlab/ci/mingw.ps1 index 672b993..a1b5b11 100755 --- a/.gitlab/ci/mingw.ps1 +++ b/.gitlab/ci/mingw.ps1 @@ -21,3 +21,5 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir") Move-Item -Path "$outdir\$filename" -Destination "$outdir\mingw" Remove-Item "$outdir\$tarball" + +"$outdir/mingw /mingw" -replace '\\', '/' | Out-File -FilePath "$outdir\mingw\msys\1.0\etc\fstab" -Encoding ASCII diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 8ba4cc4..271610b 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -252,6 +252,13 @@ CMAKE_CONFIGURATION: mingw_osdn_io_mingw_makefiles CMAKE_GENERATOR: "MinGW Makefiles" +.mingw_osdn_io_msys_makefiles: + extends: .mingw_osdn_io + + variables: + CMAKE_CONFIGURATION: mingw_osdn_io_msys_makefiles + CMAKE_GENERATOR: "MSYS Makefiles" + ## Tags .windows_tags_nonconcurrent_vs2022: -- cgit v0.12