Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#28210: build: Bump clang minimum supported vers…
Browse files Browse the repository at this point in the history
…ion to 13

fae379b build: Bump minimum supported Clang to clang-13 (MarcoFalke)
fab1ef9 Bump .python-version from 3.9.17 to 3.9.18 (MarcoFalke)

Pull request description:

  All supported operating systems ship with clang-13 (or later), so bump the minimum to that and remove now unused workarounds for previous clang bugs.

  For reference:
  * https://packages.debian.org/bullseye/clang-13
  * https://packages.ubuntu.com/jammy/clang (`clang-14`) and https://packages.ubuntu.com/jammy/clang-15
  * CentOS-like 8/9 Stream: All Clang versions from 13 to 15
  * FreeBSD 12/13: All Clang version from 13 to 16
  * OpenSuse Tumbleweed ships with https://software.opensuse.org/package/clang (`clang16`); No idea about OpenSuse Leap

  This is for Bitcoin Core 27.0 in 2024 (next year), not the soon upcoming 26.0 next month.

ACKs for top commit:
  fanquake:
    ACK fae379b

Tree-SHA512: 8ed2b227de39b60d3f004daa4a38ea66fe005988bd977046a40613fba847d88d272925732f24777c00264abb99e25874b05b4b9243868d304eba84b450835ccc
  • Loading branch information
fanquake committed Oct 24, 2023
2 parents 4370482 + fae379b commit ba0313d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.17
3.9.18
6 changes: 3 additions & 3 deletions ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye"
# Use minimum supported python3.9 and clang-10 (or best-effort clang-11), see doc/dependencies.md
export PACKAGES="python3-zmq clang-11 llvm-11 libc++abi-11-dev libc++-11-dev"
export DEP_OPTS="NO_WALLET=1 CC=clang-11 CXX='clang++-11 -stdlib=libc++'"
# Use minimum supported python3.9 and clang-13, see doc/dependencies.md
export PACKAGES="python3-zmq clang-13 llvm-13 libc++abi-13-dev libc++-13-dev"
export DEP_OPTS="NO_WALLET=1 CC=clang-13 CXX='clang++-13 -stdlib=libc++'"
export GOAL="install"
export BITCOIN_CONFIG="--enable-reduce-exports --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared"
2 changes: 1 addition & 1 deletion doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
| --- | --- |
| [Autoconf](https://www.gnu.org/software/autoconf/) | [2.69](https://github.com/bitcoin/bitcoin/pull/17769) |
| [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) |
| [Clang](https://clang.llvm.org) | [10.0](https://github.com/bitcoin/bitcoin/pull/27682) |
| [Clang](https://clang.llvm.org) | [13.0](https://github.com/bitcoin/bitcoin/pull/28210) |
| [GCC](https://gcc.gnu.org) | [9.1](https://github.com/bitcoin/bitcoin/pull/27662) |
| [Python](https://www.python.org) (scripts, tests) | [3.9](https://github.com/bitcoin/bitcoin/pull/28211) |
| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A |
Expand Down
3 changes: 1 addition & 2 deletions src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ util::Result<std::unique_ptr<AddrMan>> LoadAddrman(const NetGroupManager& netgro
return util::Error{strprintf(_("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start."),
e.what(), PACKAGE_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))};
}
return {std::move(addrman)}; // std::move should be unnecessary but is temporarily needed to work around clang bug
// (https://github.com/bitcoin/bitcoin/pull/25977#issuecomment-1561270092)
return addrman;
}

void DumpAnchors(const fs::path& anchors_db_path, const std::vector<CAddress>& anchors)
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ std::optional<std::string> V2Transport::GetMessageType(Span<const uint8_t>& cont
}
// Strip message type bytes of contents.
contents = contents.subspan(CMessageHeader::COMMAND_SIZE);
return {std::move(ret)};
return ret;
}

CNetMessage V2Transport::GetReceivedMessage(std::chrono::microseconds time, bool& reject_message) noexcept
Expand Down
8 changes: 4 additions & 4 deletions src/wallet/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class WalletLoaderImpl : public WalletLoader
bilingual_str error;
std::unique_ptr<Wallet> wallet{MakeWallet(m_context, CreateWallet(m_context, name, /*load_on_start=*/true, options, status, error, warnings))};
if (wallet) {
return {std::move(wallet)};
return wallet;
} else {
return util::Error{error};
}
Expand All @@ -616,7 +616,7 @@ class WalletLoaderImpl : public WalletLoader
bilingual_str error;
std::unique_ptr<Wallet> wallet{MakeWallet(m_context, LoadWallet(m_context, name, /*load_on_start=*/true, options, status, error, warnings))};
if (wallet) {
return {std::move(wallet)};
return wallet;
} else {
return util::Error{error};
}
Expand All @@ -627,7 +627,7 @@ class WalletLoaderImpl : public WalletLoader
bilingual_str error;
std::unique_ptr<Wallet> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings))};
if (wallet) {
return {std::move(wallet)};
return wallet;
} else {
return util::Error{error};
}
Expand All @@ -642,7 +642,7 @@ class WalletLoaderImpl : public WalletLoader
.solvables_wallet_name = res->solvables_wallet ? std::make_optional(res->solvables_wallet->GetName()) : std::nullopt,
.backup_path = res->backup_path,
};
return {std::move(out)}; // std::move to work around clang bug
return out;
}
std::string getWalletDir() override
{
Expand Down

0 comments on commit ba0313d

Please sign in to comment.