Merge bitcoin/bitcoin#33555: build: Bump clang minimum supported version to 17
fa0fa0f700refactor: Revert "disable self-assign warning for tests" (MarcoFalke)faed118fb3build: Bump clang minimum supported version to 17 (MarcoFalke) Pull request description: Most supported operating systems ship with clang-17 (or later), so bump the minimum to that and allow new code to drop workarounds for previous clang bugs. (Apart from dropping the small workaround, this bump allows the `ci_native_nowallet_libbitcoinkernel` CI to run on riscv64 without running into an ICE with clang-16.) This patch will only be released in version 31.x, next year (2026). For reference: * https://packages.debian.org/bookworm/clang-19 * https://packages.ubuntu.com/noble/clang (clang-18) * CentOS-like 8/9/10 ship clang-17 (and later) via Stream * FreeBSD 12/13 ship clang-17 (and later) via packages * OpenSuse Tumbleweed ships with https://software.opensuse.org/package/clang (clang21); No idea about OpenSuse Leap On operating systems where the clang version is not shipped by default, the user would have to use GCC, or install clang in a different way. For example: * https://packages.debian.org/bookworm/g++ (g++-12) * https://packages.ubuntu.com/jammy/g++ (g++-11) * https://apt.llvm.org/, or nix, or guix, or compile clang from source, ... *Ubuntu 22.04 LTS does not ship with clang-16 (the previous minimum required), nor with clang-17, so one of the above workarounds is needed there.* macOS 14 is unaffected, and the previous minimum requirement of Xcode15.0 remains, see also https://github.com/bitcoin/bitcoin/blob/919e6d01e93a57d991ed456bc67c43605583ada8/depends/hosts/darwin.mk#L3-L4. (Modulo compiling the fuzz tests, which requires https://github.com/bitcoin/bitcoin/blob/919e6d01e93a57d991ed456bc67c43605583ada8/.github/workflows/ci.yml#L149) ACKs for top commit: janb84: Concept ACKfa0fa0f700l0rinc: Code review ACKfa0fa0f700hebasto: ACKfa0fa0f700. Tree-SHA512: 5973cec39982f80b8b43e493cde012d9d1ab75a0362300b007d155db9f871c6341e7e209e5e63f0c3ca490136b684683de270136d62cb56f6b00b0ac0331dc36
This commit is contained in:
6 files changed
+10
-37
No files matched your search
@@ -7,10 +7,10 @@
|
|||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
|
export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
|
||||||
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:bookworm"
|
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
|
||||||
# Use minimum supported python3.10 (or best-effort 3.11) and clang-16, see doc/dependencies.md
|
# Use minimum supported python3.10 (or best-effort 3.12) and clang-17, see doc/dependencies.md
|
||||||
export PACKAGES="python3-zmq python3-pip clang-16 llvm-16 libc++abi-16-dev libc++-16-dev"
|
export PACKAGES="python3-zmq python3-pip clang-17 llvm-17 libc++abi-17-dev libc++-17-dev"
|
||||||
export PIP_PACKAGES="--break-system-packages pycapnp"
|
export PIP_PACKAGES="--break-system-packages pycapnp"
|
||||||
export DEP_OPTS="NO_WALLET=1 CC=clang-16 CXX='clang++-16 -stdlib=libc++'"
|
export DEP_OPTS="NO_WALLET=1 CC=clang-17 CXX='clang++-17 -stdlib=libc++'"
|
||||||
export GOAL="install"
|
export GOAL="install"
|
||||||
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_LIB=ON -DBUILD_SHARED_LIBS=ON"
|
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_LIB=ON -DBUILD_SHARED_LIBS=ON"
|
||||||
+1
-1
@@ -10,7 +10,7 @@ Bitcoin Core requires one of the following compilers.
|
|||||||
|
|
||||||
| Dependency | Minimum required |
|
| Dependency | Minimum required |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [Clang](https://clang.llvm.org) | [16.0](https://github.com/bitcoin/bitcoin/pull/30263) |
|
| [Clang](https://clang.llvm.org) | [17.0](https://github.com/bitcoin/bitcoin/pull/33555) |
|
||||||
| [GCC](https://gcc.gnu.org) | [11.1](https://github.com/bitcoin/bitcoin/pull/29091) |
|
| [GCC](https://gcc.gnu.org) | [11.1](https://github.com/bitcoin/bitcoin/pull/29091) |
|
||||||
|
|
||||||
## Required
|
## Required
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Build System
|
||||||
|
------------
|
||||||
|
|
||||||
|
- The minimum supported Clang compiler version has been raised to 17.0
|
||||||
|
(#33555).
|
||||||
@@ -580,20 +580,6 @@ BOOST_AUTO_TEST_CASE(conversion)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(operator_with_self)
|
BOOST_AUTO_TEST_CASE(operator_with_self)
|
||||||
{
|
{
|
||||||
/* Clang 16 and earlier detects v -= v and v /= v as self-assignments
|
|
||||||
to 0 and 1 respectively.
|
|
||||||
See: https://github.com/llvm/llvm-project/issues/42469
|
|
||||||
and the fix in commit c5302325b2a62d77cf13dd16cd5c19141862fed0 .
|
|
||||||
|
|
||||||
This makes some sense for arithmetic classes, but could be considered a bug
|
|
||||||
elsewhere. Disable the warning here so that the code can be tested, but the
|
|
||||||
warning should remain on as there will likely always be a better way to
|
|
||||||
express this.
|
|
||||||
*/
|
|
||||||
#if defined(__clang__)
|
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
|
|
||||||
#endif
|
|
||||||
arith_uint256 v{2};
|
arith_uint256 v{2};
|
||||||
v *= v;
|
v *= v;
|
||||||
BOOST_CHECK_EQUAL(v, arith_uint256{4});
|
BOOST_CHECK_EQUAL(v, arith_uint256{4});
|
||||||
@@ -603,9 +589,6 @@ BOOST_AUTO_TEST_CASE(operator_with_self)
|
|||||||
BOOST_CHECK_EQUAL(v, arith_uint256{2});
|
BOOST_CHECK_EQUAL(v, arith_uint256{2});
|
||||||
v -= v;
|
v -= v;
|
||||||
BOOST_CHECK_EQUAL(v, arith_uint256{0});
|
BOOST_CHECK_EQUAL(v, arith_uint256{0});
|
||||||
#if defined(__clang__)
|
|
||||||
#pragma clang diagnostic pop
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
@@ -199,19 +199,7 @@ FUZZ_TARGET(muhash)
|
|||||||
},
|
},
|
||||||
[&] {
|
[&] {
|
||||||
// Test that dividing a MuHash by itself brings it back to its initial state
|
// Test that dividing a MuHash by itself brings it back to its initial state
|
||||||
|
|
||||||
// See note about clang + self-assignment in test/uint256_tests.cpp
|
|
||||||
#if defined(__clang__)
|
|
||||||
# pragma clang diagnostic push
|
|
||||||
# pragma clang diagnostic ignored "-Wself-assign-overloaded"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
muhash /= muhash;
|
muhash /= muhash;
|
||||||
|
|
||||||
#if defined(__clang__)
|
|
||||||
# pragma clang diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
muhash.Finalize(out);
|
muhash.Finalize(out);
|
||||||
out2 = initial_state_hash;
|
out2 = initial_state_hash;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ namespace util {
|
|||||||
//! Implementation comes from and example usage can be found at
|
//! Implementation comes from and example usage can be found at
|
||||||
//! https://en.cppreference.com/w/cpp/utility/variant/visit#Example
|
//! https://en.cppreference.com/w/cpp/utility/variant/visit#Example
|
||||||
template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };
|
template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };
|
||||||
|
|
||||||
//! Explicit deduction guide (not needed after clang-17)
|
|
||||||
template<class... Ts> Overloaded(Ts...) -> Overloaded<Ts...>;
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
|
|
||||||
#endif // BITCOIN_UTIL_OVERLOADED_H
|
#endif // BITCOIN_UTIL_OVERLOADED_H
|
||||||
Reference in new issue
Block a user