-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[6.1] Fix duplicate modulemap errors with macro and plugin deps (#8472) #8491
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
base: release/6.1
Are you sure you want to change the base?
Conversation
…8472) We were including flags to hook up modulemaps and include files to C library dependencies in macros and plugin tools through to the modules that depend on those. This adds the capability to prune the depth first searches through the dependencies to ensure these are skipped when crossing macro and plugin boundaries.
Cherry picking #8472 |
Also including changes in #8485 |
Had to revert #8485. Will try again. |
// depends on. | ||
for case .module(let dependency, let description) in swiftTarget.recursiveDependencies(using: self) { | ||
// builds against | ||
for case .module(let dependency, let description) in swiftTarget.recursiveLinkDependencies(using: self) { |
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.
the change on main
calls swiftTarget.recursiveDependencies
. Is it intentional to call this recursiveLinkDependencies
?
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.
There is a new change on main to fix to call LinkDeps. This isn't a cherry pick any more, I am fixing both at the same time.
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.
for case .module(let dependency, let description) in swiftTarget.recursiveLinkDependencies(using: self) { | |
for case .module(let dependency, let description) in swiftTarget.recursiveLinkDependencies(using: self) { |
XCTAssertNoDiagnostics(observability.diagnostics) | ||
|
||
let myLib = try XCTUnwrap(plan.targets.first(where: { $0.module.name == "MyLib" })).swift() | ||
XCTAssertFalse(myLib.additionalFlags.contains(where: { $0.contains("-tool")}), "flags shouldn't contain tools items") |
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.
note: the change on branch main
has $0.contains("-tool/include")
. Is it expected that release/6.1
omit the /include
portion of the flag?
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.
Same as above.
The main fix is here: #8524 |
Missing the fix for link dependencies to also capture dependencies from test targets to macros.
@swift-ci please test |
@swift-ci please test windows |
We were including flags to hook up modulemaps and include files to C library dependencies in macros and plugin tools through to the modules that depend on those. This adds the capability to prune the depth first searches through the dependencies to ensure these are skipped when crossing macro and plugin boundaries.