Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jun 10, 2024

Most supported operating systems ship with clang-16 (or later), so bump the minimum to that and allow new code to drop workarounds for previous clang bugs.

For reference:

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:

Ubuntu 22.04 LTS does not ship with clang-16, so one of the above workarounds is needed there.

macOS 13 is unaffected, and the previous minimum requirement of Xcode15.0 remains, see also https://github.com/bitcoin/bitcoin/blame/b1ba1b178f501daa1afdd91f9efec34e5ec1e294/.github/workflows/ci.yml#L93. For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm, this remains unchanged as well, see https://github.com/bitcoin/bitcoin/blame/b1ba1b178f501daa1afdd91f9efec34e5ec1e294/doc/build-osx.md#L54.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 10, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto, TheCharlatan, stickies-v
Concept ACK theuni, kevkevinpal, instagibbs

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29071 (refactor: Remove Span operator==, Use std::ranges::equal by maflcko)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member Author

maflcko commented Jun 10, 2024

This is needed for stuff:

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

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

Concept ACK.

FWIW on Ubuntu 20.04 I'm using pre-compiled binaries from https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.4 with no issues.

@maflcko
Copy link
Member Author

maflcko commented Jun 12, 2024

FWIW on Ubuntu 20.04 I'm using pre-compiled binaries from https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.4 with no issues.

Yeah, seems fine for test systems. I didn't want to suggest it, because https://discourse.llvm.org/t/rfc-improve-binary-security/78121/56 is still WIP.

@fanquake
Copy link
Member

Should this be dropped:

const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped after clang-16 */ {std::move(target), std::move(opts)})};

@maflcko
Copy link
Member Author

maflcko commented Jun 12, 2024

Should this be dropped:

Not sure what is wrong with Apple, but I don't have any insight into their XCode/Apple-Clang versioning and source code, so I think I'll just clarify in this comment that this needs Apple-Clang 16 (the meaning of which is unclear).

@maflcko
Copy link
Member Author

maflcko commented Jun 12, 2024

Ref:

/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/map:1282:24: note: in instantiation of function template specialization 'std::__tree<std::__value_type<std::string_view, FuzzTarget>, std::__map_value_compare<std::string_view, std::__value_type<std::string_view, FuzzTarget>, std::less<std::string_view>>, std::allocator<std::__value_type<std::string_view, FuzzTarget>>>::__emplace_unique_key_args<std::string_view, const std::piecewise_construct_t &, std::tuple<const std::string_view &>, std::tuple<std::function<void (Span<const unsigned char>)> &&, FuzzTargetOptions &&>>' requested here
        return __tree_.__emplace_unique_key_args(__k,
                       ^
test/fuzz/fuzz.cpp:75:40: note: in instantiation of function template specialization 'std::map<std::string_view, FuzzTarget>::try_emplace<std::function<void (Span<const unsigned char>)>, FuzzTargetOptions>' requested here
    const auto [it, ins]{FuzzTargets().try_emplace(name, std::move(target), std::move(opts))};
                                       ^
test/fuzz/fuzz.cpp:62:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided

https://github.com/bitcoin/bitcoin/actions/runs/9481386652/job/26124061545?pr=30263#step:7:2611

@fanquake
Copy link
Member

Looks like the Apple Clang shipping with Xcode 15, is based on Clang 15. Xcode 16 (still in beta) will ship with a Apple Clang based on Clang 16.

@kevkevinpal
Copy link
Contributor

Concept ACK fa58c75

I'm on fedora and was able to build properly

uname -a
Linux fedora 6.2.15-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 17:37:39 UTC 2023 x86_64 GNU/Linux

clang --version
clang version 16.0.6 (Fedora 16.0.6-4.fc38)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

clang++ --version
clang version 16.0.6 (Fedora 16.0.6-4.fc38)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@maflcko
Copy link
Member Author

maflcko commented Jun 18, 2024

Looks like the Apple Clang shipping with Xcode 15, is based on Clang 15. Xcode 16 (still in beta) will ship with a Apple Clang based on Clang 16.

Well, for some reason it can compile ranges fine, without further changes, so at least to some extend it seems to be based on llvm 16 (maybe an intermediate random commit from the main dev branch)?

In any case, I am not changing the Xcode/macOS/Apple requirements here. Someone else can do it, if there is need for it and it is acceptable to do.

@DrahtBot
Copy link
Contributor

Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

File commit 41544b8
(master)
commit 1d5a7b9540abc1f3662c1261e9d01ab1d744476d
(master and this pull)
SHA256SUMS.part 51e3228f4fe34c50... 47668e5cab69e29a...
*-aarch64-linux-gnu-debug.tar.gz b3184bb6b00080fd... ab7e231f4fd0b0ff...
*-aarch64-linux-gnu.tar.gz 70388ef31f3937e4... 6fa2e1b59e94dd81...
*-arm-linux-gnueabihf-debug.tar.gz 16e36a216e800e2b... 67c7cbdaeb32c81a...
*-arm-linux-gnueabihf.tar.gz 1ac17a158dffb672... b5e68b2b4c0482ec...
*-arm64-apple-darwin-unsigned.tar.gz ea99a5cc62e8c1fc... c1e167272783f1af...
*-arm64-apple-darwin-unsigned.zip 672f2ab09bb45d66... d3777eca3a5d9f09...
*-arm64-apple-darwin.tar.gz df62083ab10be612... c1ebdcd1577da3e3...
*-powerpc64-linux-gnu-debug.tar.gz 1a110f6135e4a742... 6972e945972cb41b...
*-powerpc64-linux-gnu.tar.gz cdf683143ed86807... c6ab842668701fac...
*-riscv64-linux-gnu-debug.tar.gz 9455864b53af0bb4... c68c243cc7eb7f3f...
*-riscv64-linux-gnu.tar.gz 1325614aca564540... d48fac828916c47c...
*-x86_64-apple-darwin-unsigned.tar.gz 50f1e5a287060f32... 7e0c0f31821c5d63...
*-x86_64-apple-darwin-unsigned.zip 54f3602f26ee19fb... cef4b75a5ab1cea7...
*-x86_64-apple-darwin.tar.gz d1a87f6623cee8da... 097efa57a48b0d8e...
*-x86_64-linux-gnu-debug.tar.gz 22afb6df6de53801... 62e5b89ae2615be3...
*-x86_64-linux-gnu.tar.gz 1b7ed787619fe2f4... e5862e78786c3673...
*.tar.gz 33f4147997977ed3... d5026ae59585c049...
guix_build.log 8886fbf0c68bc044... c719841248b743c1...
guix_build.log.diff 3094b7482dd32565...

Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

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

ACK fa58c75880334cc58ccc8e5d491df8f0e587bf42

@DrahtBot DrahtBot requested a review from theuni June 25, 2024 13:25
@maflcko
Copy link
Member Author

maflcko commented Jun 26, 2024

Rebased to remove a workaround that was added in the meantime.

@hebasto
Copy link
Member

hebasto commented Jun 27, 2024

@maflcko @TheCharlatan

Not a blocker at all, I just wonder if there is a verified recipe to get clang-16 for RISC-V platform?

@maflcko
Copy link
Member Author

maflcko commented Jun 27, 2024

Not a blocker at all, I just wonder if there is a verified recipe to get clang-16 for RISC-V platform?

Not sure what you mean, but this depends on your OS. You can install it normally. For example:

# apt install clang-16 && clang-16 --version 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
clang-16 is already the newest version (1:16.0.6-23ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
Ubuntu clang version 16.0.6 (23ubuntu4)
Target: riscv64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

But this seems unrelated to this pull, or am I missing something?

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK fa8f532, I have reviewed the code and it looks OK.

@DrahtBot DrahtBot requested a review from sedited June 28, 2024 14:49
Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

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

Re-ACK fa8f532

{
const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped after clang-16 */ {std::move(target), std::move(opts)})};
Assert(it_ins.second);
const auto [it, ins]{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped after Apple-Clang-16 ? */ {std::move(target), std::move(opts)})};
Copy link
Member

Choose a reason for hiding this comment

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

I can confirm that the GHA macos-14 image with Xcode 16.0 (beta) (build 16A5171c) does not require this workaround.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for checking. I'd say dropping support for macos-13+xcode should be done in a follow-up (probably far into the future).

Or was it meant as a nit to remove the ? in this line of code? If yes, I'll address it, if I have to retouch or rebase.

Copy link
Member

@hebasto hebasto Jul 3, 2024

Choose a reason for hiding this comment

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

I did not mean any changes to the current branch :)

It was just a note (mostly for myself).

@fanquake
Copy link
Member

fanquake commented Jul 4, 2024

@instagibbs @sr-gi maybe @mzumsande. This will likely affect you. Any feedback?

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

ACK fa8f532

My review shouldn't count for much as I'm not too familiar with build system stuff, but:

  • I want clang-16
  • it works for me locally
  • it doesn't seem to break anything
  • the changes look good

@instagibbs
Copy link
Member

concept ACK

@sr-gi
Copy link
Member

sr-gi commented Jul 8, 2024

@instagibbs @sr-gi maybe @mzumsande. This will likely affect you. Any feedback?

I'm really not familiar with the build system, but I was able to build this without any changes in my setup on macOS 14.5 with clang 15.0.0

@mzumsande
Copy link
Contributor

@instagibbs @sr-gi maybe @mzumsande. This will likely affect you. Any feedback?

Thanks - no objections, I've updated everywhere, so no longer affected by this.

@hebasto
Copy link
Member

hebasto commented Jul 15, 2024

Ported to the CMake-based build system in hebasto#263.

hebasto added a commit to hebasto/bitcoin that referenced this pull request Jul 16, 2024
4704f86 [FIXUP] ci: Migrate CI scripts to CMake (Hennadii Stepanov)

Pull request description:

  This PR ports CI-related changes from bitcoin#30263 and ensures that the minimum required CMake version is available.

  Here are CMake versions across all changes:
  - pre-PR30263: CMake [3.22.1](https://packages.ubuntu.com/jammy/cmake)
  - post-PR30263: CMake [3.18.4](https://packages.debian.org/bullseye/cmake), which is less than the minimum required 3.22
  - this PR: CMake [3.28.3](https://packages.ubuntu.com/noble/cmake)

Top commit has no ACKs.

Tree-SHA512: 93d88722e0494421c9358b15a86f108c3d70ae4259c370932bfececd90cd5f81dba3e7798adc39da6cb0526a267acfebc8ad9f8506a001c8c18c4776ab1d54e3
kwvg added a commit to kwvg/dash that referenced this pull request Feb 5, 2025
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Feb 7, 2025
, bitcoin#24337, bitcoin#27682, bitcoin#29208, bitcoin#29091, bitcoin#29165, bitcoin#29934, bitcoin#30261, partial bitcoin#27662, bitcoin#28210, bitcoin#28348, bitcoin#30263 (bump minimum compiler)

0861692 partial bitcoin#30263: Bump clang minimum supported version to 16 (Kittywhiskers Van Gogh)
5e7e563 merge bitcoin#30261: add release note for 29091 and 29165 (Kittywhiskers Van Gogh)
4d10993 merge bitcoin#29934: add LLVM instruction for macOS < 13 (Kittywhiskers Van Gogh)
7e4614a merge bitcoin#29165: Bump clang minimum supported version to 15 (Kittywhiskers Van Gogh)
f397076 merge bitcoin#29091: Bump g++ minimum supported version to 11 (Kittywhiskers Van Gogh)
35d3357 merge bitcoin#29208: Bump clang minimum supported version to 14 (Kittywhiskers Van Gogh)
c71e3df partial bitcoin#28348: Bump g++ minimum supported version to 10 (Kittywhiskers Van Gogh)
b7da1ed partial bitcoin#28210: Bump clang minimum supported version to 13 (Kittywhiskers Van Gogh)
6b22832 partial bitcoin#27662: Bump minimum supported GCC to g++-9 (Kittywhiskers Van Gogh)
f677769 merge bitcoin#27682: Bump minimum supported Clang to clang-10 (Kittywhiskers Van Gogh)
f8e0339 docs: add `libgmp` as an optional dependency (Kittywhiskers Van Gogh)
ebba607 docs: update version used to match `depends` (Kittywhiskers Van Gogh)
39b6f4b merge bitcoin#24337: Do not define `PROVIDE_FUZZ_MAIN_FUNCTION` macro unconditionally (Kittywhiskers Van Gogh)
2bd8422 merge bitcoin#23565: rewrite dependencies.md (Kittywhiskers Van Gogh)
56989ec merge bitcoin#24164: Bump minimum required clang/libc++ to 8.0 (Kittywhiskers Van Gogh)
bac407f merge bitcoin#23060: increase minimum compiler and lib(std)c++ requirements (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependent on #6516

  ## Breaking Changes

  GCC 11.1 or later, or Clang 16.0 or later, are now required to compile Dash Core.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 0861692
  UdjinM6:
    utACK 0861692

Tree-SHA512: 6de3f8153482b4f379fd397dd3000688632356299c4f13a2f8af20d2f7337318bd3cd0b96182d6f378846b14981bc499ea32aa3d20cba6a0c7cf5f2a6e151937
@bitcoin bitcoin locked and limited conversation to collaborators Jul 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.