Skip to content

[build] Link the Swift resource directory against the headers from a prebuilt clang, if building with one #40707

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 1 commit into from
Jan 13, 2022

Conversation

finagolfin
Copy link
Member

@finagolfin finagolfin commented Dec 26, 2021

If building the stdlib with a prebuilt clang, link against its headers rather than assuming they are installed in the Swift toolchain. This is particularly useful when building standalone, cross-compiled SDKs, as I've been patching my Android SDKs to do this for years.

@llvm-beanz, you set this symlink directory in #5034 years back, would you review?

@llvm-beanz
Copy link
Contributor

This looks reasonable to me, but I'm really not involved with swift anymore. I know @compnerd and @etcwilde have a lot of experience with the build system code.

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

Yeah, I think this should be okay.

@etcwilde
Copy link
Member

etcwilde commented Jan 4, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 4, 2022

Build failed
Swift Test OS X Platform
Git Sha - 8fd1d64

@etcwilde
Copy link
Member

etcwilde commented Jan 4, 2022

macOS failure: xcodebuild: error: The authorization was denied since no user interaction was possible.

@swift-ci
Copy link
Contributor

swift-ci commented Jan 4, 2022

Build failed
Swift Test Linux Platform
Git Sha - 8fd1d64

@finagolfin
Copy link
Member Author

Linux CI failure was unrelated, as the CI was simply broken at the time with a prior CI run of another pull failing with the same error, and the macOS CI failure appears spurious, probably flaky tests as this pull doesn't affect the iphonesimulator.

@etcwilde
Copy link
Member

etcwilde commented Jan 5, 2022

I've seen the linux load commands test failing on some other unrelated PRs as well.
I think someone may have actually broken it.

@finagolfin
Copy link
Member Author

I think the CI is working again now.

@etcwilde
Copy link
Member

etcwilde commented Jan 7, 2022

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jan 7, 2022

Build failed
Swift Test OS X Platform
Git Sha - 8fd1d64

@finagolfin
Copy link
Member Author

Linux CI passed, macOS CI flaked on some watchsimulator tests this time.

@etcwilde
Copy link
Member

etcwilde commented Jan 9, 2022

The macOS failure should have been fixed here: #40760

@etcwilde
Copy link
Member

etcwilde commented Jan 9, 2022

@swift-ci please test macOS

@finagolfin
Copy link
Member Author

Passed CI, ready to merge.

@etcwilde etcwilde merged commit 3de0bbb into swiftlang:main Jan 13, 2022
@etcwilde
Copy link
Member

There you go

@finagolfin finagolfin deleted the symlink-clang branch January 13, 2022 07:31
drodriguez added a commit that referenced this pull request Feb 9, 2022
When building with a prebuilt Clang, the changes introduced in #40707
supposed that the toolchain was in its final path.

When building in stages (first the toolchain, then the standard
library), the toolchain might not be in the final path, and the created
symlink will point to a machine-local path that does not make sense.

The changes introduced should not modify the existing behaviour
introduced by #40707, but should allow customizing the final
installation target using the CMake cached variable for those setups
that need the flexibility.
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