[PATCH v7 0/2] MR362: ci: Build vkd3d with MinGW too.
-- v7: ci: Prepend an ordinal number to commits in artifacts. ci: Build vkd3d with MinGW too. https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362
From: Giovanni Mascellani <gmascellani(a)codeweavers.com> Nowadays vkd3d is probably most commonly used compiled as PE rather then ELF, so it makes sense to at least ensure that compilation succeeds. In the future it would be nice to somehow test these binaries as well. --- gitlab/build-mingw | 24 ++++++++++++++++++++++++ gitlab/build.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100755 gitlab/build-mingw diff --git a/gitlab/build-mingw b/gitlab/build-mingw new file mode 100755 index 000000000..0f9ab3a6f --- /dev/null +++ b/gitlab/build-mingw @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "Building $(git log -1)" +echo "---" + +COMMIT=$(printf '%03d-%s' $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)) + +set -Eeuxo pipefail + +./autogen.sh +rm -fr build +mkdir build +cd build +mkdir vulkan-headers +cp -r /usr/include/vulkan /usr/include/vk_video /usr/include/spirv vulkan-headers +../configure --enable-demos --disable-doxygen-doc --without-ncurses --host=$HOST SONAME_LIBVULKAN="vulkan-1.dll" CPPFLAGS="-I$PWD/vulkan-headers" CFLAGS="-g -O2 -Wno-format -Wno-array-bounds" LDFLAGS="-static-libgcc" && \ + make -j$(nproc) && \ + make -j$(nproc) install DESTDIR="$PWD/destdir" || \ + touch ../pipeline_failed + +mkdir -p ../artifacts/$COMMIT +cp destdir/usr/local/bin/* ../artifacts/$COMMIT + +git reset --hard diff --git a/gitlab/build.yml b/gitlab/build.yml index e78e7081f..6a260510a 100644 --- a/gitlab/build.yml +++ b/gitlab/build.yml @@ -82,6 +82,41 @@ build-crosstest: paths: - artifacts +.build-mingw: + stage: build + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + image: $CI_REGISTRY/wine/vkd3d:debian-bookworm + interruptible: true + needs: + - job: build-image + optional: true + dependencies: [] + script: + - git config --global --add safe.directory $CI_PROJECT_DIR + - git clean -fdx + - git reset --hard + - rm -fr .git/rebase-merge + - mkdir artifacts + - cat /proc/cpuinfo > artifacts/cpuinfo.txt + - cat /proc/meminfo > artifacts/meminfo.txt + - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mingw + - if [ -f pipeline_failed ] ; then exit 1 ; fi + artifacts: + when: always + paths: + - artifacts + +build-mingw-64: + extends: .build-mingw + variables: + HOST: "x86_64-w64-mingw32" + +build-mingw-32: + extends: .build-mingw + variables: + HOST: "i686-w64-mingw32" + build-mac: stage: build rules: -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362
From: Giovanni Mascellani <gmascellani(a)codeweavers.com> --- gitlab/build-crosstest | 2 +- gitlab/build-linux | 2 +- gitlab/build-mac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gitlab/build-crosstest b/gitlab/build-crosstest index 7963e58bf..5561bffb2 100755 --- a/gitlab/build-crosstest +++ b/gitlab/build-crosstest @@ -3,7 +3,7 @@ echo "Building $(git log -1)" echo "---" -COMMIT=$(git rev-parse --short HEAD) +COMMIT=$(printf '%03d-%s' $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)) set -Eeuxo pipefail diff --git a/gitlab/build-linux b/gitlab/build-linux index 318bbba44..566d772f8 100755 --- a/gitlab/build-linux +++ b/gitlab/build-linux @@ -3,7 +3,7 @@ echo "Building $(git log -1)" echo "---" -COMMIT=$(git rev-parse --short HEAD) +COMMIT=$(printf '%03d-%s' $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)) set -Eeuxo pipefail diff --git a/gitlab/build-mac b/gitlab/build-mac index ffa46d67f..23c1ea964 100755 --- a/gitlab/build-mac +++ b/gitlab/build-mac @@ -3,7 +3,7 @@ echo "Building $(git log -1)" echo "---" -COMMIT=$(git rev-parse --short HEAD) +COMMIT=$(printf '%03d-%s' $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)) set -Eeuxo pipefail -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362
```diff +../configure --enable-demos --disable-doxygen-doc --without-ncurses --host=$HOST SONAME_LIBVULKAN="vulkan-1.dll" CPPFLAGS="-I$PWD/vulkan-headers" CFLAGS="-g -O2 -Wno-format -Wno-array-bounds" LDFLAGS="-static-libgcc" && \ + make -j$(nproc) && \ + make -j$(nproc) install DESTDIR="$PWD/destdir" || \ + touch ../pipeline_failed ```
Note that using DESTDIR is subtly different than using --prefix. E.g., one notable difference is what libtool will set RUNPATH to. I suppose it doesn't matter much for Windows builds though. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362#note_46975
This merge request was approved by Henri Verbeet. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362
Note that using DESTDIR is subtly different than using --prefix. E.g., one notable difference is what libtool will set RUNPATH to. I suppose it doesn't matter much for Windows builds though.
I know it's different in general, though I'm not specifically aware of the details with libtool and RUNPATH. My reasoning is that whatever is eventually going to use those libraries is probably going to use neither the default prefix `/usr/local` nor whatever `$PWD/destdir` happens to be, so using `DESTDIR` is not more broken than setting a non-default prefix. Also, I am not aware of any way in which a DLL can meaningfully store a Unix path, so the prefix shouldn't be relevant in any case. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/362#note_47006
participants (3)
-
Giovanni Mascellani -
Giovanni Mascellani (@giomasce) -
Henri Verbeet (@hverbeet)