-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix registry package swizzling when package name casing differs #8194
Conversation
@swift-ci test |
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.
Thanks for the patch, appreciate the contribution! I just have one small comment.
@swift-ci please test |
@swift-ci test |
Hey @plemarquand 👋 Is there anything blocking the merge of this PR? |
@fortmarek so sorry, this fell off my queue! I've kicked off the windows tests and enabled auto merge. |
@swift-ci test windows |
No worries, thanks for taking a look! 🙇♂️ |
@swift-ci test windows |
@fortmarek CI was down this morning, the windows tests should be running now. |
Fix registry package swizzling when package name casing differs
Motivation:
When swizzling dependencies when running
swift package --replace-scm-with-registry resolve
, package references that have different casing don't get swizzled.You can find an example of this scenario in the Firebase SDK that boils down to:
The
.product(name: "FBLPromises", package: "Promises")
should be swizzled to use thegoogle.promises
identifier, but because of the different casing, it's not.Modifications:
When creating the map for packages to be swizzled, make the key lowercase. When we access the map, we again use a lowercase variant of the package name, so we don't unexpectedly miss an entry because of a different casing.
Result:
Packages with different casing are swizzled when using the
swift package --replace-scm-with-registry resolve
command.