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

Use libcxx from Darwin SDKs when building LLVM and Swift #62125

Closed
wants to merge 1 commit into from

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Nov 15, 2022

Those are present since Xcode 12.5, so we don't need to copy them
anymore from the toolchain

In this scenario, clean up any existing symlink in incremental builds to
avoid masking or causing errors in the future.

Addresses rdar://102387542

@edymtt
Copy link
Contributor Author

edymtt commented Nov 15, 2022

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Nov 15, 2022

@swift-ci please build toolchain

@edymtt
Copy link
Contributor Author

edymtt commented Nov 15, 2022

@swift-ci please test Apple Silicon

Copy link

@ldionne ldionne left a comment

Choose a reason for hiding this comment

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

This makes sense to me, but you should make sure that you don’t use -nostdinc++ or -nostdinc when building, since that would disable the default place where clang looks for libc++ headers.

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

Windows toolchain job fails with

‘build/artifacts/*’ doesn’t match anything, but ‘*’ does. Perhaps that’s what you mean?

which happens for other PRs as well, so considering this unrelated to this change.

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

It seems we are using -nostdinc++ in one place in Swift code, and from the comment in there it seems it is on purpose

https://github.com/apple/swift/blob/17d3065215ece966bd0e0a3a51fdb76f785b654a/stdlib/public/Cxx/CMakeLists.txt#L9

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

For macOS test, we are hitting

Failed Tests (1):
  lldb-api :: lang/swift/clangimporter/static_archive/TestSwiftStaticArchiveTwoSwiftmodules.py

This happened for other PRs (e.g. #62121 in https://ci.swift.org/job/swift-PR-macos/4836) but it seems to have clear up in later attempts (e.g. https://ci.swift.org/job/swift-PR-macos/4844/) so retrying it

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

@swift-ci please test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

The Apple Silicon bot seems to be hitting issues in finding libc++ headers (which we did not hit in the regular one)

******************* TEST 'Swift(macosx-arm64) :: Interop/SwiftToCxx/class/swift-actor-in-cxx.swift' FAILED ********************
<snip>
/Users/ec2-user/jenkins/workspace/swift-pr-arm64-macos/branch-main/build/buildbot_incremental/swift-macosx-arm64/test-macosx-arm64/Interop/SwiftToCxx/class/Output/swift-actor-in-cxx.swift.tmp/actor.h:29:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^~~~~~~~~
1 error generated.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I cannot really comment on the change in practice, but the commit message and the change look like they match. I assume that this was a change to the layout of the SDK? Do we need to be worried about building against old layouts?

@hyp
Copy link
Contributor

hyp commented Nov 16, 2022

@compnerd This change to SDK has shipped since Xcode 12.5. We are assuming you need something >= Xcode 12.5 to build Swift already I believe.

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

Realized that the Apple Silicon failure is legit, and it fact it now happens on a regular bot which did not inherit the symlink from a previous run

@hyp kindly provided test changes in #62139 -- on my side I would need to clean up any existing symlinks, since they could become stale (e.g. point to an installation of Xcode that is no longer present) and cause/mask compiler errors.

Those are present since Xcode 12.5, so we don't need to copy them
anymore from the toolchain

In this scenario, clean up any existing symlink in incremental builds to
avoid masking or causing errors in the future.

Addresses rdar://102387542
@edymtt edymtt force-pushed the use-libcxx-from-darwin-sdks branch from 841f36b to 5519977 Compare November 16, 2022 17:52
@edymtt edymtt requested review from ldionne and compnerd November 16, 2022 17:53
@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

@swift-ci please build toolchain

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

@swift-ci please test Apple Silicon

@compnerd
Copy link
Member

I'm testing a fix for the Windows toolchain build @edymtt (#62138)

@edymtt
Copy link
Contributor Author

edymtt commented Nov 16, 2022

New changes with the cleanup at 5519977 -- I would suggest to use Hide Whitespace to get a sense of the change, since I had to change indentation

These new runs are expected to fail for macOS, mainly want to be sure I did not regress the other platforms

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks for the comments about the versioning!

@edymtt
Copy link
Contributor Author

edymtt commented Nov 17, 2022

Now that LLVM is using a proper build-script product (#38507), reworked this accordingly in #62159

Leaving this PR around for now in the remote case we need to fall back to build-script-impl logic

@edymtt
Copy link
Contributor Author

edymtt commented Dec 9, 2022

We did not need to go back to the old build-script-impl product, so closing this PR

@edymtt edymtt closed this Dec 9, 2022
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.

4 participants