Skip to content

Update boost.mk

Update boost.mk #334

Workflow file for this run

name: Continuous Integration
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- 'doc/**'
- 'contrib/**'
- '**/*.md'
jobs:
build:
name: ${{ matrix.name }}
env:
MAKEJOBS: "-j3"
CHECK_DOC: "0"
CCACHE_SIZE: "100M"
CCACHE_TEMPDIR: /tmp/.ccache-temp
CCACHE_COMPRESS: "1"
PYTHON_DEBUG: "1"
CACHE_NONCE: "1"
WINEDEBUG: fixme-all
WINEPREFIX: /tmp/wineprefix/
SDK_URL: https://depends.dogecoincore.org
strategy:
fail-fast: false
matrix:
name:
- aarch64-linux
- armhf-linux
- i686-linux
- i686-win
- x86_64-linux
- x86_64-macos
- x86_64-win
include:
- name: i686-linux
host: i686-pc-linux-gnu
container: ubuntu:20.04
packages: g++-multilib bc python3-zmq
run-bench: false
check-security: true
check-symbols: false
dep-opts: "NO_QT=1"
config-opts: "--enable-zmq --enable-glibc-back-compat LDFLAGS=-static-libstdc++ --disable-tests"
goal: install
- name: armhf-linux
host: arm-linux-gnueabihf
container: ubuntu:20.04
packages: g++-arm-linux-gnueabihf qemu-user-static qemu-user
run-bench: false
check-security: true
check-symbols: false
dep-opts: "NO_QT=1"
config-opts: "--enable-glibc-back-compat LDFLAGS=-static-libstdc++ --disable-tests"
goal: install
- name: aarch64-linux
host: aarch64-linux-gnu
container: ubuntu:20.04
packages: g++-aarch64-linux-gnu qemu-user-static qemu-user
run-bench: false
check-security: true
check-symbols: false
dep-opts: "NO_QT=1"
config-opts: "--enable-zmq --enable-glibc-back-compat LDFLAGS=-static-libstdc++ --disable-tests"
goal: install
- name: x86_64-linux
host: x86_64-unknown-linux-gnu
container: ubuntu:20.04
packages: python3 g++-multilib bc python3-zmq
run-bench: false
check-security: true
check-symbols: false
dep-opts: "NO_QT=1"
config-opts: "--enable-zmq --enable-glibc-back-compat LDFLAGS=-static-libstdc++ --disable-tests"
goal: install
- name: i686-win
host: i686-w64-mingw32
container: ubuntu:20.04
container-options: --privileged
packages: python3 nsis g++-mingw-w64-i686 wine32 bc wine-binfmt binfmt-support
preinstall: |
dpkg --add-architecture i386
postinstall: |
update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
update-binfmts --import /usr/share/binfmts/wine
update-binfmts --enable
update-binfmts --display
run-bench: false
check-security: true
check-symbols: false
dep-opts: ""
config-opts: "--with-gui=qt5 --disable-tests"
goal: install
- name: x86_64-win
host: x86_64-w64-mingw32
container: ubuntu:20.04
container-options: --privileged
packages: python3 nsis g++-mingw-w64-x86-64 wine64 bc wine-binfmt
postinstall: |
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
update-binfmts --import /usr/share/binfmts/wine
update-binfmts --enable
update-binfmts --display
run-bench: false
check-security: true
check-symbols: false
dep-opts: ""
config-opts: "--with-gui=qt5 --disable-tests"
goal: install
- name: x86_64-macos
host: x86_64-apple-darwin11
container: ubuntu:20.04
packages: cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools libtinfo5 xorriso
run-bench: false
check-security: true
check-symbols: false
dep-opts: ""
config-opts: "--with-gui=qt5 --disable-tests"
goal: deploy
sdk: 10.12
sdk-shasum: "19121cfc324beb5c7222aa75a1e2834cbdd315b944674bbdc5387e7b6339c456"
runs-on: ubuntu-22.04
container:
image: ${{ matrix.container }}
options: ${{ matrix.container-options == '' && '-e 1ARCH=1ARCH' || matrix.container-options }}
steps:
- name: Configure container
run: |
ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime
echo Etc/UTC > /etc/timezone
mkdir -p $WINEPREFIX
uname -a
- name: Pre install
if: ${{ matrix.preinstall }}
run: ${{ matrix.preinstall }}
- name: Install packages
run: |
apt-get update
apt-get install -y build-essential libtool autotools-dev automake \
pkg-config bsdmainutils curl ca-certificates ccache rsync git \
procps bison python3 python3-pip python3-setuptools python3-wheel autoconf-archive
ln -sf /usr/bin/python3 /usr/bin/python
apt-get install -y ${{ matrix.packages }}
python3 -m pip install setuptools==70.3.0 --upgrade
python3 -m pip install lief
- name: Post install
if: ${{ matrix.postinstall }}
run: ${{ matrix.postinstall }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clear depends cache
if: ${{ matrix.sdk }}
run: |
rm -rf depends/work
rm -rf depends/built
rm -rf depends/SDKs
- name: Fix permissions and init submodules
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git submodule update --init --recursive
chmod +x depends/config.guess depends/config.sub || true
- name: Install SDK
if: ${{ matrix.sdk }}
shell: bash
run: |
set -euo pipefail
mkdir -p depends/sdk-sources depends/SDKs
# Use the only fully compatible SDK for Darwin11 builds
SDK_NAME="MacOSX10.12.sdk"
SDK_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/11.0-11.1/${SDK_NAME}.tar.xz"
SDK_SHA="19121cfc324beb5c7222aa75a1e2834cbdd315b944674bbdc5387e7b6339c456"
echo "📥 Downloading $SDK_NAME from phracker…"
curl -L --fail \
"$SDK_URL" \
-o "depends/sdk-sources/${SDK_NAME}.tar.xz"
echo "🔐 Verifying checksum…"
echo "${SDK_SHA} depends/sdk-sources/${SDK_NAME}.tar.xz" | sha256sum -c
echo "📦 Extracting SDK…"
tar -xf "depends/sdk-sources/${SDK_NAME}.tar.xz" -C depends/SDKs
# Export environment for depends system
echo "SDKROOT=$GITHUB_WORKSPACE/depends/SDKs/${SDK_NAME}" >> $GITHUB_ENV
echo "OSX_SDK_PATH=$GITHUB_WORKSPACE/depends/SDKs/${SDK_NAME}" >> $GITHUB_ENV
echo "OSX_SDK=10.12" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.8" >> $GITHUB_ENV
echo "✅ Installed macOS SDK: depends/SDKs/${SDK_NAME}"
# - name: Patch macOS SDK using 10.12 headers (merged all patches)
# if: matrix.name == 'x86_64-macos'
# shell: bash
# run: |
# set -euo pipefail
# echo "🔧 Merged macOS SDK patch (10.12 → 11.0, stdarg fix + libc++ 11.0.0)"
# SDK_TARGET="$GITHUB_WORKSPACE/depends/SDKs/MacOSX10.12.sdk"
# SDK_PATCH_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/11.0-11.1/MacOSX10.12.sdk.tar.xz"
# SDK_PATCH_SHA="19121cfc324beb5c7222aa75a1e2834cbdd315b944674bbdc5387e7b6339c456"
# LIBCXX_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/libcxx-11.0.0.src.tar.xz"
# LIBCXX_SHA="6c1ee6690122f2711a77bc19241834a9219dda5036e1597bfa397f341a9b8b7a"
# mkdir -p /tmp/sdkpatch
# cd /tmp/sdkpatch
# echo "📥 Downloading MacOSX10.12.sdk…"
# curl -L --fail -o sdk.tar.xz "$SDK_PATCH_URL"
# echo "🔐 Verifying SHA256 for SDK…"
# echo "$SDK_PATCH_SHA sdk.tar.xz" | sha256sum -c
# echo "📦 Extracting 10.12 SDK headers…"
# tar -xf sdk.tar.xz "MacOSX10.12.sdk/usr/include"
# PATCH_SRC="MacOSX10.12.sdk/usr/include"
# echo "📁 Installing COMPLETE Darwin + C headers from 10.12 → 11.0…"
# rsync -av --ignore-existing "$PATCH_SRC/" "$SDK_TARGET/usr/include/"
# echo "📁 Injecting legacy C++ headers (c++/4.2.1)…"
# mkdir -p "$SDK_TARGET/usr/include/c++"
# cp -r "$PATCH_SRC/c++/4.2.1" "$SDK_TARGET/usr/include/c++/" || true
# # Remove any old v1 folder (we replace it with libc++ 11)
# if [ -L "$SDK_TARGET/usr/include/c++/v1" ] || [ -d "$SDK_TARGET/usr/include/c++/v1" ]; then
# rm -rf "$SDK_TARGET/usr/include/c++/v1"
# fi
# echo "📄 Installing ONLY stdarg.h from LLVM 11 (others don't exist)…"
# curl -L --fail \
# "https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-11.0.0/clang/lib/Headers/stdarg.h" \
# -o "$SDK_TARGET/usr/include/stdarg.h"
# echo "🛠️ Creating required stdarg compatibility shims…"
# cat > "$SDK_TARGET/usr/include/__stdarg_header_macro.h" <<'EOF'
# #ifndef __STDARG_HEADER_MACRO_H
# #define __STDARG_HEADER_MACRO_H
# /* No-op shim for macOS cross-compile */
# #endif
# EOF
# cat > "$SDK_TARGET/usr/include/__stdarg___gnuc_va_list.h" <<'EOF'
# #ifndef __STDARG___GNUC_VA_LIST_H
# #define __STDARG___GNUC_VA_LIST_H
# typedef __builtin_va_list __gnuc_va_list;
# #endif
# EOF
# cat > "$SDK_TARGET/usr/include/__stdarg_va_list.h" <<'EOF'
# #ifndef __STDARG_VA_LIST_H
# #define __STDARG_VA_LIST_H
# typedef __builtin_va_list va_list;
# #endif
# EOF
# cat > "$SDK_TARGET/usr/include/__stdarg_va_copy.h" <<'EOF'
# #ifndef __STDARG_VA_COPY_H
# #define __STDARG_VA_COPY_H
# #define va_copy(dest, src) __builtin_va_copy(dest, src)
# #endif
# EOF
# cat > "$SDK_TARGET/usr/include/__stdarg_va_arg.h" <<'EOF'
# #ifndef __STDARG_VA_ARG_H
# #define __STDARG_VA_ARG_H
# #define va_arg(ap, type) __builtin_va_arg(ap, type)
# #endif
# EOF
# echo "🛠️ Creating missing shim: __gnuc_va_list.h"
# cat > "$SDK_TARGET/usr/include/__gnuc_va_list.h" <<'EOF'
# #ifndef __GNUC_VA_LIST_H
# #define __GNUC_VA_LIST_H
# #include <stdarg.h>
# typedef __builtin_va_list __gnuc_va_list;
# #endif
# EOF
# echo "📦 Downloading libc++ 11.0.0 sources…"
# curl -L --fail -o libcxx-11.0.0.src.tar.xz "$LIBCXX_URL"
# echo "🔐 Verifying SHA256 for libc++ 11.0.0…"
# echo "$LIBCXX_SHA libcxx-11.0.0.src.tar.xz" | sha256sum -c
# mkdir -p /tmp/libcxx11
# tar -xf libcxx-11.0.0.src.tar.xz -C /tmp/libcxx11
# LIBCXX_INC="/tmp/libcxx11/libcxx-11.0.0.src/include"
# if [ ! -d "$LIBCXX_INC" ]; then
# echo "❌ libc++ 11 include dir not found at: $LIBCXX_INC"
# exit 1
# fi
# echo "📁 Installing libc++ 11.0.0 headers into SDK (c++/v1)…"
# rm -rf "$SDK_TARGET/usr/include/c++/v1"
# mkdir -p "$SDK_TARGET/usr/include/c++/v1"
# cp -R "$LIBCXX_INC/"* "$SDK_TARGET/usr/include/c++/v1/"
# echo "📄 Installing __config_site"
# if [ -f "$LIBCXX_INC/__config_site.in" ]; then
# cp "$LIBCXX_INC/__config_site.in" "$SDK_TARGET/usr/include/c++/v1/__config_site"
# else
# echo "#ifndef _LIBCPP_CONFIG_SITE
# #define _LIBCPP_CONFIG_SITE
# #define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE
# #endif" > "$SDK_TARGET/usr/include/c++/v1/__config_site"
# fi
# echo "🧪 Sanity check: libc++ headers (v1)"
# REQUIRED_CPP_V1=(type_traits utility tuple memory string vector algorithm new)
# for hdr in "${REQUIRED_CPP_V1[@]}"; do
# if [ ! -f "$SDK_TARGET/usr/include/c++/v1/$hdr" ]; then
# echo "❌ Missing libc++ v1 header: $hdr"
# exit 1
# fi
# done
# echo "🧪 Sanity check: legacy C++ headers (4.2.1)"
# REQUIRED_CPP_421=(cstddef iostream)
# for hdr in "${REQUIRED_CPP_421[@]}"; do
# if [ ! -f "$SDK_TARGET/usr/include/c++/4.2.1/$hdr" ]; then
# echo "❌ Missing legacy C++ 4.2.1 header: $hdr"
# exit 1
# fi
# done
# echo "🧪 Sanity check: basic C system headers"
# REQUIRED_C=(stdarg.h stddef.h stdint.h stdio.h errno.h unistd.h ctype.h stdlib.h)
# for hdr in "${REQUIRED_C[@]}"; do
# if [ ! -f "$SDK_TARGET/usr/include/$hdr" ]; then
# echo "❌ Missing C header: $hdr"
# exit 1
# fi
# done
# echo "🧪 Sanity check: Darwin folders"
# for dir in sys machine pthread dispatch; do
# if [ ! -d "$SDK_TARGET/usr/include/$dir" ]; then
# echo "❌ Missing Darwin folder: $dir"
# exit 1
# fi
# done
# echo "✅ macOS SDK fully patched — COMPLETE Darwin + C runtime, stdarg family shims, libc++ 11.0.0 v1, and legacy 4.2.1 installed."
- name: Force final macOS SDK env for depends
if: matrix.name == 'x86_64-macos'
shell: bash
run: |
echo "🔧 Forcing final macOS SDK environment (depends override)"
OSX_SDK=10.12
FINAL_SDK_PATH="$GITHUB_WORKSPACE/depends/SDKs/MacOSX10.12.sdk"
if [ ! -d "$FINAL_SDK_PATH" ]; then
echo "❌ Final SDK path missing: $FINAL_SDK_PATH"
ls -R depends/SDKs
exit 1
fi
echo "SDKROOT=$FINAL_SDK_PATH" >> $GITHUB_ENV
echo "OSX_SDK_PATH=$FINAL_SDK_PATH" >> $GITHUB_ENV
echo "OSX_SDK=10.12" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.8" >> $GITHUB_ENV
echo "✅ Final SDK env set:"
echo " SDKROOT=$FINAL_SDK_PATH"
echo " OSX_SDK_PATH=$FINAL_SDK_PATH"
echo " MACOSX_DEPLOYMENT_TARGET=10.8"
- name: Configure macOS toolchain env
if: matrix.name == 'x86_64-macos'
shell: bash
run: |
SDK_PATH="$GITHUB_WORKSPACE/depends/SDKs/MacOSX10.12.sdk"
echo "Using SDK: $SDK_PATH"
if [ ! -d "$SDK_PATH" ]; then
echo "❌ SDK directory missing!"
ls -R depends/SDKs
exit 1
fi
echo "SDKROOT=$SDK_PATH" >> $GITHUB_ENV
echo "OSX_SDK_PATH=$SDK_PATH" >> $GITHUB_ENV
echo "OSX_SDK=10.12" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.8" >> $GITHUB_ENV
echo "🔧 macOS cross-compile environment configured (no global sysroot flags)."
# - name: Build depends
# run: make $MAKEJOBS -C depends HOST=${{ matrix.host }} ${{ matrix.dep-opts }}
- name: Build depends (non-mac)
if: matrix.name != 'x86_64-macos'
run: make $MAKEJOBS -C depends HOST=${{ matrix.host }} ${{ matrix.dep-opts }}
- name: Build depends (macOS)
if: matrix.name == 'x86_64-macos'
shell: bash
run: |
set -e
echo "▶ macOS depends build starting…"
export V=1
# Heartbeat so CI doesn't timeout
( while true; do echo "❤️ still building mac depends…"; sleep 60; done ) &
echo "▶ Installing auto-detect compiler wrappers…"
mkdir -p autodetect
create_wrapper() {
WRAP="$1"
FALLBACK="$2"
cat > autodetect/$WRAP <<EOF
#!/bin/bash
WRAPDIR="\$(cd "\$(dirname "\$0")" && pwd)"
# If Darwin toolchain already detected:
if [ -f "\$WRAPDIR/.toolchain" ]; then
REALDIR="\$(cat "\$WRAPDIR/.toolchain")"
exec "\$REALDIR/\$(basename "\$0")" "\$@"
fi
# Look for Darwin clang compiled by native_cctools:
FOUND=\$(find "\$WRAPDIR/../depends" -maxdepth 7 -type f -name clang 2>/dev/null | grep native | head -n1)
if [ -n "\$FOUND" ]; then
REALDIR="\$(dirname "\$FOUND")"
echo "\$REALDIR" > "\$WRAPDIR/.toolchain"
echo "🚀 Auto-detected Darwin toolchain at: \$REALDIR"
exec "\$REALDIR/\$(basename "\$0")" "\$@"
fi
# Fallback to system compiler
exec $FALLBACK "\$@"
EOF
chmod +x autodetect/$WRAP
}
#
# DO NOT wrap gcc/g++ EVER.
#
create_wrapper clang /usr/bin/cc
create_wrapper clang++ /usr/bin/c++
create_wrapper cc /usr/bin/cc
export PATH="$(pwd)/autodetect:$PATH"
echo "▶ PATH = $PATH"
#
# === COMPILER SETUP (CORRECT, STABLE, MATCHES BITCOIN CORE) ===
#
# Wrapper compilers — these correctly auto-detect native_cctools
export CC=clang
export CXX=clang++
# Native compilers used ONLY for Boost bootstrap (b2 engine)
export CC_FOR_BUILD=/usr/bin/gcc
export CXX_FOR_BUILD=/usr/bin/g++
echo "Using CC=$CC"
echo "Using CXX=$CXX"
echo "Using CC_FOR_BUILD=$CC_FOR_BUILD"
echo "Using CXX_FOR_BUILD=$CXX_FOR_BUILD"
#
# Path used ONLY during Boost bootstrap → bypasses wrappers
#
export BOOST_NO_WRAP_PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
echo "BOOST_NO_WRAP_PATH=$BOOST_NO_WRAP_PATH"
#
# Build depends
#
echo "▶ Building depends for macOS…"
make $MAKEJOBS -C depends HOST=x86_64-apple-darwin11
- name: Build AdventureCoin
env:
GIT_COMMIT_ID: ${{ github.sha }}
run: |
chmod +x autogen.sh
chmod -R +x depends || true
chmod +x share/genbuild.sh
SHORT_COMMIT=$(echo "$GIT_COMMIT_ID" | cut -c1-7)
depends/${{ matrix.host }}/native/bin/ccache --max-size=$CCACHE_SIZE
./autogen.sh
chmod +x configure || true
./configure --prefix=`pwd`/depends/${{ matrix.host }} ${{ matrix.config-opts }} --enable-reduce-exports \
CFLAGS="-std=c++17 -DGIT_COMMIT_ID=\\\"$SHORT_COMMIT\\\"" \
CXXFLAGS="-std=c++17 -DGIT_COMMIT_ID=\\\"$SHORT_COMMIT\\\"" || ( cat config.log && false)
make $MAKEJOBS ${{ matrix.goal }} CXXFLAGS="-std=c++17" || (echo "Build failure. Verbose build follows." && make ${{ matrix.goal }} CXXFLAGS="-std=c++17" V=1 ; false)
- name: Run benchmark
if: ${{ matrix.run-bench }}
run: |
src/bench/bench_adventurecoin > ${{ matrix.name }}-bench.csv
cat ${{ matrix.name }}-bench.csv
- name: Fix permissions for security-check.py
run: chmod +x contrib/devtools/security-check.py
- name: Check security
if: ${{ matrix.check-security }}
run: make -C src check-security
- name: Check symbols
if: ${{ matrix.check-symbols }}
run: make -C src check-symbols
- name: Cleanup qa artifacts
run: rm -rf qa/cache || true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: adventurecoin-${{ github.sha }}-${{ matrix.name }}
path: |
depends/${{ matrix.host }}/bin/adventurecoin*
depends/${{ matrix.host }}/lib/libbitcoinconsensus*
depends/${{ matrix.host }}/include/bitcoinconsensus.h
depends/${{ matrix.host }}/share/man/man1/adventurecoin*
dist/AdventureCoin-Qt.app
AdventureCoin-Core.dmg
${{ matrix.name }}-bench.csv