Skip to content

[SyntaxParser] Split definition of C data types into separate file #39441

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
Sep 29, 2021

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Sep 24, 2021

Companion of swiftlang/swift-syntax#309


To split the SwiftSyntax library into two modules – SwiftSyntax with no dependency on _InternalSwiftSyntaxParser.dylib and SwiftSyntaxParser which generates a SwiftSyntax tree using _InternalSwiftSyntaxParser.dylib – we need to copy the definition of the C types into the SwiftSyntax repository. To make sure the two match, move the duplicated types into their own file. That way, we can compare them in SwiftSyntax’s build script and thus make sure their definitions are the same.

To split the SwiftSyntax library into two modules – `SwiftSyntax` with no dependency on `_InternalSwiftSyntaxParser.dylib` and `SwiftSyntaxParser` which generates a `SwiftSyntax` tree using `_InternalSwiftSyntaxParser.dylib` – we need to copy the definition of the C types into the SwiftSyntax repository. To make sure the two match, move the duplicated types into their own file. That way, we can compare them in SwiftSyntax’s build script and thus make sure their definitions are the same.
@ahoppen
Copy link
Member Author

ahoppen commented Sep 24, 2021

swiftlang/swift-syntax#309

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 9841d1c into swiftlang:main Sep 29, 2021
@ahoppen ahoppen deleted the pr/split-swiftsyntax-c-data-types branch September 29, 2021 18:12
vivekg-ai added a commit to vivekg-ai/swift-build that referenced this pull request Feb 23, 2022
The PR swiftlang/swift#39441 has split the SwiftSyntaxParser.h into two parts - 
* SwiftSyntaxCDataTypes.h
* SwiftSyntaxParser.h

The generated snapshot binaries are missing `SwiftSyntaxCDataTypes.h` header.  This is causing a build failure for a sample using SwiftSyntax on Windows.
compnerd added a commit to compnerd/swift-installer-scripts that referenced this pull request Feb 23, 2022
This repairs the toolchain manifest after swiftlang/swift#39441 which split
the header into two files.  This ensures that both halves are packaged.
vivekg-ai added a commit to vivekg-ai/swift-build that referenced this pull request Feb 23, 2022
The PR swiftlang/swift#39441 has split the SwiftSyntaxParser.h into two parts -
* SwiftSyntaxCDataTypes.h
* SwiftSyntaxParser.h

Include this file SwiftSyntaxCDataTypes.h from release 5.6+
compnerd pushed a commit to compnerd/swift-build that referenced this pull request Feb 23, 2022
* Include SwiftSyntaxCDataTypes.h in snapshot binary

The PR swiftlang/swift#39441 has split the SwiftSyntaxParser.h into two parts -
* SwiftSyntaxCDataTypes.h
* SwiftSyntaxParser.h

Include this file SwiftSyntaxCDataTypes.h from release 5.6+

Add the necessary plumbing via HAVE__INTERNAL_SWIFT_SYNTAX_CTYPES_HEADER
Ensure that this flag is set for the releases 5.6 onwards

Co-authored-by: Vivek <[email protected]>
compnerd added a commit to swiftlang/swift-installer-scripts that referenced this pull request Feb 23, 2022
This repairs the toolchain manifest after swiftlang/swift#39441 which split
the header into two files.  This ensures that both halves are packaged.
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.

1 participant