Merge topic 'ci-mingw'

3624295c9b ci: add MSYS Makefiles nightly CI job
01c58daec7 ci: add MinGW Makefiles nightly CI job
88b14c5cf4 Tests: Improve GeneratorExpression SHELL_PATH case robustness on MSYS 1.0
82c990e9be Tests: Improve RunCMake.GetPrerequisites sample executable selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7861
This commit is contained in:
Brad King
2022-11-03 12:11:59 +00:00
committed by Kitware Robot
14 changed files with 117 additions and 7 deletions

View File

@@ -1060,6 +1060,34 @@ 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: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

1
.gitlab/.gitignore vendored
View File

@@ -5,6 +5,7 @@
/ispc*
/jom
/llvm*
/mingw
/msvc*
/ninja*
/open-watcom*

View File

@@ -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")

View File

@@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_mingw_osdn_io_common.cmake")

View File

@@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_mingw_osdn_io_common.cmake")

View File

@@ -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"

View File

@@ -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'

25
.gitlab/ci/mingw.ps1 Executable file
View File

@@ -0,0 +1,25 @@
$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"
"$outdir/mingw /mingw" -replace '\\', '/' | Out-File -FilePath "$outdir\mingw\msys\1.0\etc\fstab" -Encoding ASCII

View File

@@ -236,6 +236,29 @@
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"
.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:

View File

@@ -261,13 +261,24 @@ else()
set(test_shell_path2 /shell/path /another/path)
endif()
set(test_shell_path_genex "$<SHELL_PATH:${test_shell_path}>")
set(test_shell_path2_genex "$<SHELL_PATH:${test_shell_path2}>")
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 "$<STREQUAL:${test_shell_path2_genex},/c/shell/path:/d/another/path>")
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}$<SHELL_PATH:${test_shell_path}>
"-Dtest_shell_path2=$<SHELL_PATH:${test_shell_path2}>"
"-Dtest_shell_path=${test_shell_path_genex}"
"-Dtest_shell_path2=${test_shell_path2_genex}"
-Dif_1=$<IF:1,a,b>
-Dif_2=$<IF:0,a,b>
-Dif_3=$<IF:$<EQUAL:10,30>,a,b>

View File

@@ -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()

View File

@@ -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=$<TARGET_FILE:exit_code>)
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)

View File

@@ -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

View File

@@ -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)