From 454fbfd858f282858b372361b660ac79d35d327b Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Thu, 4 Apr 2024 01:30:26 -0700 Subject: [PATCH] [GA] Bump native macOS runner versions A recent 3rd party server outage for the miniupnpc library has caused macOS 11 jobs to fail. While the homebrew package manager for macOS has fixed the issue on their end, GitHub has no clear intention to update their macOS 11 runner image due to macOS 11 runners already being deprecated. macOS 11 support will be removed from GA completely on June, 28 2024. Pre-emptively bump the os runner versions we use to macOS 12 and macOS 14 (the latter of which runs on Apple's new CPU architecture). Relevant and required build system changes have also been applied to support the new macOS 14 runner environment. --- .github/workflows/build-and-test.yml | 36 ++++++++++++++-------------- CMakeLists.txt | 18 ++++++++------ configure.ac | 1 + src/Makefile.am | 2 +- src/Makefile.test.include | 2 +- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b3f42d99eb8f1..d68b41deeecb1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -88,19 +88,19 @@ jobs: cxx: g++ - name: macOS - os: macos-11 - packages: llvm@12 python@3.8 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config libevent qrencode gmp libsodium rust + os: macos-12 + packages: llvm@13 python@3.8 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config libevent qrencode gmp libsodium rust no_qt: true boost_root: true - cc: $(brew --prefix llvm@12)/bin/clang - cxx: $(brew --prefix llvm@12)/bin/clang++ + cc: $(brew --prefix llvm@13)/bin/clang + cxx: $(brew --prefix llvm@13)/bin/clang++ - name: macOS-latest - os: macos-latest - packages: llvm@13 python@3.8 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium rust + os: macos-14 + packages: llvm@14 python@3.8 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium rust boost_root: true - cc: $(brew --prefix llvm@13)/bin/clang - cxx: $(brew --prefix llvm@13)/bin/clang++ + cc: $(brew --prefix llvm@14)/bin/clang + cxx: $(brew --prefix llvm@14)/bin/clang++ steps: - name: Get Source @@ -115,11 +115,6 @@ jobs: fi if [[ ${{ matrix.config.os }} = macos* ]]; then brew install "$APT_BASE" ${{ matrix.config.packages }} - # GA's macOS 11 image is inconsistent as to if it includes a pre-installed version of boost. Force linking - # to the specified version (1.76), which will overwrite the symlinks to a pre-existing version if it exists. - if [ "${{ matrix.config.os }}" = "macos-11" ]; then - brew link --overwrite -f boost@1.76 - fi fi - name: ccache cache files @@ -139,8 +134,13 @@ jobs: fi if [ "${{ matrix.config.boost_root }}" = "true" ]; then export CI_BOOST=1 - export CPPFLAGS="-I/usr/local/opt/boost@1.76/include" - export LDFLAGS="-L/usr/local/opt/boost@1.76/lib" + if [ "${{ matrix.config.os }}" = "macos-14" ]; then + export LDFLAGS="-L/opt/homebrew/opt/boost@1.76/lib" + export CPPFLAGS="-I/opt/homebrew/opt/boost@1.76/include" + else + export CPPFLAGS="-I/usr/local/opt/boost@1.76/include" + export LDFLAGS="-L/usr/local/opt/boost@1.76/lib" + fi fi fi export CC @@ -188,7 +188,7 @@ jobs: - name: x64-macOS id: macOS-nodepends - os: macos-11 + os: macos-12 brew_install: autoconf automake ccache berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config python@3.8 libevent qrencode gmp libsodium rust librsvg unit_tests: true functional_tests: true @@ -198,14 +198,14 @@ jobs: - name: x64-macOS-latest id: macOS-nodepends-latest - os: macos-latest + os: macos-14 brew_install: autoconf automake ccache berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config python@3.8 qt@5 zmq libevent qrencode gmp libsodium rust librsvg unit_tests: true functional_tests: true goal: deploy cc: clang cxx: clang++ - BITCOIN_CONFIG: "--enable-zmq --enable-gui --enable-reduce-exports --enable-werror --enable-debug --with-boost=/usr/local/opt/boost@1.76" + BITCOIN_CONFIG: "--enable-zmq --enable-gui --enable-reduce-exports --enable-werror --enable-debug --with-boost=/opt/homebrew/opt/boost@1.76" steps: - name: Get Source diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ef77b103b98c..f799b331f9009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,17 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") else() set(BerkeleyDB_ROOT_DIR "/usr/local/Cellar/berkeley-db@4/${BDB_VER}/" ) endif() + # Github Actions specific Boost override (macOS only) + if(DEFINED ENV{CI_BOOST}) + if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm") + set(BOOST_R "--with-boost=/opt/homebrew/opt/boost@1.76") + set(ENV{BOOSTROOT} "/opt/homebrew/opt/boost@1.76") + else() + set(BOOST_R "--with-boost=/usr/local/opt/boost@1.76") + set(ENV{BOOSTROOT} "/usr/local/opt/boost@1.76") + endif() + message(STATUS "Boost Root set to: ${BOOST_R}") + endif() set(Boost_USE_MULTITHREADED ON) set(Boost_NO_BOOST_CMAKE ON) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -74,13 +85,6 @@ if(DEFINED ENV{NO_QT}) message(STATUS "Skipping GUI Wallet Build!") endif() -# Github Actions specific Boost override -if(DEFINED ENV{CI_BOOST}) - set(BOOST_R "--with-boost=/usr/local/opt/boost@1.76") - set(ENV{BOOSTROOT} "/usr/local/opt/boost@1.76") - message(STATUS "Boost Root set to: ${BOOST_R}") -endif() - # Find Dependencies find_package(BerkeleyDB ${BDB_VER} REQUIRED) if(BerkeleyDB_FOUND) diff --git a/configure.ac b/configure.ac index d2861368fb51c..c4ab4ff933063 100644 --- a/configure.ac +++ b/configure.ac @@ -1544,6 +1544,7 @@ AC_SUBST(NATPMP_CPPFLAGS) AC_SUBST(NATPMP_LIBS) AC_SUBST(EVENT_LIBS) AC_SUBST(EVENT_PTHREADS_LIBS) +AC_SUBST(SODIUM_CFLAGS) AC_SUBST(SODIUM_LIBS) AC_SUBST(ZMQ_LIBS) AC_SUBST(LIBZCASH_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 267df235bb03a..e1371b32323db 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ DIST_SUBDIRS = secp256k1 univalue chiabls AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) -AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) +AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(SODIUM_CFLAGS) AM_LIBTOOLFLAGS = --preserve-dup-deps EXTRA_LIBRARIES = diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 1567b90685b1b..eb6f4dceb5d97 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -189,7 +189,7 @@ SAPLING_TESTS +=\ endif test_test_pivx_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(SAPLING_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) -test_test_pivx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_FLAGS) +test_test_pivx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS) test_test_pivx_LDADD = if ENABLE_WALLET