Skip to content

[5.9][CMake] Replace early swift-syntax with FetchContent #68872

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

Closed
wants to merge 8 commits into from

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 29, 2023

Cherry-pick #68408 (and dependent #68273, #68388, and #68527) into release/5.9

  • 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 rintaro requested a review from a team as a code owner September 29, 2023 17:44
@rintaro
Copy link
Member Author

rintaro commented Sep 29, 2023

@finagolfin
Copy link
Member

Nice, I slapped up my own 5.9 backport online a couple hours ago.

@rintaro
Copy link
Member Author

rintaro commented Sep 29, 2023

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Oct 2, 2023

rintaro and others added 8 commits October 2, 2023 15:11
as long as the Swift parser integration is enabled.
Also, remove redundant RPATH additions.

(cherry picked from commit 537f318)
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)

 Conflicts:
	lib/Frontend/PrintingDiagnosticConsumer.cpp
	lib/Parse/ParseType.cpp
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)

Conflicts:
	utils/build-windows-toolchain.bat
@rintaro rintaro force-pushed the 5.9-fetch-content branch from 3327d59 to 39f5938 Compare October 2, 2023 22:11
@rintaro
Copy link
Member Author

rintaro commented Oct 2, 2023

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Oct 3, 2023

@bnbarham bnbarham closed this Nov 7, 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.

4 participants