Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Bump clang minimum supported version to 15 #29165

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jan 2, 2024

Most supported operating systems ship with clang-15 (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:

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 2, 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, fanquake

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:

  • #29077 ([WIP, DO NOT MERGE!!11111!!!!!] build: Require libc++-16 or later by maflcko)
  • #29071 (refactor: Remove Span operator==, Use std::ranges::equal by maflcko)
  • #28687 (C++20 std::views::reverse by stickies-v)
  • #25972 (build: no-longer disable WARN_CXXFLAGS when CXXFLAGS is set by fanquake)

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 Jan 2, 2024

The macOS CI fails (as expected). Moving to draft for now, until someone clarifies the macOS clang situation. (I don't use macOS)

@maflcko maflcko marked this pull request as draft January 2, 2024 11:30
@fanquake
Copy link
Member

fanquake commented Jan 2, 2024

The macOS CI fails (as expected). Moving to draft for now, until someone clarifies the macOS clang situation. (I don't use macOS)

Xcode 14.3.1 (currently used in the CI) is based on ~ LLVM 14. It's failing because removing the fuzz workaround requires LLVM/Clang 15 or later. The GH image ships with newer Xcodes, https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode, so I assume we could switch to using Xcode 15.x + in the CI (based on LLVM 16.x).

The multiprocess build is also failing, due to what I assume is a Debian packaging issue.

@fanquake
Copy link
Member

fanquake commented Jan 2, 2024

The libbitcoinkernel clang-15 libc++ job is also failing, so I guess this isn't actually fixed with clang-15, regardless of macOS?

fanquake added a commit to bitcoin-core/gui that referenced this pull request Jan 5, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin/bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
@maflcko
Copy link
Member Author

maflcko commented Apr 22, 2024

Can you add a note to doc/build-osx.md that users of macOS < 13 need to install clang via homebrew?

##29918 is an unrelated issue existing on current master, so I think a separate pull request would be more appropriate. Also, I don't have or use macOS/Apple, so someone else creating that pull request would be beneficial.

@Sjors
Copy link
Member

Sjors commented Apr 22, 2024

My remark is orthogonal to #29918. macOS < 13 doesn't have clang 15. They also don't have clang 14, which was missed in #29208.

There's need to make a separate pull request for a single sentence:

At the bottom of step 3:

On macOS < 13 you additionally need to install a more recent version of clang:

    brew install clang

@maflcko
Copy link
Member Author

maflcko commented Apr 22, 2024

There's need to make a separate pull request for a single sentence:

I don't think this is enough. Is it not required to specify the CC and CXX to ./configure? Something like CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++? Or does brew overwrite the clang system compiler?

Another reason to fix this in a separate pull is to have the fix in before this pull is merged (which at this point is unclear when it can happen).

@Sjors
Copy link
Member

Sjors commented Apr 22, 2024

Done in #29934.

Correction to version support above: clang 15.0 is shipped with Xcode 15, not 14. But its system requirements are fairly similar, macOS 13.5 or better: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes

I don't have a macOS 11 or 12 machine to actually test if it still works. Given that homebrew dropped explicit support for macOS 11 I don't think we need to worry about that version, but it would be nice if someone can test if they can still build (clang 15) on macOS 12.

@maflcko
Copy link
Member Author

maflcko commented Apr 22, 2024

Thanks, I'll rebase once the other pull is merged.

@maflcko maflcko marked this pull request as ready for review April 27, 2024 12:53
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 fa1964c.

@maflcko
Copy link
Member Author

maflcko commented Apr 27, 2024

Rebased and taken out of draft. I've opened two pull requests against oss-fuzz to bump the compiler there (one globally and one for bitcoin-core), but they are waiting for merge. If they are not merged, I think we can consider oss-fuzz as unsupported and drop it temporarily. Oss-fuzz is nice, but it seems odd to consider it a blocker here.

@fanquake
Copy link
Member

Yea. I think we can merge our independant oss-fuzz bump, then merge this, then revert the oss-fuzz change if/when the global oss-fuzz bump happens. That has dragged on a bit too long, and is just blocking things here.

@Sjors
Copy link
Member

Sjors commented Apr 29, 2024

@maflcko the updated wording in #29934 is such this PR won't conflict with it.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK fa1964c - oss-fuzz LLVM will either be bumped globally tomorrow, or we'll land our own bump.

@fanquake fanquake merged commit 4d2d91a into bitcoin:master Apr 29, 2024
16 checks passed
@maflcko maflcko deleted the 2401-clang-15- branch April 29, 2024 14:31
hebasto added a commit to hebasto/bitcoin that referenced this pull request Apr 29, 2024
8fd40d4 fixup! ci: Test CMake edge cases (Hennadii Stepanov)
c08acdb fixup! ci: Test CMake edge cases (Hennadii Stepanov)

Pull request description:

  See bitcoin#29165.

ACKs for top commit:
  m3dwards:
    utACK 8fd40d4

Tree-SHA512: 4f74730de2de7767875357044763f9aa73ba0e973a9af2572989f51bf631cd082279f08b7141ef8e56765cecf327ee31406bd83d05eb2a5125d520f773d0210f
@fanquake
Copy link
Member

Release note added in #30261.

PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
f8ca135 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the bitcoin#29165 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca135
  fanquake:
    ACK f8ca135

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
kwvg added a commit to kwvg/dash that referenced this pull request Nov 10, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Jan 7, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants