Skip to content
Draft
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
27 changes: 27 additions & 0 deletions .github/workflows/build-depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
description: "Short hash of the CI base image manifest for cache busting"
required: true
type: string
rust-vendor-artifact:
description: "Artifact holding freshly generated Rust vendor archives"
required: false
type: string
default: ""
runs-on:
description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)"
required: true
Expand Down Expand Up @@ -144,6 +149,28 @@ jobs:
key: depends-sources-${{ hashFiles('depends/packages/*') }}
restore-keys: depends-sources-

- name: Restore Rust vendor sources
id: rust-vendor-cache
if: inputs.build-target == 'linux64_platform_gui'
uses: actions/cache/restore@v5
with:
path: depends/sources/platform-cxx-*-vendored.tar.gz
key: depends-rust-vendor-sources-${{ hashFiles('depends/Makefile', 'depends/funcs.mk', 'depends/packages/native_rust.mk', 'depends/packages/platform_cxx.mk', 'depends/patches/platform_cxx/cargo-config.toml') }}

- name: Download Rust vendor sources
if: inputs.build-target == 'linux64_platform_gui' && steps.rust-vendor-cache.outputs.cache-hit != 'true' && inputs.rust-vendor-artifact != ''
uses: actions/download-artifact@v8
with:
name: ${{ inputs.rust-vendor-artifact }}
path: depends/sources

- name: Check Rust vendor sources are present
if: inputs.build-target == 'linux64_platform_gui' && steps.rust-vendor-cache.outputs.cache-hit != 'true' && inputs.rust-vendor-artifact == ''
run: |
echo "::error::Rust vendor source cache missed and no same-run artifact was provided"
exit 1
shell: bash

- name: Restore SDKs cache
id: sdk-cache
uses: actions/cache/restore@v5
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ jobs:
base-image-digest: ${{ needs.check-skip.outputs.base-image-digest }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

depends-linux64_platform_gui:
name: x86_64-pc-linux-gnu_platform_gui
uses: ./.github/workflows/build-depends.yml
needs: [check-skip, container, cache-sources]
if: ${{ vars.SKIP_LINUX64_PLATFORM_GUI == '' }}
with:
build-target: linux64_platform_gui
container-path: ${{ needs.container.outputs.path }}
base-image-digest: ${{ needs.check-skip.outputs.base-image-digest }}
rust-vendor-artifact: ${{ needs.cache-sources.outputs.rust-vendor-artifact }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

depends-mac:
name: x86_64-apple-darwin
uses: ./.github/workflows/build-depends.yml
Expand Down Expand Up @@ -277,6 +289,20 @@ jobs:
depends-artifact: ${{ needs.depends-linux64_nowallet.outputs.built-artifact }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

src-linux64_platform_gui:
name: linux64_platform_gui-build
uses: ./.github/workflows/build-src.yml
needs: [check-skip, container, depends-linux64_platform_gui]
if: ${{ vars.SKIP_LINUX64_PLATFORM_GUI == '' }}
with:
build-target: linux64_platform_gui
container-path: ${{ needs.container.outputs.path }}
depends-key: ${{ needs.depends-linux64_platform_gui.outputs.key }}
depends-host: ${{ needs.depends-linux64_platform_gui.outputs.host }}
depends-dep-opts: ${{ needs.depends-linux64_platform_gui.outputs.dep-opts }}
depends-artifact: ${{ needs.depends-linux64_platform_gui.outputs.built-artifact }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

src-linux64_sqlite:
name: linux64_sqlite-build
uses: ./.github/workflows/build-src.yml
Expand Down Expand Up @@ -372,6 +398,17 @@ jobs:
container-path: ${{ needs.container-slim.outputs.path }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

test-linux64_platform_gui:
name: linux64_platform_gui-test
uses: ./.github/workflows/test-src.yml
needs: [check-skip, container-slim, src-linux64_platform_gui, lint]
if: ${{ vars.SKIP_LINUX64_PLATFORM_GUI == '' }}
with:
bundle-key: ${{ needs.src-linux64_platform_gui.outputs.key }}
build-target: linux64_platform_gui
container-path: ${{ needs.container-slim.outputs.path }}
runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }}

test-linux64_sqlite:
name: linux64_sqlite-test
uses: ./.github/workflows/test-src.yml
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/cache-depends-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
required: false
type: string
default: ubuntu-24.04-arm
outputs:
rust-vendor-artifact:
description: "Artifact holding freshly generated Rust vendor archives"
value: ${{ jobs.cache-sources.outputs.rust-vendor-artifact }}
schedule:
# Run daily at 6 AM UTC on the default branch to keep cache warm
- cron: '0 6 * * *'
Expand All @@ -18,6 +22,8 @@ jobs:
# Intentionally keep scheduled cache warming on GitHub-hosted ARM runners.
# Blacksmith caches are expected to persist long enough without a warmup cron.
runs-on: ${{ inputs.runs-on || 'ubuntu-24.04-arm' }}
outputs:
rust-vendor-artifact: ${{ steps.vendor-artifact.outputs.name }}
steps:
- name: Checkout code
uses: actions/checkout@v6
Expand All @@ -35,6 +41,36 @@ jobs:
restore-keys: depends-sources-
lookup-only: true

- name: Cache Rust vendor sources
id: rust-vendor-cache
uses: actions/cache@v5
with:
path: depends/sources/platform-cxx-*-vendored.tar.gz
key: depends-rust-vendor-sources-${{ hashFiles('depends/Makefile', 'depends/funcs.mk', 'depends/packages/native_rust.mk', 'depends/packages/platform_cxx.mk', 'depends/patches/platform_cxx/cargo-config.toml') }}

- name: Download sources
if: steps.cache-check.outputs.cache-hit != 'true'
run: make -C depends download
if: |
steps.cache-check.outputs.cache-hit != 'true' ||
steps.rust-vendor-cache.outputs.cache-hit != 'true'
run: |
make -C depends PLATFORM_GUI=1 download
make -C depends PLATFORM_GUI=1 vendor-platform_cxx-crates
# The cache producer normally runs on ARM, while the platform_gui
# consumer runs on x86_64. Native Rust is selected from the build
# architecture, so fetch the x86_64 compiler archive explicitly too.
make -C depends BUILD=x86_64-pc-linux-gnu PLATFORM_GUI=1 download-one

- name: Select Rust vendor artifact
id: vendor-artifact
if: github.event_name != 'schedule' && steps.rust-vendor-cache.outputs.cache-hit != 'true'
run: echo "name=depends-rust-vendor-sources-${{ github.run_id }}" >> "$GITHUB_OUTPUT"

- name: Upload Rust vendor sources
if: steps.vendor-artifact.outputs.name != ''
uses: actions/upload-artifact@v6
with:
name: ${{ steps.vendor-artifact.outputs.name }}
path: depends/sources/platform-cxx-*-vendored.tar.gz
compression-level: 0
retention-days: 1
overwrite: true
2 changes: 2 additions & 0 deletions ci/dash/matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ elif [ "$BUILD_TARGET" = "linux64_multiprocess" ]; then
source ./ci/test/00_setup_env_native_multiprocess.sh
elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then
source ./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh
elif [ "$BUILD_TARGET" = "linux64_platform_gui" ]; then
source ./ci/test/00_setup_env_native_platform_gui.sh
elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then
source ./ci/test/00_setup_env_native_sqlite.sh
elif [ "$BUILD_TARGET" = "linux64_tsan" ]; then
Expand Down
23 changes: 23 additions & 0 deletions ci/test/00_setup_env_native_platform_gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
#
# Copyright (c) 2026 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

# Builds dash-qt with the optional Dash Platform GUI (--enable-platform-gui)
# turned on and runs the platform_* unit-test suites. PLATFORM_GUI=1 makes
# depends build mbedtls and the Platform-owned CXX binding archive; proof
# verification, DPP decoding and state-transition construction come from that
# archive. Functional tests are skipped: the feature is exercised by the gated
# C++ unit tests and there is no dashd-only surface to drive.
export CONTAINER_NAME=ci_native_platform_gui
export HOST=x86_64-pc-linux-gnu
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
export DEP_OPTS="PLATFORM_GUI=1"
export RUN_UNIT_TESTS="true"
export RUN_UNIT_TESTS_SEQUENTIAL="false"
export RUN_FUNCTIONAL_TESTS="false"
export GOAL="install"
export BITCOIN_CONFIG="--enable-platform-gui --with-gui=qt5 --enable-zmq --with-libs=no --enable-reduce-exports LDFLAGS=-static-libstdc++"
74 changes: 74 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ if test "$enable_miner" = "yes"; then
AC_DEFINE(ENABLE_MINER, 1, [Define this symbol if in-wallet miner should be enabled])
fi

dnl Enable Dash Platform support (usernames / DashPay contacts) in the GUI.
dnl This only affects dash-qt; dashd and the other binaries never link any of it.
AC_ARG_ENABLE([platform-gui],
[AS_HELP_STRING([--enable-platform-gui],
[enable Dash Platform (usernames/DashPay) support in the GUI (default is no)])],
[enable_platform_gui=$enableval],
[enable_platform_gui=no])
AC_ARG_VAR([MBEDTLS_CFLAGS], [C compiler flags for mbedtls, bypasses autodetection])
AC_ARG_VAR([MBEDTLS_LIBS], [Linker flags for mbedtls, bypasses autodetection])
AC_ARG_VAR([PLATFORM_CXX_CFLAGS], [C++ compiler flags for the Dash Platform CXX bindings])
AC_ARG_VAR([PLATFORM_CXX_LIBS], [Linker flags for the Dash Platform CXX bindings])

dnl Enable different -fsanitize options
AC_ARG_WITH([sanitizers],
[AS_HELP_STRING([--with-sanitizers],
Expand Down Expand Up @@ -881,6 +893,16 @@ case $host in
export PKG_CONFIG_PATH="$($BREW --prefix qt@5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
fi

if test "$enable_platform_gui" = "yes" && $BREW list --versions mbedtls >/dev/null && test "$MBEDTLS_CFLAGS" = "" && test "$MBEDTLS_LIBS" = ""; then
mbedtls_prefix=$($BREW --prefix mbedtls 2>/dev/null)
if test "$suppress_external_warnings" != "no"; then
MBEDTLS_CFLAGS="-isystem $mbedtls_prefix/include"
else
MBEDTLS_CFLAGS="-I$mbedtls_prefix/include"
fi
MBEDTLS_LIBS="-L$mbedtls_prefix/lib -lmbedtls -lmbedx509 -lmbedcrypto"
fi

gmp_prefix=$($BREW --prefix gmp 2>/dev/null)
if test "$gmp_prefix" != ""; then
if test "$suppress_external_warnings" != "no"; then
Expand Down Expand Up @@ -1936,6 +1958,57 @@ if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-fuzz(-binary) --enable-bench or --enable-tests])
fi

dnl Dash Platform GUI support needs the GUI and the wallet, and mbedtls for the
dnl DAPI TLS client. The platform client library and the Platform-owned CXX
dnl archive are linked into dash-qt (and test binaries) only.
if test "$enable_platform_gui" = "yes"; then
if test "$bitcoin_enable_qt" != "yes"; then
AC_MSG_ERROR([--enable-platform-gui requires the GUI (--with-gui)])
fi
if test "$enable_wallet" != "yes"; then
AC_MSG_ERROR([--enable-platform-gui requires wallet support (--enable-wallet)])
fi
if test "$MBEDTLS_CFLAGS$MBEDTLS_LIBS" = ""; then
AC_CHECK_HEADER([mbedtls/ssl.h], [], [AC_MSG_ERROR([mbedtls headers not found (required by --enable-platform-gui)])])
AC_CHECK_LIB([mbedcrypto], [main], [MBEDTLS_LIBS="-lmbedcrypto"], [AC_MSG_ERROR([libmbedcrypto not found (required by --enable-platform-gui)])])
AC_CHECK_LIB([mbedx509], [main], [MBEDTLS_LIBS="-lmbedx509 $MBEDTLS_LIBS"], [AC_MSG_ERROR([libmbedx509 not found (required by --enable-platform-gui)])], [$MBEDTLS_LIBS])
AC_CHECK_LIB([mbedtls], [mbedtls_ssl_init], [MBEDTLS_LIBS="-lmbedtls $MBEDTLS_LIBS"], [AC_MSG_ERROR([libmbedtls not found (required by --enable-platform-gui)])], [$MBEDTLS_LIBS])
fi
if test -z "$PLATFORM_CXX_LIBS"; then
PLATFORM_CXX_LIBS="-ldash_platform_cxx"
fi
PLATFORM_CXX_LIBS="$PLATFORM_CXX_LIBS -lpthread -lm"
case $host in
*darwin*) PLATFORM_CXX_LIBS="$PLATFORM_CXX_LIBS -framework CoreFoundation" ;;
*linux*) PLATFORM_CXX_LIBS="$PLATFORM_CXX_LIBS -ldl" ;;
*mingw*) PLATFORM_CXX_LIBS="$PLATFORM_CXX_LIBS -luserenv -lntdll" ;;
esac
TEMP_CPPFLAGS="$CPPFLAGS"
TEMP_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $PLATFORM_CXX_CFLAGS"
LIBS="$PLATFORM_CXX_LIBS $LIBS"
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([for Dash Platform CXX bindings])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cstdint>
#include <dash/platform/ffi.h>
]], [[
platform_ffi::set_context("test", std::uint32_t{0});
]])], [AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no])
AC_MSG_ERROR([Dash Platform CXX bindings not found (required by --enable-platform-gui)])
])
AC_LANG_POP
CPPFLAGS="$TEMP_CPPFLAGS"
LIBS="$TEMP_LIBS"
AC_DEFINE([ENABLE_PLATFORM_GUI], [1], [Define this symbol to enable Dash Platform support in the GUI])
fi
AM_CONDITIONAL([ENABLE_PLATFORM_GUI], [test "$enable_platform_gui" = "yes"])
AC_SUBST(MBEDTLS_CFLAGS)
AC_SUBST(MBEDTLS_LIBS)
AC_SUBST(PLATFORM_CXX_CFLAGS)
AC_SUBST(PLATFORM_CXX_LIBS)

AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"])
AM_CONDITIONAL([BUILD_DARWIN], [test "$BUILD_OS" = "darwin"])
AM_CONDITIONAL([TARGET_LINUX], [test "$TARGET_OS" = "linux"])
Expand Down Expand Up @@ -2133,6 +2206,7 @@ echo " debug enabled = $enable_debug"
echo " stacktraces = $enable_stacktraces"
echo " crash hooks = $enable_crashhooks"
echo " miner enabled = $enable_miner"
echo " platform gui = $enable_platform_gui"
echo " werror = $enable_werror"
echo
echo " target os = $host_os"
Expand Down
Loading
Loading