Skip to content

Refactor ModuleAliasTracker - #10357

Draft
bripeticca wants to merge 8 commits into
swiftlang:mainfrom
bripeticca:modulealias-refactor
Draft

bripeticca wants to merge 8 commits into
swiftlang:mainfrom
bripeticca:modulealias-refactor

Conversation

@bripeticca

@bripeticca bripeticca commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10084

Update and improve the current implementation of ModuleAliasTracker for better readability, and optimizing memoized results to avoid re-computation of transitively dependent modules that resulted in an exponential increase in runtime.

WIP -- Currently fixing test failures by addressing edge cases in the refactored implementation. See ModuleAliasTracker2.
Also some heavy cleaning is still needed 😄

* cleanup current implementation
* Proposed alias algorithm that handles name collisions
* Consider closest reachable modules when resolving for
  applied alias names
* Resolve for conflicting alias names for a module that
  consumes same-named modules transitively
- run proposed alias stage first, noting every affected module
  that would need to be aware of some dependency module's
  aliasing
- for each set of proposed aliases, determine the criteria that
  makes an alias eligible to be recorded for a consuming module
- add design doc explaining the motivation behind the refactor
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.

Evaluate the existing module aliasing infrastructure as a foundational piece to support multiple majors

1 participant