Skip to content

Use up-to-date dependencies #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 1, 2025
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 48 additions & 13 deletions .github/workflows/rebuildDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,61 @@ jobs:
- platform: msvc-x64
triplet: x64-windows
runner: windows-latest
# commit before addition of boost filesystem 1.87 that removes Win7 support https://github.com/microsoft/vcpkg/pull/42678
commit: ec12d917a85839741f8345905f71b3e7f56d9ddc
- platform: msvc-x86
triplet: x86-windows
runner: windows-latest
# commit before addition of boost filesystem 1.87 that removes Win7 support https://github.com/microsoft/vcpkg/pull/42678
commit: ec12d917a85839741f8345905f71b3e7f56d9ddc
- platform: msvc-arm64
triplet: arm64-windows
runner: windows-11-arm
# commit before changes to yasm package which seems to break ARM builds https://github.com/microsoft/vcpkg/pull/45856
commit: 94a9df6990e426ec3fff1a4ba20016da4aafea70

runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash

steps:
- name: Checkout vcpkg repository
# Use latest vcpkg for x64/x86
- name: Checkout vcpkg (latest)
uses: actions/checkout@v4
with:
repository: 'microsoft/vcpkg'
ref: ${{ matrix.commit }}
ref: master

- name: Prepare overlays (Boost + YASM)
run: |
mkdir -p vcmi-overlay-boost vcmi-overlay-yasm

# Clone vcpkg once
git clone https://github.com/microsoft/vcpkg.git temp-vcpkg
cd temp-vcpkg

# Boost overlay (Win7 fix)
# Commit before addition of boost filesystem 1.87 that removes Win7 support:
# https://github.com/microsoft/vcpkg/pull/42678
# Commit: ec12d917a85839741f8345905f71b3e7f56d9ddc
git checkout ec12d917a85839741f8345905f71b3e7f56d9ddc
cp -r ports/boost* ../vcmi-overlay-boost/

# YASM overlay (ARM64 fix)
# Commit before changes to yasm package which seem to break ARM builds:
# https://github.com/microsoft/vcpkg/pull/45856
# Commit: 94a9df6990e426ec3fff1a4ba20016da4aafea70
git checkout 94a9df6990e426ec3fff1a4ba20016da4aafea70
cp -r ports/yasm* ../vcmi-overlay-yasm/

# Switch back to master for the rest of the ports
git checkout master
cd ..

# NOTE: disabling debug for all triplets, so 64 host / 32 guest won't build debug version of 64-bit tools
# Othervice, x86 package size is way larger than needed
# Otherwise, x86 package size is way larger than needed
- name: Disable debug builds
run: |
echo 'set(VCPKG_BUILD_TYPE release)' >>triplets/x64-windows.cmake
echo 'set(VCPKG_BUILD_TYPE release)' >>triplets/x86-windows.cmake
echo 'set(VCPKG_BUILD_TYPE release)' >>triplets/arm64-windows.cmake

- name: Enable Windows 7 targeting (only for x86/x64)
- name: Enable Windows 7 targeting (x86/x64)
if: matrix.triplet == 'x64-windows' || matrix.triplet == 'x86-windows'
run: |
echo 'set(VCPKG_CXX_FLAGS "-D_WIN32_WINNT=0x0601 -DWINVER=0x0601")' >>triplets/${{ matrix.triplet }}.cmake
Expand All @@ -61,7 +82,14 @@ jobs:

- name: Install dependencies
run: |
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}"
if [ "${{ matrix.platform }}" == "msvc-arm64" ]; then
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}" --overlay-ports=vcmi-overlay-yasm
OVERLAY="--overlay-ports=vcmi-overlay-yasm"
else
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}" --overlay-ports=vcmi-overlay-boost
OVERLAY="--overlay-ports=vcmi-overlay-boost"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "${{ matrix.platform }}" == "msvc-arm64" ]; then
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}" --overlay-ports=vcmi-overlay-yasm
OVERLAY="--overlay-ports=vcmi-overlay-yasm"
else
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}" --overlay-ports=vcmi-overlay-boost
OVERLAY="--overlay-ports=vcmi-overlay-boost"
fi
if [ "${{ matrix.platform }}" == "msvc-arm64" ]; then
OVERLAY="--overlay-ports=vcmi-overlay-yasm"
else
OVERLAY="--overlay-ports=vcmi-overlay-boost"
fi
./vcpkg.exe install yasm --triplet "${{ matrix.triplet }}" $OVERLAY

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also put OVERLAY to GITHUB_ENV to avoid computing it again in Export packages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can give overlays fixed name, vcmi-overlay or whatever and instead add packages to overlay using architecture as condition - one step for arm64 /yasm & another for boost/amd64.

So on arm64 vcmi-overlay will contain yasm, and on amd64 - vcmi-overlay will contain boost.

With this there won't be need for OVERLAY variable


./vcpkg.exe install \
tbb fuzzylite sdl2 sdl2-image sdl2-ttf sdl2-mixer[core,mpg123] \
qt5-base qt5-tools \
Expand All @@ -70,17 +98,24 @@ jobs:
boost-iostreams boost-headers boost-foreach boost-format boost-crc boost-logic \
boost-multi-array boost-ptr-container boost-heap boost-bimap boost-asio \
boost-stacktrace boost-assign boost-geometry boost-uuid boost-process \
--triplet "${{ matrix.triplet }}"
--triplet "${{ matrix.triplet }}" $OVERLAY

- name: Export packages
run: |
if [ "${{ matrix.platform }}" == "msvc-arm64" ]; then
OVERLAY="--overlay-ports=vcmi-overlay-yasm"
else
OVERLAY="--overlay-ports=vcmi-overlay-boost"
fi

./vcpkg.exe export \
tbb fuzzylite sdl2 sdl2-image sdl2-ttf sdl2-mixer qt5-base qt5-tools ffmpeg \
boost-filesystem boost-system boost-thread boost-program-options boost-locale \
boost-iostreams boost-headers boost-foreach boost-format boost-crc boost-logic \
boost-multi-array boost-ptr-container boost-heap boost-bimap boost-asio \
boost-stacktrace boost-assign boost-geometry boost-uuid boost-process \
--raw --triplet "${{ matrix.triplet }}" --output=result/vcpkg
--raw --triplet "${{ matrix.triplet }}" $OVERLAY \
--output=result/vcpkg

- name: Trim pdb files
run: |
Expand Down