Skip to content

[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

Open
wants to merge 6 commits into
base: release/6.1
Choose a base branch
from

Conversation

dschaefer2
Copy link
Member

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.

…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.
@dschaefer2 dschaefer2 changed the title Fix duplicate modulemap errors with macro and plugin deps (#8472) [6.1]Fix duplicate modulemap errors with macro and plugin deps (#8472) Apr 11, 2025
@dschaefer2 dschaefer2 changed the title [6.1]Fix duplicate modulemap errors with macro and plugin deps (#8472) [6.1] Fix duplicate modulemap errors with macro and plugin deps (#8472) Apr 11, 2025
@dschaefer2
Copy link
Member Author

Cherry picking #8472

@dschaefer2
Copy link
Member Author

Also including changes in #8485

@dschaefer2
Copy link
Member Author

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) {
Copy link
Contributor

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?

Copy link
Member Author

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.

Choose a reason for hiding this comment

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

Suggested change
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")
Copy link
Contributor

@bkhouri bkhouri Apr 17, 2025

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above.

@dschaefer2
Copy link
Member Author

The main fix is here: #8524

@dschaefer2
Copy link
Member Author

@swift-ci please test

@dschaefer2
Copy link
Member Author

@swift-ci please test windows

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