-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Snippet support with SwiftBuild #9089
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
Conversation
@swift-ci test |
What's here looks good, I just have a few follow up questions The proposal says:
It also says:
Right now, PIFBuilder.buildAggregateProject is adding snippets to the "all-including-tests" target AFAICT, which will cause the snippets to build with just |
With the current implementation, Snippets are build when running Also, the
Build Snippets sample``` ++ swift run swift-build --package-path Fixtures/Miscellaneous/Plugins/PluginsAndSnippets --build-system swiftbuild --show-bin-path Building for debugging... [1/1] Write swift-version-7F702FD1CBFC1C8A.txt Build of product 'swift-build' complete! (0.51s) + BIN_DIR=/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/Miscellaneous/Plugins/PluginsAndSnippets/.build/arm64-apple-macosx/Products/Debug + echo 'Binary Directory: /Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/Miscellaneous/Plugins/PluginsAndSnippets/.build/arm64-apple-macosx/Products/Debug' Binary Directory: /Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/Miscellaneous/Plugins/PluginsAndSnippets/.build/arm64-apple-macosx/Products/Debug + swift run swift-package --package-path Fixtures/Miscellaneous/Plugins/PluginsAndSnippets --build-system swiftbuild completion-tool list-snippets Building for debugging... [1/1] Write swift-version-7F702FD1CBFC1C8A.txt Build of product 'swift-package' complete! (0.48s) ContainsMain MySnippet main + swift run swift-package reset --package-path Fixtures/Miscellaneous/Plugins/PluginsAndSnippets Building for debugging... [1/1] Write swift-version-7F702FD1CBFC1C8A.txt Build of product 'swift-package' complete! (0.46s) + ls -lh /Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/Miscellaneous/Plugins/PluginsAndSnippets/.build/arm64-apple-macosx/Products/Debug ls: /Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/Miscellaneous/Plugins/PluginsAndSnippets/.build/arm64-apple-macosx/Products/Debug: No such file or directory + swift run swift-build --package-path Fixtures/Miscellaneous/Plugins/PluginsAndSnippets --build-system swiftbuild Building for debugging... [1/1] Write swift-version-7F702FD1CBFC1C8A.txt Build of product 'swift-build' complete! (0.48s) Building for debugging... 95% [===============================================================================================================================================================================================================-----------] Build complete! (2.37 secs.)
|
02f2f9f
to
4431162
Compare
@swift-ci test |
@swift-ci test macOS |
@swift-ci test windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkhouri and I discussed a bit offline. It looks like --build-snippets wasn't implemented as proposed, so the swift build behavior here mirrors the native build system correctly, we just want to ensure we have test coverage that snippets' dependencies on library targets are being wired up correctly
|
4431162
to
6eb953c
Compare
The linux self hosted pipeline failed as a result of a build timeout during test execution
The windows self-hosted pipeline failed due to known issues. They have been marked @swift-ci test |
@swift-ci test windows |
6eb953c
to
ecaddca
Compare
@swift-ci test self hosted |
ecaddca
to
ad15784
Compare
@swift-ci test self hosted |
ad15784
to
f944f47
Compare
@swift-ci test self hosted |
1 similar comment
@swift-ci test self hosted |
.target( | ||
name: "SwiftBuildSupport", | ||
dependencies: [ | ||
"Build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just taking a quick look, and I see it's still in draft. The "Build" target is the native build system. We shouldn't have SwiftBuildSupport depending on it since it'll be removed eventually. Common things should go in SPMBuildCore.
Snippets are treated as executable targets with the native build system. This change updates the PIF Builder to support snippet, giving Snippet support with the Swift Build build system. Also update the `testCommandPluginCancellation` in PluginTests as it was not properly handling the task cancellations. Depends on: swiftlang/swift-build#775 Fixes: swiftlang#9040 issue: rdar://158630024 issue: rdar://147705448
f944f47
to
8533c40
Compare
@swift-ci test |
@swift-ci test windows |
Snippets are treated as executable targets with the native build system.
This change updates the PIF Builder to support snippet, giving Snippet support with the Swift Build build system.
Depends on: swiftlang/swift-build#775
Depends on: #9115
Fixes: #9040
issue: rdar://158630024
issue: rdar://147705448