Repository navigation
build: build the Dash Platform CXX bindings in depends behind PLATFORM_GUI=1 #7623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
30f071c
3a4de8a
2525537
bfe078a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/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 | ||
|
|
||
| # Depends with dash-sdk-cxx (PLATFORM_GUI=1); linux64 builds against it. | ||
| export CONTAINER_NAME=ci_native_platform_gui | ||
| export HOST=x86_64-pc-linux-gnu | ||
| export DEP_OPTS="PLATFORM_GUI=1" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,64 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/usr/bin/env python3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ''' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Check that executables do not link Rust code. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dash-sdk-cxx, the Dash Platform SDK binding (--enable-platform-gui), is for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dash-qt, test_dash and test_dash-qt only; dashd, the command-line tools, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bench_dash and the fuzz binary must not contain any of it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A binary fails if its symbol table has cxx bridge, Rust runtime or Rust | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| standard library symbols, or has no symbols at all (a stripped binary cannot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| be checked). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example usage: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contrib/devtools/check-no-rust.py src/dashd src/dash-cli src/dash-tx src/dash-util src/dash-wallet src/bench/bench_dash src/test/fuzz/fuzz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ''' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+18
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
💬 Nitpick: Docstring example omits binaries the CI gate checks The CI invocation now checks seven executables, but this example omits src/dash-util and src/bench/bench_dash, and the prose does not mention the benchmark executable. The CI gate itself is correct; updating this documentation would keep the documented manual check aligned with the complete CI check.
Suggested change
source:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied in 🤖 Posted autonomously by Claude on behalf of pasta.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved (re-reviewed at |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import re | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import subprocess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from utils import determine_wellknown_cmd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # cxx bridge symbols carry "cxxbridge1$". Rust code is either legacy-mangled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # under a crate namespace (rust, std, core, alloc) or v0-mangled ("_R" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # followed by a path tag and a crate root "Cs<disambiguator>_"), which C and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # C++ symbols never match. The allocator shim, the panic handler and the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # unwinding personality are plain C names every Rust program links. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUST_SYMBOL = re.compile( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r'cxxbridge1\$' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r'|_ZN(4rust|3std|4core|5alloc)[0-9]' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r'|\b_?_R[A-Za-z0-9_]*?Cs[A-Za-z0-9]*_[0-9]' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r'|\b_?(__rust_alloc|rust_begin_unwind|rust_eh_personality)' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def rust_symbols(nm, path): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| result = subprocess.run(nm + [path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if result.returncode != 0: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.exit(f'{path}: {result.stderr.strip()}') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lines = result.stdout.splitlines() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not lines: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.exit(f'{path}: no symbols, so it cannot be checked (stripped?)') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return [line for line in lines if RUST_SYMBOL.search(line)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def main(): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if len(sys.argv) < 2: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.exit(__doc__) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nm = determine_wellknown_cmd('NM', 'nm') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| failed = False | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for path in sys.argv[1:]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| found = rust_symbols(nm, path) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if found: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| failed = True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f'{path}: links Rust code, for example:') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for line in found[:5]: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f' {line}') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sys.exit(1 if failed else 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if __name__ == '__main__': | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| main() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.