Skip to content

Conversation

hamishknight
Copy link
Contributor

Match how macros are handled and use the hostBuildTool product type.

rdar://155792370

…rgets

Match how macros are handled and use the `hostBuildTool` product
type.

rdar://155792370
@MaxDesiatov MaxDesiatov changed the title [SwiftBuild] Use hostBuildTool product type for SPM build plugin targets [SwiftBuild] Use hostBuildTool product type for build plugin targets Jul 15, 2025
@@ -39,7 +39,7 @@ extension PackagePIFProjectBuilder {
let pluginTargetKeyPath = try self.project.addTarget { _ in
ProjectModel.Target(
id: pluginModule.pifTargetGUID,
productType: .executable,
productType: .hostBuildTool,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: can we add an automated tests to ensure we don't regress in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I could tell, we don't really have any existing unit tests for this logic, only integration tests, unless I'm overlooking something?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree adding more test coverage would be beneficial.

@pmattos Did you add any tests for the PIF generation in libSwiftPM?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I didn't... only those on the Xcode side of things.

We do have XCBuild PIF tests that we plan to port over eventually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a GitHub issue tracking the work of porting the tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so Sam... but I just added one: #8980

@pmattos
Copy link
Contributor

pmattos commented Jul 24, 2025

@hamishknight Please just wait for that other PR to land, before merging this. Thanks!

@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight enabled auto-merge (squash) August 14, 2025 15:41
@hamishknight hamishknight merged commit 981a620 into swiftlang:main Aug 18, 2025
6 checks passed
@hamishknight hamishknight deleted the host-tool branch August 18, 2025 15:18
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.

5 participants