Skip to content

build: force-include <cstdint> via CXXFLAGS for GCC 15+#10788

Open
nuttycom wants to merge 1 commit into
ZcashFoundation:mainfrom
nuttycom:chore/fix_rocksdb_build
Open

build: force-include <cstdint> via CXXFLAGS for GCC 15+#10788
nuttycom wants to merge 1 commit into
ZcashFoundation:mainfrom
nuttycom:chore/fix_rocksdb_build

Conversation

@nuttycom

@nuttycom nuttycom commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked from zodl-inc/zebra#5

Motivation

librocksdb-sys and libzcash_script's vendored C++ rely on transitive , which GCC 15+ libstdc++ no longer provides.

Solution

Adding the CXXFLAGS="-include cstdint" directive to .cargo/config.toml saves users from having to (a) know to use this workaround, and (b) do this manually every time we go to build.

Tests

Tested locally; this works fine.

Follow-up Work

This can removed once both upstream libraries' builds add the include.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used:

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

librocksdb-sys and libzcash_script's vendored C++ rely on transitive <cstdint>, which GCC 15+ libstdc++ no longer provides. Drop once both upstreams add the include.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Zebra’s Cargo configuration to apply a build workaround for GCC 15+ by force-including the standard <cstdint> header when compiling vendored C++ dependencies (notably librocksdb-sys and libzcash_script), addressing breakage from removed transitive includes in newer libstdc++.

Changes:

  • Add CXXFLAGS="-include cstdint" to .cargo/config.toml to make the workaround automatic for local builds.

Comment thread .cargo/config.toml
Comment on lines 12 to +15
[env]
RUST_BACKTRACE="1"
# Workaround for GCC 15+: librocksdb-sys / libzcash_script vendored C++ relies on transitive <cstdint>.
CXXFLAGS = { value = "-include cstdint", force = false, relative = false }

@oxarbitrage oxarbitrage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We documented this at #10678

A fix might be better but If this PR gets merged we will need changes to the readme to remove or adapt what we added at #10678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants