Skip to content

Conversation

@owenv
Copy link
Contributor

@owenv owenv commented Dec 8, 2025

If an executable target is combined with an executable product at the PIF layer, it must retain the target's module name, so that tests which consume it can import the right module name.

@owenv
Copy link
Contributor Author

owenv commented Dec 8, 2025

Closes #9468

@owenv
Copy link
Contributor Author

owenv commented Dec 8, 2025

@swift-ci test

@owenv owenv force-pushed the owenv/main-module branch from 20a0818 to 36cda8e Compare December 9, 2025 17:51
@owenv
Copy link
Contributor Author

owenv commented Dec 9, 2025

@swift-ci test

@owenv
Copy link
Contributor Author

owenv commented Dec 9, 2025

@swift-ci test self hosted

@owenv
Copy link
Contributor Author

owenv commented Dec 9, 2025

@swift-ci test windows

@owenv
Copy link
Contributor Author

owenv commented Dec 9, 2025

@swift-ci test self hosted

@owenv owenv enabled auto-merge (squash) December 10, 2025 17:52
buildSystem: BuildSystemProvider.Kind,
configuration: BuildConfiguration,
) async throws {
try await withKnownIssue(isIntermittent: true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (blocking): can we add a .bug() trait referencing the GitHub issue that track the Windows intermittent failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what IssueWindowsLongPath is for, no? It's marked intermittent so the ongoing work to resolve those issues doesn't trigger "known issue was not recorded" failures

settings[.PRODUCT_NAME] = "$(TARGET_NAME)"
settings[.PRODUCT_MODULE_NAME] = product.c99name
// We must use the main module name here instead of the product name, because they're not guranteed to be the same, and the users may have authored e.g. tests which rely on an executable's module name.
settings[.PRODUCT_MODULE_NAME] = mainModule.c99name
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 a PIFBuilder Test that will validate we don't regress this behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's really important in this case that we ensure packages compile instead of just producing valid PIF, which is why I added the full text fixture above. Otherwise we might generate valid PIF which then fails to compile the user's sources.

@owenv owenv merged commit 8b11e43 into swiftlang:main Dec 11, 2025
42 of 45 checks passed
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.

3 participants