[Macros] Add executable compiler plugin support library#1359
Merged
Conversation
e79ecb1 to
f29f3ce
Compare
Member
Author
|
swiftlang/swift#63793 |
f29f3ce to
e275899
Compare
Member
Author
|
@swift-ci Please test |
e275899 to
f302774
Compare
Member
Author
|
@swift-ci Please test |
Member
Author
|
swiftlang/swift#63888 |
f302774 to
1561e76
Compare
Member
Author
|
swiftlang/swift#63888 |
Member
Author
|
@ahoppen Let me know if you have any concern with the |
Member
Author
|
@swift-ci Please test |
473bc7e to
afff5aa
Compare
Member
Author
|
@swift-ci Please test |
70ec0e4 to
9f40b5c
Compare
Member
Author
|
@swift-ci Please test |
ahoppen
reviewed
Feb 27, 2023
|
|
||
| // Local function to expand a member atribute macro once we've opened up | ||
| // the existential. | ||
| func expandMemberAttributeMacro<Node: DeclGroupSyntax>( |
Member
There was a problem hiding this comment.
Couldn’t the content of this just be a trailing closure to _openExistential? Same below.
Member
Author
There was a problem hiding this comment.
089cad0 to
78ef801
Compare
Member
Author
|
swiftlang/swift#63952 |
'SwiftCompilerPlugin' is a helper library to write an executable compiler plugin. Usage: import SwiftCompilerPlugin import SwiftSyntaxMacros @main struct MyPlugin: CompilerPlugin { var providingMacros: [Macro.Type] = [MyMacro.self] } struct MyMacro: ExpressionMacro { ... }
There's no reason to do so, and some how plugin test fails with: ``` dyld: lazy symbol binding failed: can't resolve symbol _swift_task_create in /Users/ec2-user/.../ExamplePlugin because dependent dylib @rpath/libswift_Concurrency.dylib could not be loaded ```
78ef801 to
01c125d
Compare
01c125d to
69230a2
Compare
Member
Author
|
swiftlang/swift#63958 |
Member
Author
|
swiftlang/swift#63958 |
69230a2 to
4f4b873
Compare
Member
Author
|
swiftlang/swift#63958 |
ahoppen
approved these changes
Feb 28, 2023
neonichu
added a commit
to swiftlang/swift-package-manager
that referenced
this pull request
Mar 1, 2023
This adds support for building macros as executables (see swiftlang/swift-syntax#1359). Right now, this requires adding a package dependency on swift-syntax and corresponding product dependencies to the macro itself which makes testing difficult, so `BUILD_MACROS_AS_DYLIBS` is kept as the default mode.
neonichu
added a commit
to swiftlang/swift-package-manager
that referenced
this pull request
Mar 1, 2023
This adds support for building macros as executables (see swiftlang/swift-syntax#1359). Right now, this requires adding a package dependency on swift-syntax and corresponding product dependencies to the macro itself which makes testing difficult, so `BUILD_MACROS_AS_DYLIBS` is kept as the default mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SwiftCompilerPluginis a helper library to write an executable compiler plugin.Usage: