Skip to content

Move All the Gyb Support for Syntax out of Swift #60859

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
Sep 1, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Aug 30, 2022

Make libSyntax depend on swift-syntax: the new home for all
of this infrastructure. This greatly simplifies the addition and
amending of syntax nodes as only the swift-syntax paired with a
swift checkout will need to be changed. This is in contrast to
the existing build flow where a paired PR to both repos must be
made to change anything here.

Note that a paired PR may still be required if the legacy parser
needs to be adjusted in response to syntax nodes changing, but I
anticipate this to be a much more infrequent event now that
the C++ end of libSyntax is deprecated.

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 30, 2022

Pairs well with swiftlang/swift-syntax#663

@@ -623,6 +623,11 @@ if(CMAKE_C_COMPILER_ID MATCHES Clang)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Werror=c++98-compat-extra-semi>)
endif()

# Make sure we know where swift-syntax is because we need it to build the parser.
if(NOT EXISTS "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}")
Copy link
Member

Choose a reason for hiding this comment

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

We should probably stick to a more conventional directory naming scheme.
Something like SWIFT_SYNTAX_SOURCE_DIR.

Copy link
Member

Choose a reason for hiding this comment

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

I think that the name actually works well for the current state of things - all the external repositories use this current naming scheme.

Copy link
Member

Choose a reason for hiding this comment

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

This is true. Diverges from LLVM, but I guess that's common around these parts.

@compnerd
Copy link
Member

compnerd commented Aug 30, 2022

This is going to require a change to compnerd/swift-build to ensure that we do not break the Windows CI there. Please ensure that we synchronise the changes when this is merged.

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 30, 2022

@compnerd
Copy link
Member

Do we need to worry about the CI build scripts for Windows?

@CodaFi CodaFi force-pushed the nodus-operandi branch 3 times, most recently from 64fa1d1 to bebf91c Compare August 31, 2022 02:20
@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

swiftlang/llvm-project#5236 will unblock the windows bot. I'll make sure it's blue before I merge.

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

Copy link
Contributor

@stevapple stevapple left a comment

Choose a reason for hiding this comment

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

To support this change into Windows CI, we also need to remove line 125 in build-windows.bat, and make identical changes to build-windows-toolchain.bat. Both files are used on Swift CI.

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

swiftlang/swift-syntax#663

@swift-ci test windows

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

whoa

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

Make libSyntax depend on swift-syntax: the new home for all
of this infrastructure. This greatly simplifies the addition and
amending of syntax nodes as only the swift-syntax paired with a
swift checkout will need to be changed. This is in contrast to
the existing build flow where a paired PR to both repos must be
made to change anything here.

Note that a paired PR may still be required if the legacy parser
needs to be adjusted in response to syntax nodes changing, but I
anticipate this to be a much more infrequent event now that
the C++ end of libSyntax is deprecated.
@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 31, 2022

@CodaFi CodaFi merged commit 553dc20 into swiftlang:main Sep 1, 2022
@CodaFi CodaFi deleted the nodus-operandi branch September 1, 2022 03:04
compnerd added a commit that referenced this pull request Sep 1, 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