Skip to content

[5.10][CMake] Replace early swift-syntax with FetchContent #68882

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 7 commits into from
Oct 10, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 29, 2023

Cherrypick #68408 (and #68388, #68527, and #68867) into release/5.10

  • Explanation: Build the swift-syntax host libraries using FetchContent rather than early-swiftsyntax. This simplifies the overall toolchain build process and fix the issues we've seen caused by swift-syntax not being rebuilt. We should be able to use this to fix cross-compiling on Linux
  • Scope: Build system
  • Risk: Mid, since we update the build mechanism. But removes some nasty hacks.
  • Testing: Passes the current test suite
  • Issues: rdar://115439072
  • Reviewer: Ben Barham (@bnbarham)

rintaro and others added 3 commits September 29, 2023 16:19
Instead of letting CMake set RPATH of the test executables, use
INSTALL_RPATH and BUILD_WITH_INSTALL_RPATH just like other executable
and shared libraries.

Previously when a swift module link with exported swift-syntax targets e.g.
'SwiftSyntax::SwiftParser', the libraries in earlyswiftsyntax were used
instead of the copied libraries in the swift build directory. That
wasn't ideal.

(cherry picked from commit 891d7b7)
`BOOTSTRAPPING_MODE` was used for configuring
`SWIFT_ENABLE_ARRAY_COW_CHECKS` before it's fully fixed.

(cherry picked from commit 06bffb9)
[CMake] Replace early swift-syntax with FetchContent

(cherry picked from commit 8dbde04)
@rintaro rintaro requested a review from a team as a code owner September 29, 2023 23:24
@rintaro
Copy link
Member Author

rintaro commented Sep 29, 2023

rdar://116239522
(cherry picked from commit d0dfd75)
`.dylib` was hardcoded. Accept other platforms' shared library filenames

(cherry picked from commit e9a183c)
After FetchContent changes, macros in Windows were disabled.

(cherry picked from commit 00f9935)
build-windows-toolchain.bat used to build and install 'swift-syntax'
for the compiler. Now that swift-syntax is built as a part of 'swift'
build. So no need to built it separately anymore.

(cherry picked from commit fc03e2e)
@rintaro rintaro force-pushed the 5.10-fetch-content branch from 76a9b53 to ad889b3 Compare October 2, 2023 16:17
@rintaro
Copy link
Member Author

rintaro commented Oct 2, 2023

@rintaro
Copy link
Member Author

rintaro commented Oct 5, 2023

@swift-ci Please test Windows

@rintaro
Copy link
Member Author

rintaro commented Oct 6, 2023

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