ci: Assume an Apple Silicon-based environment for the macOS CI job.

The previous Intel-based macOS runner was replaced with another one
running as a virtual machine on top of an Apple Silicon host.

Since the current macOS runner is not yet able to deal with
different exit codes, we temporarily allow failure unconditionally.
This will be reverted as soon as the runner issue is fixed.
This commit is contained in:
Giovanni Mascellani 2024-06-12 15:51:22 +02:00 committed by Henri Verbeet
parent d3ba810c98
commit 46a1b66df7
Notes: Henri Verbeet 2024-06-17 13:03:00 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/920
4 changed files with 34 additions and 32 deletions

View File

@ -10,7 +10,7 @@ set -Eeuxo pipefail
rm -fr build
mkdir build
cd build
if ../configure CFLAGS="-g -O2 -Wno-implicit-fallthrough -Werror" && \
if ../configure CFLAGS="-I/opt/homebrew/opt/vulkan-headers/include -I/opt/homebrew/opt/spirv-headers/include -g -O2 -Wno-implicit-fallthrough -Wno-ignored-attributes -Wno-unknown-attributes -Wno-unused-but-set-variable -Werror" VULKAN_LIBS=-L/opt/homebrew/opt/vulkan-loader/lib --with-spirv-tools && \
make -j$(sysctl -n hw.ncpu) ; then
make -j$(sysctl -n hw.ncpu) AM_COLOR_TESTS=always check || \
touch ../tests_failed

View File

@ -137,9 +137,11 @@ build-mac:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
allow_failure:
exit_codes:
- 2
image: winehq-sonoma-pristine
variables:
TART_EXECUTOR_SSH_USERNAME: "gitlab"
TART_EXECUTOR_SSH_PASSWORD: "gitlab"
allow_failure: true
interruptible: true
needs:
- job: image-mac
@ -148,28 +150,26 @@ build-mac:
tags:
- mac
script:
- brew install vulkan-tools libtool spirv-headers vulkan-loader
- git config --global --add safe.directory $CI_PROJECT_DIR
- git clean -fdx
- git reset --hard
- rm -fr .git/rebase-merge
# We use a custom ICD which is not marked as a portability driver,
# so that test programs are not confused.
- ./gitlab/patch_moltenvk_icd.sh
- export VK_DRIVER_FILES="$PWD/gitlab/MoltenVK_icd.json"
- curl -o image.zip https://gitlab.winehq.org/api/v4/projects/giomasce%2Fvkd3d/jobs/artifacts/ci-image/download?job=image-mac
- unzip image.zip
- mkdir artifacts
- export PATH="/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/flex/bin:$PWD/image/bin:$PATH"
- export VK_DRIVER_FILES="$PWD/image/moltenvk/MoltenVK_icd.json"
- system_profiler SPSoftwareDataType SPHardwareDataType > artifacts/systeminfo.txt
- vulkaninfo > artifacts/vulkaninfo.txt
- export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH"
- curl -o image.zip https://gitlab.winehq.org/api/v4/projects/wine%2Fvkd3d/jobs/artifacts/master/download?job=image-mac
- unzip image.zip
- export PATH="$PWD/image/bin:$PATH"
- git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mac
- if [ -f build_failed ] ; then exit 1 ; fi
- if [ -f tests_failed ] ; then exit 2 ; fi
variables:
VKD3D_DISABLE_EXTENSIONS: "VK_EXT_descriptor_indexing"
VKD3D_SHADER_CONFIG: 'force_validation'
MVK_CONFIG_LOG_LEVEL: 1
MVK_CONFIG_LOG_LEVEL: 2
SONAME_LIBVULKAN: "/opt/homebrew/opt/vulkan-loader/lib/libvulkan.1.dylib"
artifacts:
when: always
paths:

View File

@ -31,24 +31,38 @@ image-mac:
- .gitlab-ci.yml
- gitlab/image.yml
- gitlab/image.docker
image: winehq-sonoma-pristine
variables:
TART_EXECUTOR_SSH_USERNAME: "gitlab"
TART_EXECUTOR_SSH_PASSWORD: "gitlab"
interruptible: true
tags:
- mac
script:
- mkdir image
- cd image
- mkdir bin
- mkdir image/bin
- mkdir image/moltenvk
- export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH"
- git clone --depth 1 --branch v1.2.9 https://github.com/KhronosGroup/MoltenVK.git
- cd MoltenVK
- ./fetchDependencies --macos
- make macos
# Do not mark MoltenVK as a portability driver, otherwise it will be harder for vkd3d to find
# it. Since editing JSON properly is hard, we just rename the key.
- 'sed -i -e "s|is_portability_driver|_is_portability_driver|g" Package/Release/MoltenVK/dylib/macOS/MoltenVK_icd.json'
- cd ..
- cp MoltenVK/Package/Release/MoltenVK/dylib/macOS/MoltenVK_icd.json image/moltenvk
- cp MoltenVK/Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib image/moltenvk
- git clone --depth 1 --branch wine-3.21 https://gitlab.winehq.org/wine/wine.git
- cd wine
- mkdir build
- cd build
- ../configure --enable-win64 --without-x --without-freetype
- make tools/widl/widl
- arch -x86_64 ../configure --enable-win64 --without-x --without-freetype
- arch -x86_64 make tools/widl/widl
- cd ../..
- cp wine/build/tools/widl/widl bin
- rm -fr wine
- cd ..
- cp wine/build/tools/widl/widl image/bin
artifacts:
paths:
- image

View File

@ -1,12 +0,0 @@
#!/bin/bash
BASE_PATH="/usr/local/opt/molten-vk/share/vulkan/icd.d"
cp "$BASE_PATH/MoltenVK_icd.json" gitlab/MoltenVK_icd.json
# The driver path is relative
sed -i -e 's|"library_path" *: "|"library_path" : "'"$BASE_PATH/"'|g' gitlab/MoltenVK_icd.json
# We pretend this is not a portability driver, otherwise vkd3d won't
# find it
sed -i -e 's|"is_portability_driver" *: *true|"is_portability_driver" : false|g' gitlab/MoltenVK_icd.json