Skip to content

Commit a169ecc

Browse files
ci: build with openssl@3 on macOS, brew's openssl is OpenSSL 4 now
The macos-15-arm64 runner image of 28 October (20261028.0489) ships openssl@4 4.1.0, and brew --prefix openssl points to it. monero-project and monero-cpp both run that command on macOS and overwrite OPENSSL_ROOT_DIR with the result, and boost 1.85 does not build with OpenSSL 4: asio's rfc2818_verification.ipp reads ASN1_IA5STRING members, which are opaque now, so "Build monero" fails in epee/abstract_http_client.cpp. GitHub rolls the images out gradually, the run of the release pull request landed on the previous image (20260907, openssl@3 3.6.4) and passed, the next ones on main did not. macos-14 and macos-15-intel are still on images with openssl@3 and will follow. Install openssl@3, export its prefix in OPENSSL_ROOT_DIR and pass it with -D to the cmake of monero-project and monero-cpp, which ignore the environment. The module finds it in the environment. Applies to Tests and Build MacOS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent e46cc00 commit a169ecc

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎.github/workflows/build-macos.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ jobs:
4141

4242
- name: Install dependencies
4343
run: |
44-
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf unbound ccache
44+
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl@3 zmq libpgm miniupnpc expat libunwind-headers protobuf unbound ccache
4545
brew unlink boost || true
4646
brew link boost@1.85 --force
47+
# brew's openssl is OpenSSL 4 on the newer runner images, which boost 1.85 does not build with.
48+
# monero-project and monero-cpp take brew's openssl unless they are given another one, so
49+
# they get it on the command line, and the module finds it in the environment
50+
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
4751
pip3 install pytest pytest-cov setuptools wheel scikit-build-core --break-system-packages
4852
4953
- name: Install pybind11 v2.13.6
@@ -70,7 +74,7 @@ jobs:
7074
cd external/monero-cpp/external/monero-project
7175
mkdir -p build/release
7276
cd build/release
73-
cmake -DSTATIC=ON -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Release ../../
77+
cmake -DSTATIC=ON -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" ../../
7478
make -j3 wallet cryptonote_protocol
7579
cd ../../../../../../
7680
@@ -79,7 +83,7 @@ jobs:
7983
cd external/monero-cpp
8084
mkdir -p build
8185
cd build
82-
cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
86+
cmake .. -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
8387
cmake --build .
8488
make -j3
8589
cd ../../../

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,13 @@ jobs:
420420

421421
- name: Install dependencies
422422
run: |
423-
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf unbound ccache
423+
HOMEBREW_NO_AUTO_UPDATE=1 brew install python boost@1.85 hidapi openssl@3 zmq libpgm miniupnpc expat libunwind-headers protobuf unbound ccache
424424
brew unlink boost || true
425425
brew link boost@1.85 --force
426+
# brew's openssl is OpenSSL 4 on the newer runner images, which boost 1.85 does not build with.
427+
# monero-project and monero-cpp take brew's openssl unless they are given another one, so
428+
# they get it on the command line, and the module finds it in the environment
429+
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
426430
pip3 install pytest pytest-rerunfailures pytest-timeout pytest-cov setuptools wheel scikit-build-core --break-system-packages
427431
428432
- name: Install pybind11 v2.13.6
@@ -445,7 +449,7 @@ jobs:
445449
cd external/monero-cpp/external/monero-project
446450
mkdir -p build/release
447451
cd build/release
448-
cmake -DSTATIC=ON -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Release ../../
452+
cmake -DSTATIC=ON -DBUILD_64=ON -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" ../../
449453
make -j3 wallet cryptonote_protocol
450454
cd ../../../../../../
451455
@@ -454,7 +458,7 @@ jobs:
454458
cd external/monero-cpp
455459
mkdir -p build
456460
cd build
457-
cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
461+
cmake .. -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
458462
cmake --build .
459463
make -j3
460464
cd ../../../

0 commit comments

Comments
 (0)