Skip to content

[PackageModel] Toolchain: Split SwiftTesting flags between swift comp… #7903

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 21, 2024

…iler and linker

Motivation:

Keeping them together broke Symbol Graph Extract tool because it cannot handle -Xlinker flags.

Modifications:

  • Adjust deriveMacOSSpecificSwiftTestingFlags to produce two arrays - one for swift compiler and one for linker flags.

Result:

extraFlags.swiftCompilerFlags no longer includes -Xlinker flags.

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

I know little about this area of code, but how testable is this?

@xedin
Copy link
Contributor Author

xedin commented Aug 21, 2024

That's what I'm trying to figure out right now :)

…iler and linker

Keeping them together broke Symbol Graph Extract tool because it cannot
handle `-Xlinker` flags.
@xedin xedin force-pushed the dont-include-testing-linker-flags-into-swift-flags branch from 5287c93 to c22a8f3 Compare August 21, 2024 19:46
@xedin xedin requested a review from MaxDesiatov August 21, 2024 19:48
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@xedin
Copy link
Contributor Author

xedin commented Aug 21, 2024

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Aug 21, 2024

@swift-ci please test Windows platform

"-Xlinker", frameworksPath.pathString
]
return (swiftCFlags: [
"-F", frameworksPath.pathString
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this framework search path not also needed for the linker?

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 appears to be sufficient, I tested with commandline tools only and -F + -Xlinker -rpath builds and runs the swift-testing tests without issues.

@xedin xedin merged commit 84ba94a into swiftlang:main Aug 22, 2024
5 checks passed
xedin added a commit to xedin/swift-package-manager that referenced this pull request Aug 22, 2024
swiftlang#7903)

…iler and linker

Keeping them together broke Symbol Graph Extract tool because it cannot
handle `-Xlinker` flags.

- Adjust `deriveMacOSSpecificSwiftTestingFlags` to produce two arrays -
one for swift compiler and one for linker flags.

`extraFlags.swiftCompilerFlags` no longer includes `-Xlinker` flags.

(cherry picked from commit 84ba94a)
xedin added a commit to xedin/swift-package-manager that referenced this pull request Aug 22, 2024
swiftlang#7903)

…iler and linker

Keeping them together broke Symbol Graph Extract tool because it cannot
handle `-Xlinker` flags.

- Adjust `deriveMacOSSpecificSwiftTestingFlags` to produce two arrays -
one for swift compiler and one for linker flags.

`extraFlags.swiftCompilerFlags` no longer includes `-Xlinker` flags.

(cherry picked from commit 84ba94a)
xedin added a commit that referenced this pull request Aug 22, 2024
… compiler and linker (#7907)

- Explanation:

Fixes a bug where keeping them together broke Symbol Graph Extract tool
because it cannot handle `-Xlinker` flags.

- Main Branch PR:
#7903

- Resolves: rdar://134406349

- Risk: Low (This is technically an NFC since it only re-arranging how
to the flags are propagated but doesn't change them).

- Reviewed By: @MaxDesiatov 

- Testing: New tests were added to the test suite.
xedin added a commit to xedin/swift-package-manager that referenced this pull request Aug 23, 2024
… compiler and linker (swiftlang#7907)

- Explanation:

Fixes a bug where keeping them together broke Symbol Graph Extract tool
because it cannot handle `-Xlinker` flags.

- Main Branch PR:
swiftlang#7903

- Resolves: rdar://134406349

- Risk: Low (This is technically an NFC since it only re-arranging how
to the flags are propagated but doesn't change them).

- Reviewed By: @MaxDesiatov

- Testing: New tests were added to the test suite.

(cherry picked from commit 22b41d0)
xedin added a commit that referenced this pull request Aug 24, 2024
…ft… (#7908)

… compiler and linker

- Explanation:

Fixes a bug where keeping them together broke Symbol Graph Extract tool
because it cannot handle `-Xlinker` flags.

- Main Branch PR:
#7903
- 6.0 Branch PR:
#7907

- Resolves: rdar://134406349

- Risk: Low (This is technically an NFC since it only re-arranging how
to the flags are propagated but doesn't change them).

- Reviewed By: @MaxDesiatov

- Testing: New tests were added to the test suite.

(cherry picked from commit 22b41d0)
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