From 0f0d5df4e50aadd06563c9919e5c3629ec2c6fcb Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 30 Sep 2024 18:08:15 +0800 Subject: [PATCH 1/3] CI: Use Visual Studio 2019 for the MSVC CI ...and add ability to select target platform for calling vcvarsall.bat, so that we can accomodate 32-bit builds and possibly ARM64 builds in the CI if we need to. --- .gitlab-ci.yml | 6 ++++-- .gitlab-ci/test-msvc.bat | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37f049cc4..d9ee41112 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -586,7 +586,7 @@ msys2-clang64: paths: - _build/meson-logs -vs2017-x64: +vs2019-x64: extends: .only-default stage: build tags: @@ -605,6 +605,7 @@ vs2017-x64: --wrap-mode=default --python.platlibdir=C:\Python37\site-packages --python.purelibdir=C:\Python37\site-packages + --plat=x64 artifacts: reports: junit: @@ -621,7 +622,7 @@ vs2017-x64: - _build/gthread/libgthread-2.0-0.dll - _build/gobject/libgobject-2.0-0.dll -vs2017-x64-static: +vs2019-x64-static: extends: .only-default stage: build tags: @@ -641,6 +642,7 @@ vs2017-x64-static: --default-library=static --python.platlibdir=C:\Python37\site-packages --python.purelibdir=C:\Python37\site-packages + --plat=x64 artifacts: reports: junit: diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index c6361ce0f..09c6560b1 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -1,15 +1,21 @@ @echo on -:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the -:: specified build architecture -call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 :: Remove quotes from script args setlocal enabledelayedexpansion set args= +set stash_plat=0 + for %%x in (%*) do ( - set args=!args! %%~x + if "%%x" == "--plat" set stash_plat=1 + if "!stash_plat!" == "0" set args=!args! %%~x + if "!stash_plat!" == "1" if /i not "%%x" == "--plat" set plat=%%x & set stash_plat=0 ) set args=%args:~1% +if "!plat!" == "" set plat=x64 + +:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the +:: specified build architecture +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" !plat! pip3 install --upgrade --user meson==1.4.2 || goto :error meson setup %args% _build || goto :error From c4799982d6542c9dd6a22d4eefa5a507beb9ce21 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 1 Oct 2024 16:25:45 +0800 Subject: [PATCH 2/3] CI: Add a 32-bit Visual Studio 2019 config This way, we can continue to test whether 32-bit builds continue to work with Visual Studio builds. Note that this uses the x64-to-x86 cross compiler. --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .gitlab-ci/test-msvc.bat | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9ee41112..c2e13bb9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -654,6 +654,42 @@ vs2019-x64-static: paths: - _build/meson-logs +vs2019-x86: + extends: .only-default + stage: build + tags: + - win32-ps + needs: [] + variables: + GIT_SUBMODULE_STRATEGY: recursive + GIT_SUBMODULE_DEPTH: 1 + PYTHONUTF8: "1" + script: + # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines + # aren’t currently set up for that. + # FIXME: Use --meson-fatal-warnings once we've enabled c_std=gnu99,c99 + # for the runner's Meson version. + - .gitlab-ci/test-msvc.bat --buildtype debug + --wrap-mode=default + --python.platlibdir=C:\Python37\site-packages + --python.purelibdir=C:\Python37\site-packages + --plat=x64_x86 + artifacts: + reports: + junit: + - _build/meson-logs/testlog.junit.xml + - _build/meson-logs/testlog-*.junit.xml + name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}" + when: always + expire_in: 1 week + paths: + - _build/meson-logs + - _build/glib/libglib-2.0-0.dll + - _build/gio/libgio-2.0-0.dll + - _build/gmodule/libgmodule-2.0-0.dll + - _build/gthread/libgthread-2.0-0.dll + - _build/gobject/libgobject-2.0-0.dll + freebsd-13-x86_64: extends: .only-schedules-or-manual stage: build diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 09c6560b1..6e26e3970 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -8,7 +8,7 @@ set stash_plat=0 for %%x in (%*) do ( if "%%x" == "--plat" set stash_plat=1 if "!stash_plat!" == "0" set args=!args! %%~x - if "!stash_plat!" == "1" if /i not "%%x" == "--plat" set plat=%%x & set stash_plat=0 + if "!stash_plat!" == "1" if /i not "%%x" == "--plat" (set plat=%%x) & (set stash_plat=0) ) set args=%args:~1% if "!plat!" == "" set plat=x64 From cba1d820d9f2014d4bf798c5c61ccd3a26bd390e Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 4 Oct 2024 12:26:51 +0800 Subject: [PATCH 3/3] CI: Only run the VS2019-x86 CI job weekly or on request As per suggested by Philip, as the Visual Studio CI jobs are the slowest to be picked up and to be completed. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2e13bb9c..61b7606cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -655,7 +655,7 @@ vs2019-x64-static: - _build/meson-logs vs2019-x86: - extends: .only-default + extends: .only-schedules-or-manual stage: build tags: - win32-ps