Skip to content

Add missing headers #7058

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

Merged
merged 2 commits into from
Jul 12, 2023
Merged

Conversation

etcwilde
Copy link

@etcwilde etcwilde commented Jul 6, 2023

Clang CachedDiagnostics uses std::unique_ptr, std::variant, and std::optional, coming from the memory, variant, and optional headers respectively. It looks like things shifted a bit so this wasn't building locally on Linux due to missing definitions.

llvm subtarget parser SubtargetFeature.h uses llvm::popcount, which comes from llvm/ADT/bit.h, which was causing build failures locally due to a missing llvm::popcount declaration.

Add missing optional include to include/llvm/Support/Format.h

@etcwilde etcwilde requested a review from edymtt July 6, 2023 21:24
@etcwilde
Copy link
Author

etcwilde commented Jul 6, 2023

@swift-ci please test

@etcwilde
Copy link
Author

etcwilde commented Jul 6, 2023

@swift-ci please test

Copy link

@edymtt edymtt left a comment

Choose a reason for hiding this comment

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

Thanks! That allowed me to clear errors related to SwiftRemoteMirror.cpp when building Swift for macOS against Xcode 14.2

@etcwilde
Copy link
Author

etcwilde commented Jul 6, 2023

swiftlang/swift#67170

@swift-ci please test

@etcwilde
Copy link
Author

etcwilde commented Jul 6, 2023

CMake version we're using is too old for LLVM:

CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
  CMake 3.20.0 or higher is required.  You are running version 3.19.6

@etcwilde
Copy link
Author

etcwilde commented Jul 7, 2023

Alright, this gets us through the LLVM build and into Swift build failures due to leaky builds;

In file included from /Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/swift/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp:26:
In file included from /Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/swift/include/swift/RemoteInspection/ReflectionContext.h:24:
In file included from /Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/llvm-project/llvm/include/llvm/Object/COFF.h:26:
In file included from /Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/llvm-project/llvm/include/llvm/TargetParser/SubtargetFeature.h:20:
/Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/llvm-project/llvm/include/llvm/ADT/bit.h:115:51: error: redefinition of 'TrailingZerosCounter'
  115 | template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
      |                                                   ^
/Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-next/swift/stdlib/include/llvm/Support/MathExtras.h:91:51: note: previous definition is here
   91 | template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
      |                                                   ^

(I think this is as good as we're going to get for a bit.)
I've opened https://reviews.llvm.org/D154664 on upstream LLVM so we'll get that landed there.

@etcwilde etcwilde force-pushed the ewilde/add-missing-headers branch from 5675b1e to dea9f91 Compare July 12, 2023 23:35
@etcwilde
Copy link
Author

@swift-ci please smoke test

etcwilde added 2 commits July 12, 2023 16:37
Clang cache uses std::variant, std::unique_ptr, and std::optional. The
missing headers are resulting in build failures.
SubtargetFeature.h uses llvm/ADT/bit.h.

Reviewed By: compnerd, mib

Differential Revision: https://reviews.llvm.org/D154664
@etcwilde etcwilde force-pushed the ewilde/add-missing-headers branch from dea9f91 to 0723a8f Compare July 12, 2023 23:37
@etcwilde etcwilde merged commit 1604b03 into swiftlang:next Jul 12, 2023
@etcwilde etcwilde deleted the ewilde/add-missing-headers branch July 12, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants