Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
99 changes: 4 additions & 95 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ local android_build_steps(android_abi, android_platform=21, jobs=6, cmake_extra=
'-DCMAKE_BUILD_TYPE=Release ' +
'-DCMAKE_TOOLCHAIN_FILE=/usr/lib/android-ndk/build/cmake/android.toolchain.cmake ' +
'-DANDROID_PLATFORM=' + android_platform + ' -DANDROID_ABI=' + android_abi + ' ' +
cmake_options({ MONERO_SLOW_HASH: true, WARNINGS_AS_ERRORS: false, BUILD_TESTS: false }) +
cmake_options({ MONERO_SLOW_HASH: true, WARNINGS_AS_ERRORS: false, BUILD_TESTS: false, RANDOMX_ENABLE_JIT: false }) +
'-DLOCAL_MIRROR=https://oxen.rocks/deps ' +
'-DBUILD_STATIC_DEPS=ON -DSTATIC=ON -G Ninja ' + cmake_extra,
'-DBUILD_STATIC_DEPS=ON -DSTATIC=ON -DANDROID_STL=c++_shared -G Ninja ' + cmake_extra,
'ninja -j' + jobs + ' -v wallet_merged',
'cd ..',
];
Expand Down Expand Up @@ -303,99 +303,6 @@ local gui_wallet_step_darwin = {


[
{
name: 'lint check',
kind: 'pipeline',
type: 'docker',
steps: [{
name: 'build',
image: docker_base + 'lint',
pull: 'always',
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-19 jsonnet',
'./contrib/drone-format-verify.sh',
],
}],
},

// Various debian builds
debian_pipeline('Debian sid (w/ tests) (amd64)', docker_base + 'debian-sid', lto=true, run_tests=true, build_everything=true),
debian_pipeline('Debian sid Debug (amd64)', docker_base + 'debian-sid', build_type='Debug', build_everything=true, cmake_extra='-DBUILD_DEBUG_UTILS=ON'),
clang(19),
debian_pipeline('Debian stable (i386)', docker_base + 'debian-stable/i386', cmake_extra='-DDOWNLOAD_SODIUM=ON -DARCH_ID=i386 -DARCH=i686'),
debian_pipeline('Debian bullseye (amd64)', docker_base + 'debian-bullseye'),
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),

// ARM builds (ARM64 and armhf)
debian_pipeline('Debian sid (ARM64)', docker_base + 'debian-sid', arch='arm64', build_tests=false),
debian_pipeline('Debian stable (armhf)',
docker_base + 'debian-stable/arm32v7',
arch='arm64',
build_tests=false,
cmake_extra='-DARCH_ID=armhf'),

// Static build (on focal) which gets uploaded to oxen.rocks:
debian_pipeline(
'Static (focal amd64)',
docker_base + 'ubuntu-focal',
deps=['g++-10'] + static_build_deps,
cmake_extra='-DBUILD_STATIC_DEPS=ON -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DARCH=x86-64',
build_tests=false,
lto=true,
extra_cmds=static_check_and_upload,
),

snapshot_deb('sid'),
snapshot_deb('sid', buildarch='arm64', debarch='arm64', jobs=1),
snapshot_deb('trixie'),
snapshot_deb('bookworm'),
snapshot_deb('bookworm', buildarch='arm64', debarch='arm64', jobs=1),
snapshot_deb('bullseye'),
snapshot_deb('oracular'),
snapshot_deb('noble'),
snapshot_deb('noble', buildarch='arm64', debarch='arm64', jobs=1),
snapshot_deb('jammy'),
snapshot_deb('focal'),

// Static mingw build (on focal) which gets uploaded to oxen.rocks:
debian_pipeline(
'Static (win64)',
docker_base + 'debian-win32-cross',
deps=['g++', 'g++-mingw-w64-x86-64'] + static_build_deps,
cmake_extra='-DCMAKE_TOOLCHAIN_FILE=../cmake/64-bit-toolchain.cmake -DBUILD_STATIC_DEPS=ON -DARCH=x86-64',
build_tests=false,
lto=false,
test_oxend=false,
extra_cmds=[
'ninja strip_binaries',
'ninja create_zip',
'../utils/build_scripts/drone-static-upload.sh',
],
/*extra_steps=[gui_wallet_step('debian:stable', wine=true)]*/
),

// Macos builds:
mac_builder('macOS (Release, ARM) w/ tests', run_tests=true, arch='arm64'),
mac_builder('macOS (Debug, ARM)', build_type='Debug', cmake_extra='-DBUILD_DEBUG_UTILS=ON', arch='arm64'),
mac_builder('macOS (Release, Intel) w/ tests', run_tests=true, arch='amd64'),

mac_builder('macOS (Static, ARM)',
cmake_extra='-DBUILD_STATIC_DEPS=ON',
build_tests=false,
lto=true,
arch='arm64',
extra_cmds=static_check_and_upload,/*extra_steps=[gui_wallet_step_darwin]*/),
mac_builder('macOS (Static, Intel)',
cmake_extra='-DBUILD_STATIC_DEPS=ON -DARCH=core2 -DARCH_ID=amd64',
build_tests=false,
lto=true,
arch='amd64',
extra_cmds=static_check_and_upload,/*extra_steps=[gui_wallet_step_darwin]*/),

// Android builds; we do all architecture builds within in one single step because the android NDK is huge
{
name: 'Android wallet_api',
Expand Down Expand Up @@ -442,6 +349,7 @@ local gui_wallet_step_darwin = {
'cd build',
'cmake .. -G Ninja ' +
'-DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13 -DENABLE_VISIBILITY=ON -DENABLE_BITCODE=OFF ' +
'-DRANDOMX_ENABLE_JIT=OFF ' +
'-DSTATIC=ON -DBUILD_STATIC_DEPS=ON -DUSE_LTO=OFF -DCMAKE_BUILD_TYPE=Release ' +
'-DLOCAL_MIRROR=https://oxen.rocks/deps ' +
'-DCMAKE_CXX_FLAGS=-fcolor-diagnostics',
Expand All @@ -468,6 +376,7 @@ local gui_wallet_step_darwin = {
'cd build',
'cmake .. -G Ninja ' +
'-DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DDEPLOYMENT_TARGET=13 -DENABLE_VISIBILITY=ON -DENABLE_BITCODE=OFF ' +
'-DRANDOMX_ENABLE_JIT=OFF ' +
'-DSTATIC=ON -DBUILD_STATIC_DEPS=ON -DUSE_LTO=OFF -DCMAKE_BUILD_TYPE=Release ' +
'-DLOCAL_MIRROR=https://oxen.rocks/deps ' +
'-DCMAKE_CXX_FLAGS=-fcolor-diagnostics',
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ else()
# On Windows, this is as close to fully-static as we get:
# this leaves only deps on /c/Windows/system32/*.dll
set(STATIC_FLAGS "-static")
elseif (NOT (APPLE OR FREEBSD OR OPENBSD OR DRAGONFLY))
elseif (NOT (ANDROID OR APPLE OR FREEBSD OR OPENBSD OR DRAGONFLY))
# On Linux, we don't support fully static build, but these can be static
set(STATIC_FLAGS "-static-libgcc -static-libstdc++")
endif()
Expand Down
40 changes: 27 additions & 13 deletions cmake/StaticBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@
# invocation to override.

set(LOCAL_MIRROR "" CACHE STRING "local mirror path/URL for lib downloads")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(BOOST_VERSION 1.87.0 CACHE STRING "boost version")
set(BOOST_VERSION 1.88.0 CACHE STRING "boost version")
set(BOOST_MIRROR ${LOCAL_MIRROR} https://archives.boost.io/release/${BOOST_VERSION}/source
CACHE STRING "boost download mirror(s)")
string(REPLACE "." "_" BOOST_VERSION_ ${BOOST_VERSION})
set(BOOST_SOURCE boost_${BOOST_VERSION_}.tar.bz2)
set(BOOST_HASH SHA256=af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89
set(BOOST_HASH SHA256=46d9d2c06637b219270877c9e16155cbd015b6dc84349af064c088e9b5b12f7b
CACHE STRING "boost source hash")

set(NCURSES_VERSION 6.3 CACHE STRING "ncurses version")
set(NCURSES_VERSION 6.5 CACHE STRING "ncurses version")
set(NCURSES_MIRROR ${LOCAL_MIRROR} http://ftpmirror.gnu.org/gnu/ncurses
CACHE STRING "ncurses download mirror(s)")
set(NCURSES_SOURCE ncurses-${NCURSES_VERSION}.tar.gz)
set(NCURSES_HASH SHA512=5373f228cba6b7869210384a607a2d7faecfcbfef6dbfcd7c513f4e84fbd8bcad53ac7db2e7e84b95582248c1039dcfc7c4db205a618f7da22a166db482f0105
set(NCURSES_HASH SHA512=fc5a13409d2a530a1325776dcce3a99127ddc2c03999cfeb0065d0eee2d68456274fb1c7b3cc99c1937bc657d0e7fca97016e147f93c7821b5a4a6837db821e8
CACHE STRING "ncurses source hash")

set(READLINE_VERSION 8.1 CACHE STRING "readline version")
set(READLINE_VERSION 8.2 CACHE STRING "readline version")
set(READLINE_MIRROR ${LOCAL_MIRROR} http://ftpmirror.gnu.org/gnu/readline
CACHE STRING "readline download mirror(s)")
set(READLINE_SOURCE readline-${READLINE_VERSION}.tar.gz)
set(READLINE_HASH SHA512=27790d0461da3093a7fee6e89a51dcab5dc61928ec42e9228ab36493b17220641d5e481ea3d8fee5ee0044c70bf960f55c7d3f1a704cf6b9c42e5c269b797e00
set(READLINE_HASH SHA512=0a451d459146bfdeecc9cdd94bda6a6416d3e93abd80885a40b334312f16eb890f8618a27ca26868cebbddf1224983e631b1cbc002c1a4d1cd0d65fba9fea49a
CACHE STRING "readline source hash")

set(SQLITE3_VERSION 3490100 CACHE STRING "sqlite3 version")
Expand Down Expand Up @@ -95,17 +96,17 @@ set(ZLIB_SOURCE zlib-${ZLIB_VERSION}.tar.xz)
set(ZLIB_HASH SHA256=38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32
CACHE STRING "zlib source hash")

set(CURL_VERSION 8.12.1 CACHE STRING "curl version")
set(CURL_VERSION 8.13.0 CACHE STRING "curl version")
set(CURL_MIRROR ${LOCAL_MIRROR} https://curl.se/download https://curl.askapache.com
CACHE STRING "curl mirror(s)")
set(CURL_SOURCE curl-${CURL_VERSION}.tar.xz)
set(CURL_HASH SHA512=88915468fa1bb7256e3dd6c9d058ada6894faa1e3e7800c7d9bfee3e8be4081ae57e7f2bf260c5342b709499fc4302ddc2d7864e25bfa3300fa07f118a3de603
set(CURL_HASH SHA512=d266e460f162ee455b56726e5b7247b2d1aa5265ae12081513fc0c5c79e785a594097bc71d505dc9bcd2c2f6f1ff6f4bab9dbd9d120bb76d06c5be8521a8ca7d
CACHE STRING "curl source hash")

set(OPENSSL_VERSION 3.0.16 CACHE STRING "openssl version")
set(OPENSSL_VERSION 3.5.0 CACHE STRING "openssl version")
set(OPENSSL_MIRROR ${LOCAL_MIRROR} https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION} CACHE STRING "openssl download mirror(s)")
set(OPENSSL_SOURCE openssl-${OPENSSL_VERSION}.tar.gz)
set(OPENSSL_HASH SHA256=57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86
set(OPENSSL_HASH SHA256=344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0
CACHE STRING "openssl source hash")

set(LIBICONV_VERSION 1.18 CACHE STRING "libiconv version")
Expand Down Expand Up @@ -659,7 +660,7 @@ if(NOT APPLE AND NOT WIN32)
--prefix=${DEPS_DESTDIR} --libdir=lib ${openssl_extra_opts}
no-shared no-capieng no-dso no-dtls1 no-ec_nistp_64_gcc_128 no-gost
no-heartbeats no-md2 no-rc5 no-rdrand no-rfc3779 no-sctp no-ssl-trace no-ssl2 no-ssl3
no-static-engine no-tests no-weak-ssl-ciphers no-zlib no-zlib-dynamic "CFLAGS=${deps_CFLAGS}"
no-static-engine no-tests no-weak-ssl-ciphers no-zlib no-zlib-dynamic "CFLAGS=${deps_CFLAGS} -fPIC"
INSTALL_COMMAND make install_sw
BUILD_BYPRODUCTS
${DEPS_DESTDIR}/lib/libssl.a ${DEPS_DESTDIR}/lib/libcrypto.a
Expand Down Expand Up @@ -726,12 +727,25 @@ build_external(gmp
"LDFLAGS=-L${DEPS_DESTDIR}/lib${apple_ldflags_arch}" CC_FOR_BUILD=cc CPP_FOR_BUILD=cpp
DEPENDS libidn2_external libtasn1_external
)



add_static_target(gmp::gmp gmp_external libgmp.a libidn2::libidn2 libtasn1::libtasn1)

set_target_properties(gmp::gmp PROPERTIES POSITION_INDEPENDENT_CODE ON)

expand_urls(zstd_urls ${ZSTD_SOURCE} ${ZSTD_MIRROR})
set(zstd_cmake_extra)
foreach(opt IN ITEMS CMAKE_C_COMPILER_LAUNCHER CMAKE_TOOLCHAIN_FILE PLATFORM DEPLOYMENT_TARGET ENABLE_VISIBILITY ENABLE_BITCODE)
foreach(opt IN ITEMS
CMAKE_C_COMPILER_LAUNCHER
CMAKE_TOOLCHAIN_FILE
PLATFORM
DEPLOYMENT_TARGET
ENABLE_VISIBILITY
ENABLE_BITCODE
ANDROID_PLATFORM
ANDROID_ABI
)
if(${opt})
list(APPEND zstd_cmake_extra "-D${opt}=${${opt}}")
endif()
Expand Down Expand Up @@ -804,7 +818,7 @@ foreach(curl_arch ${curl_arches})
--disable-progress-meter --without-brotli --with-zlib=${DEPS_DESTDIR} ${curl_ssl_opts}
--without-librtmp --disable-versioned-symbols --enable-hidden-symbols
--without-zsh-functions-dir --without-fish-functions-dir --with-zstd --without-libpsl
--without-nghttp2 --without-nghttp3 --without-ngtcp2 --without-quiche
--without-nghttp2 --without-nghttp3 --without-ngtcp2 --without-quiche --with-pic
"CC=${deps_cc}" "CFLAGS=${deps_noarch_CFLAGS}${cflags_extra}" ${curl_extra}
BUILD_COMMAND true
INSTALL_COMMAND make -C lib install && make -C include install
Expand Down
2 changes: 1 addition & 1 deletion external/randomx
57 changes: 36 additions & 21 deletions src/wallet/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function(combine_archives output_archive)
endif()
endfunction(combine_archives)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if (STATIC AND BUILD_STATIC_DEPS)
set(optional_deps)
if(TARGET protobuf_lite)
Expand All @@ -101,46 +103,59 @@ if (STATIC AND BUILD_STATIC_DEPS)
if(TARGET device_trezor)
list(APPEND optional_deps device_trezor)
endif()
if(NOT APPLE AND NOT WIN32)
list(APPEND optional_deps OpenSSL::SSL OpenSSL::Crypto)
endif()

combine_archives(wallet_merged
wallet_api
wallet
multisig
cryptonote_core
sent_transition_data

blockchain_db
bls_aggregator
bls_crypto
bn256
checkpoints
cncrypto
common
cryptonote_basic
cryptonote_core
cryptonote_protocol
sqlitedb
mnemonics
common
cncrypto
device
epee
l2_tracker
mnemonics
multisig
net
ringct
ringct_basic
checkpoints
version
net
epee
blockchain_db
rpc_http_client
rpc_commands
rpc_http_client
sent_transition_data
sqlitedb
version
wallet

${optional_deps}

# Static deps:
Boost::program_options Boost::serialization Boost::system Boost::thread
zlib
CURL::libcurl
SQLite::SQLite3
SQLiteCpp
sodium
cpr::cpr
ethyl
fmt::fmt
gmp::gmp
libzmq
CURL::libcurl
oxenmq::oxenmq
lmdb
oxen::logging
logging
oxenmq::oxenmq
randomx
uSockets
cpr
fmt
sodium
spdlog::spdlog
zlib
zstd::zstd
)

if(IOS)
Expand Down
3 changes: 3 additions & 0 deletions src/wallet3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ if (STATIC AND BUILD_STATIC_DEPS)
endif()
endforeach()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)


combine_archives(wallet3_merged
multisig
cryptonote_core
Expand Down