Skip to content

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

Merged
nullcopy merged 1 commit into
zodl-inc:mainfrom
dianaravenborne:fix/cxxflags-cstdint
Jun 4, 2026
Merged

build: force-include <cstdint> via CXXFLAGS for GCC 15+#5
nullcopy merged 1 commit into
zodl-inc:mainfrom
dianaravenborne:fix/cxxflags-cstdint

Conversation

@dianaravenborne
Copy link
Copy Markdown
Contributor

@dianaravenborne dianaravenborne commented Jun 4, 2026

Clean cargo build fails on GCC 15+ with 'uint64_t' has not been declared from librocksdb-sys (and libzcash_script) headers. Their vendored C++ relies on transitive <cstdint> inclusion, which newer libstdc++ no longer provides.

Add CXXFLAGS = "-include cstdint" to .cargo/config.toml [env] so every C++ TU gets the header. No-op for files that already include it. force = false so any developer/CI-supplied CXXFLAGS still wins. Drop once both upstreams add the include directly.

Verified: clean cargo build -p zebra-state after cargo clean -p librocksdb-sys, no env vars set.

nullcopy
nullcopy previously approved these changes Jun 4, 2026
Copy link
Copy Markdown
Contributor

@nullcopy nullcopy left a comment

Choose a reason for hiding this comment

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

utACK 1435a26

@dannywillems
Copy link
Copy Markdown

I use gcc-13.4.0 but I don't have the warning on my side. Can you give more information to reproduce the actual warning, please?

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.
@nullcopy nullcopy changed the title build: force-include <cstdint> via CXXFLAGS for GCC 13+ build: force-include <cstdint> via CXXFLAGS for GCC 15+ Jun 4, 2026
@nullcopy
Copy link
Copy Markdown
Contributor

nullcopy commented Jun 4, 2026

Good catch, the issue is with GCC 15, not GCC 13

Copy link
Copy Markdown
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

utACK, I will be glad to not have to deal with this manually.

Copy link
Copy Markdown

@dannywillems dannywillems left a comment

Choose a reason for hiding this comment

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

utACK

Additionnally, trying to add checks in the CI: #6

@nullcopy nullcopy merged commit 0b40427 into zodl-inc:main Jun 4, 2026
89 of 91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants