WIP: build: Bump g++ minimum supported version to 13

bitcoin/bitcoin: PR #36042

2 minor findings · 2 suggestions

Earlier concerns neither republished nor resolved: 3 major findings · 1 minor finding · 2 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · The std::format diagnostic omits the standard-library requirement

A supported-version Clang paired with libstdc++ lacking <format> fails the new probe, but the diagnostic and linked requirements describe only compiler versions.

Location: cmake/module/CheckCXXFeatures.cmake:48 (head).

Details and suggested fix

Clang's version does not determine whether its selected C++ standard library implements std::format. For example, upgrading Clang while retaining an older system libstdc++ can satisfy the documented Clang minimum and still fail HAVE_TEXT_FORMATTING. The error then suggests an old compiler and points back to a compiler-only table. This follows from source inspection, not an observed configure run. Name the standard library in the diagnostic and document that Clang also needs a library implementing std::format, such as libstdc++ from GCC 13 or later or a suitable libc++.


Link

[minor] · The NetBSD GCC install guard accepts a partial installation

If gcc14 extracts but installing gcc14-libs fails, a local host-mode rerun skips the package block and leaves the GCC installation incomplete.

Location: ci/test/01_base_install.sh:139 (head).

Details and suggested fix

The guard checks only whether usr/pkg/gcc14 exists, although the two archives are verified and extracted in separate iterations. Once the first extraction creates that directory, a failure downloading, verifying or extracting the second archive aborts the script. With DANGER_RUN_CI_ON_HOST=1, the SDK survives and the next invocation skips both packages despite the missing runtime libraries. Write and check a completion marker only after both extractions succeed. This affects local runs of the retained NetBSD configuration; a failed Docker image-build layer is discarded. The existing SDK block has a similar weakness, but the GCC package block introduces this additional incomplete-install state.


Optional improvements

Link

[suggestion] · The image bump removes minimum-version build and functional-test coverage

Moving previous_releases to Ubuntu 24.04 removes its CMake 3.22 and Python 3.10 functional-test coverage, although both minimums remain supported; lint still uses Python 3.10.

Location: ci/test/00_setup_env_native_previous_releases.sh:9 (head).

Details and suggested fix

This was the only Ubuntu 22.04 CI environment, providing CMake 3.22.1 and Python 3.10. The replacement uses newer distribution versions, while CMakeLists.txt still requires CMake 3.22 and doc/dependencies.md still lists Python 3.10. Python 3.10 lint execution does not replace running the functional suite on that interpreter. Preserve the minimum-version build and test coverage by explicitly installing CMake 3.22 and Python 3.10 in a CI job with a supported C++ toolchain.


Link

[suggestion] · The NetBSD library-switch commit needs the following package-pin correction

The library-switch commit introduces package pins that its immediate follow-up reports were removed upstream, so validating that intermediate change requires the next commit; the final tree already contains the correction.

Location: ci/test/00_setup_env_netbsd_cross.sh:19 at f2be1e7cc34c (commit) (commit).

Details and suggested fix

Commit f2be1e7cc34c716c45c4940f0d03901ec3dad169 introduces the libstdc++-14 switch with gcc14-14.3.0nb1.tgz and gcc14-libs-14.3.0nb2.tgz. Commit abd8ddc46452fdacc8783594e66066b6686fd815 updates them to nb3/nb4, explaining that the earlier packages disappeared, and also removes NetBSD Cross from the GHA matrix. Fold the pin correction into the library-switch commit and keep the matrix removal separate with its existing archive-churn rationale. No intervening change depends on the old pins, and the final tree stays unchanged. This is a review-flow concern, not a head defect; the package-availability claim comes from the follow-up message rather than an independently observed download failure.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

ToString was introduced specifically as a locale-independent replacement for std::to_string. The historical merge record identifies this purpose and links the change to issue #17866 and an earlier suggestion there.

Locale independence is the clearest documented compatibility requirement for the shared helper. Both the pinned base and head retain that description; replacing the formatting mechanism does not remove this stated purpose. The retrieved record does not explain why classic-locale streams were preferred over other locale-independent mechanisms.

Source 1

Ralph's inferences

The classic-locale stream makes conversion independent of the application's global C++ locale: each invocation constructs a fresh stream and explicitly installs the classic locale before inserting the value. For ordinary numeric insertion, this prevents locale-specific decimal punctuation or digit grouping from changing the resulting text.

This explains how the old implementation realizes the documented requirement: callers receive locale-neutral conversion rather than user-localized presentation. The head changes that mechanism to std::format("{}", t). The inspected history establishes the locale-independence requirement, but not a particular protocol or adversarial incident motivating it.

Source 1

The base implementation's output contract is observably default ostream insertion, not exact equivalence to every std::to_string overload. Examples include numeric boolean output without boolalpha, character insertion for character types, and default stream precision for floating-point values.

Locale neutrality and exact output compatibility are separate questions when replacing the helper. These are compatibility dimensions exposed by the pinned implementation, not defects identified in this PR. Without the original discussion or tests, the evidence does not establish that every such output detail was deliberately promised to callers.

The old template's supported-type boundary follows whether a const value can be inserted into an ostringstream, including suitable user-defined stream insertion overloads; it is not restricted to std::to_string's arithmetic overload set. The head instead delegates to std::format's formatting support.

Supported-type compatibility therefore cannot be inferred solely from the helper's 'version of std::to_string' description. Preserving existing callers requires understanding their actual types and conversion semantics. The retrieved history does not establish an explicit promise to support every stream-insertable type, and the caller inventory was not completed.