Skip to content

[6.1 🍒] Ignore in-package transitive dependencies when building from non-package textual interface #77702

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

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Nov 19, 2024

Cherry-pick of #77686

This change ensures that when loading some module dependency 'Bar' which has a package-only dependency on 'Foo', only the following clients attempt to resolve/load 'Foo':

  • Source compilation with package-name equal to that of 'Bar'.
  • Textual interface compilation of a 'package' interface with package-name equal to that of 'Bar'.

Ensuring that the following kinds of clients do not attempt to resolve/load 'Foo':

  • Source compilation with package-name different to that of 'Bar'
  • Textual interface compilation of a public or private interface, regardless of package name.

This fixes the behavior where previously compilation of a Swift textual interface dependency 'X' from its public or private interface, with an interface-specified package-name, from a client without a matching package-name, resulted in a lookup of package-only dependencies of modules loaded into 'X'. This behavior is invalid if we are not building from the package textual interface, becuase the module dependency graph is defined by the package name of the source client, not individual module dependency package name. i.e. In-package module dependencies are resolved/loaded only if the parent source compile matches the package name.

Resolves rdar://139979180

…age textual interface

This change ensures that when loading some module dependency 'Bar' which has a package-only dependency on 'Foo', only the following clients attempt to resolve/load 'Foo':
- Source compilation with package-name equal to that of 'Bar'.
- Textual interface compilation of a *'package'* interface with package-name equal to that of 'Bar'.

Ensuring that the following kinds of clients do not attempt to resolve/load 'Foo':
- Source compilation with package-name different to that of 'Bar'
- Textual interface compilation of a public or private interface, regardless of package name.

This fixes the behavior where previously compilation of a Swift textual interface dependency 'X' from its public or private interface, with an interface-specified package-name, from a client without a matching package-name, resulted in a lookup of package-only dependencies of modules loaded into 'X'. This behavior is invalid if we are not building from the package textual interface, becuase the module dependency graph is defined by the package name of the source client, not individual module dependency package name. i.e. In-package module dependencies are resolved/loaded only if the parent source compile matches the package name.

Resolves rdar://139979180
@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.1 labels Nov 19, 2024
@artemcm artemcm requested a review from nkcsgexi November 19, 2024 16:14
@artemcm artemcm requested a review from a team as a code owner November 19, 2024 16:14
@artemcm
Copy link
Contributor Author

artemcm commented Nov 19, 2024

@swift-ci test

@artemcm artemcm enabled auto-merge November 19, 2024 16:15
@shahmishal
Copy link
Member

@swift-ci test

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Nov 20, 2024

@swift-ci test

@artemcm artemcm merged commit f9424ce into swiftlang:release/6.1 Nov 21, 2024
5 checks passed
@artemcm artemcm deleted the 61_NoInPackageDepsForNonPackageInterface branch November 21, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants