Skip to content

Conversation

aaronsky
Copy link
Contributor

@aaronsky aaronsky commented Apr 15, 2025

  • adds an example of an app with an extension that both link a shared framework consuming Swift code. repros Linker inputs are not deduplicated in Bazel 8, causing linker warnings around duplicate rpaths #2687.
  • introduces a fix wherein entire linker inputs are deduplicated upon subtracting and combining into one linking context. This primarily affects duplicate linker inputs from SwiftToolchainInfo, but could have other effects.
    • This has the potential to affect linker param order, which is meaningful. Reviewers may want to consider this a breaking change.

I would like any reviewers to test the patch out in their own repo before approving, using either Bazel 7 or 8, to help ensure minimal breakage.

@aaronsky aaronsky changed the title repro of #2687: add a new framework to //examples/multi_platform/Buttons that exhibits the failure case Deduplicate linker inputs from non-library linker input deps Apr 16, 2025
@aaronsky aaronsky marked this pull request as ready for review April 16, 2025 14:25
@aaronsky aaronsky changed the title Deduplicate linker inputs from non-library linker input deps Deduplicate linker inputs in merged linking contexts Apr 19, 2025
@aaronsky
Copy link
Contributor Author

I would feel better if CI was passing before landing this. As mentioned above, I need to do more testing of this version of the patch internally as well, once I'm back from vacation.

@aaronsky aaronsky force-pushed the aaronsky/repro-of-duplicate-linker-inputs-in-cc-linking-input branch from 175c531 to 628a698 Compare April 27, 2025 20:15
Copy link
Contributor

@luispadron luispadron left a comment

Choose a reason for hiding this comment

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

This fixed our duplicate link warnings for all our top-level targets! It would be nice to be able to test the link flags for our test cases, but we can add that after

@aaronsky aaronsky enabled auto-merge (squash) April 29, 2025 16:59
@aaronsky aaronsky merged commit 699d5f1 into bazelbuild:master Apr 29, 2025
8 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