Skip to content

tests: add zmq listening #119

tests: add zmq listening

tests: add zmq listening #119

Workflow file for this run

name: Build Windows Package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- '.github/workflows/build-windows.yml'
- 'CMakeLists.txt'
- 'bin/check_pe_hardening.sh'
workflow_dispatch:
workflow_call:
# A new push to a pull request cancels the previous run. Other events get their own
# group so they are never cancelled or replaced.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
actions: write # replace the ccache entries
jobs:
msys2-mingw64:
name: MSYS2 MinGW64
timeout-minutes: 120
runs-on: windows-latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive
- name: Setup Python 3.13
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.13'
architecture: 'x64'
- name: Install Python build dependencies
shell: bash
run: |
python -m pip install scikit-build-core delvewheel
- name: Setup MSYS2 MINGW64
uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-openssl
mingw-w64-x86_64-zeromq
mingw-w64-x86_64-libsodium
mingw-w64-x86_64-unbound
mingw-w64-x86_64-protobuf
mingw-w64-x86_64-ntldd
mingw-w64-x86_64-ccache
git
make
gettext
base-devel
wget
- name: Install pinned MinGW64 toolchain v16.2.0
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-headers-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "acad5748942953f91a0f2bba03e20437b909366e55949f478f1b2f2d30c726a7 mingw-w64-x86_64-headers-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-crt-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "d24b4e7614756414ae3ef58793265448a3ca7d5fd447a991e9b2facde7b59d75 mingw-w64-x86_64-crt-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-binutils-2.47-3-any.pkg.tar.zst
echo "827363748ce3320683319d860ee4fcfcdbb36baf66aac6dab0ec3822be2d4ff7 mingw-w64-x86_64-binutils-2.47-3-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-libmangle-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "481babe8c2fdfa4fc7f51bf13939701719af9f8166ef6a91a9a209cc25961b03 mingw-w64-x86_64-libmangle-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-winpthreads-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "7d86a267b6069198d28f3e77314282ff7b4e3c7bb8fe482299ca58f7a5b439db mingw-w64-x86_64-winpthreads-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-libwinpthread-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "1d0ed7fda332a5c879de210f3d72c75fa1f3df7cc63dd951e763dec8eb02c1ee mingw-w64-x86_64-libwinpthread-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-winstorecompat-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "7fcafd7ba30bd47000263e76a06bd893406c64f88955825f0a9188407a35c3d3 mingw-w64-x86_64-winstorecompat-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-tools-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst
echo "c17557d09371e39db38deb56c7da6ae54e2c65b6f3466ca02f4da26b616ca8c3 mingw-w64-x86_64-tools-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~3.0.7-1-any.pkg.tar.zst
echo "37b97f372409fa7cf54d709bab892f34e9c62d2658230a09f783a89a55ae590e mingw-w64-x86_64-pkgconf-1~3.0.7-1-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-make-4.4.1-5-any.pkg.tar.zst
echo "c19e7caf09bbc89b2730556b2da73004118d4e1f967a685cc48524c7ff80d864 mingw-w64-x86_64-make-4.4.1-5-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-libs-16.2.0-3-any.pkg.tar.zst
echo "f8e25ea67bb796e7f65550f0dca9fce4cdde8aaa3dadafe4d13c6a8233c8de26 mingw-w64-x86_64-gcc-libs-16.2.0-3-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-16.2.0-3-any.pkg.tar.zst
echo "8b37c953ae12f3d8fa05c854236463231ea0a294dff423007cbd93d4d8089f9f mingw-w64-x86_64-gcc-16.2.0-3-any.pkg.tar.zst" | sha256sum -c
# gcc-libs is split into libgcc, libstdc++ and cc-libs since 16.2.0-4 and the
# new packages conflict with the pinned gcc-libs, so drop them before the downgrade
for p in libgcc libstdc++ cc-libs; do
if pacman -Q mingw-w64-x86_64-$p > /dev/null 2>&1; then
pacman -Rdd --noconfirm mingw-w64-x86_64-$p
fi
done
pacman -U --noconfirm \
mingw-w64-x86_64-headers-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-crt-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-binutils-2.47-3-any.pkg.tar.zst \
mingw-w64-x86_64-libmangle-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-winpthreads-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-libwinpthread-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-winstorecompat-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-tools-14.0.0.r375.g9c1abbbf5-1-any.pkg.tar.zst \
mingw-w64-x86_64-pkgconf-1~3.0.7-1-any.pkg.tar.zst \
mingw-w64-x86_64-make-4.4.1-5-any.pkg.tar.zst \
mingw-w64-x86_64-gcc-libs-16.2.0-3-any.pkg.tar.zst \
mingw-w64-x86_64-gcc-16.2.0-3-any.pkg.tar.zst
- name: Install ICU v78.3
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-78.3-4-any.pkg.tar.zst
echo "8486a018aca2e56d1fcd2eed2069011f2e1da02e03af72b38916ee06cbe7203f mingw-w64-x86_64-icu-78.3-4-any.pkg.tar.zst" | sha256sum -c
pacman -U --noconfirm mingw-w64-x86_64-icu-78.3-4-any.pkg.tar.zst
- name: Install hidapi v0.15.0 and libusb v1.0.30
run: |
# dropped from the msys2 mingw64 repo, install the archived packages
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-hidapi-0.15.0-2-any.pkg.tar.zst
echo "89fb61549a437d65076a092a367fcb264fc7045ee9ebef48cd81f5a76a5588f8 mingw-w64-x86_64-hidapi-0.15.0-2-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-libusb-1.0.30-1-any.pkg.tar.zst
echo "124edc26b009678a4c5e759481a364abf63ed7f2f49a53092e8bd0a47c0c0740 mingw-w64-x86_64-libusb-1.0.30-1-any.pkg.tar.zst" | sha256sum -c
pacman -U --noconfirm mingw-w64-x86_64-hidapi-0.15.0-2-any.pkg.tar.zst mingw-w64-x86_64-libusb-1.0.30-1-any.pkg.tar.zst
- name: Install boost v1.87.0
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst
echo "241919a5885a9270d0e0937e71cf5e146c2a8cabecc2714f09248350181cb1b6 mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst" | sha256sum -c
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst
echo "5fd77df3e5983ba0d9c689f46151119e0e59b3da6850c5a0ba54068eeae7749c mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst" | sha256sum -c
# the version that monero-cpp builds with. The boost-libs in the repo is a newer rebuild that needs the split gcc runtime
pacman -U --noconfirm mingw-w64-x86_64-boost-1.87.0-3-any.pkg.tar.zst mingw-w64-x86_64-boost-libs-1.87.0-3-any.pkg.tar.zst
- name: Install pybind11 v2.13.6
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst
echo "5b56ad87bc544336b2d51edb8bb0614f46542571362daf4d7e53bf23120175a1 mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst" | sha256sum -c
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.13.6-2-any.pkg.tar.zst
- name: Restore ccache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-windows
restore-keys: |
ccache-windows_
- name: Reset ccache statistics
run: ccache --zero-stats
- name: Build monero
run: |
cd external/monero-cpp/external/monero-project
mkdir -p build/release
cd build/release
cmake -G "MSYS Makefiles" \
-D STATIC=ON \
-D ARCH="x86-64" \
-D BUILD_64=ON \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_TAG="win-x64" \
-D CMAKE_TOOLCHAIN_FILE="../../cmake/64-bit-toolchain.cmake" \
-D MSYS2_FOLDER=$(cd $MINGW_PREFIX/.. && pwd -W) \
../../
make -j$(nproc) wallet cryptonote_protocol
- name: Build monero-cpp
run: |
cd external/monero-cpp
mkdir -p build
cd build
cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build . --parallel $(nproc)
- name: Build wheel
run: |
export WIN_PYTHON_EXE=$(cygpath -u "$pythonLocation/python.exe")
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
"$WIN_PYTHON_EXE" -m pip wheel . -w dist --no-build-isolation \
-C cmake.define.Python3_EXECUTABLE="$WIN_PYTHON_EXE" \
-C cmake.define.Python3_FIND_STRATEGY=LOCATION \
-C cmake.define.Python3_FIND_REGISTRY=NEVER
- name: Show ccache statistics
if: ${{ !cancelled() }}
run: ccache --show-stats
- name: Save ccache
# Pull requests only read the cache, pushes to main and manual runs replace it.
if: ${{ !cancelled() && github.event_name != 'pull_request' }}
uses: ./.github/actions/save-ccache
with:
key: ccache-windows
- name: Repair wheel with delvewheel
run: |
export WIN_PYTHON_EXE=$(cygpath -u "$pythonLocation/python.exe")
MINGW_BIN_WIN=$(cygpath -w "$MINGW_PREFIX/bin")
"$WIN_PYTHON_EXE" -m delvewheel repair dist/*.whl -w wheelhouse --add-path "$MINGW_BIN_WIN"
# the flags of the image (ASLR, DEP) and the exports of the module in the wheel that is published
- name: Check hardening and exports
run: |
export WIN_PYTHON_EXE=$(cygpath -u "$pythonLocation/python.exe")
"$WIN_PYTHON_EXE" -m zipfile -e wheelhouse/*.whl wheel-check
bash bin/check_pe_hardening.sh wheel-check/monero*.pyd
- name: Upload artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: monero-python-win-amd64
path: wheelhouse/*.whl