Skip to content
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

Rewrite XCFramework slice selection using plist metadata #11229

Merged

Conversation

igor-makarov
Copy link
Contributor

@igor-makarov igor-makarov commented Mar 2, 2022

This PR modifies the XCFramework selection script in such a way that it uses the actual Info.plist values of the XCF to determine slice eligibility.

I've seen a while ago that the script was using directory names for differentiation and I had a feeling that this is not entirely correct.

I've added 2 new examples to the build and verified that they are testing the right stuff:

  • Excluded-Archs-Example - tests the common exclusion method of EXCLUDED_ARCHS when a company doesn't want to make an XCFramework for all the platforms.
  • Oddly-Named-XCF-Slices-Example - has slices with odd names. This would not have worked in the previous script.

note: integration spec PR CocoaPods/cocoapods-integration-specs#332

@igor-makarov
Copy link
Contributor Author

@amorde can you tell me if you have any concrete examples of oddly named slices?

@igor-makarov
Copy link
Contributor Author

going to remove the change to error

# We also match _armv7$ to handle that case.
local target_arch_regex="[_\\-]${target_arch}([\\/_\\-]|$)"
if ! [[ "${paths[$i]}" =~ $target_arch_regex ]]; then
if ! echo "${slice_archs}" | tr " " "\\n" | grep -F -q -x "$target_arch"; then
Copy link
Member

Choose a reason for hiding this comment

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

do you have some context on this change? it's unclear to me what this is doing. is it splitting the archs into separate lines and then using grep to see if any lines match?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amorde exactly - it's an internet-suggested way to check that $target_arch is in the $slice_archs list (which is space-separated).

@dnkoutso dnkoutso added this to the 1.12.0 milestone Mar 3, 2022
@dnkoutso
Copy link
Contributor

dnkoutso commented Mar 3, 2022

I would not do this in the 1.11 branch imo. Should we consider 1.12?

@igor-makarov
Copy link
Contributor Author

I wanted it for 1.11 because it's not adding new functionality and it's making the behavior more correct.

(Also, since we don't have a release schedule, it's hard to know when 1.12 will actually ship)

WDYT @dnkoutso?

@dnkoutso
Copy link
Contributor

dnkoutso commented Mar 7, 2022

OK we can try it. It is true there is never a release schedule

@dnkoutso dnkoutso modified the milestones: 1.12.0, 1.11.3 Mar 7, 2022
@igor-makarov
Copy link
Contributor Author

Merged CocoaPods/cocoapods-integration-specs#332 - now merging this.

@igor-makarov igor-makarov merged commit 44aed84 into CocoaPods:1-11-stable Mar 7, 2022
@igor-makarov igor-makarov deleted the xcframeworks-slice-select branch March 7, 2022 21:25
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.

None yet

3 participants