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

Inconsistent extraction-and-overwrite of xcframeworks with identical names from GitHub Release assets. #3367

Open
darkobg opened this issue Mar 12, 2024 · 2 comments

Comments

@darkobg
Copy link

darkobg commented Mar 12, 2024

  • carthage install method: [ ] .pkg, [x] homebrew, [ ] source
  • which carthage: /opt/homebrew/bin/carthage
  • carthage version: 0.39.1
  • xcodebuild -version: Xcode 15.2 Build version 15C500b
  • Are you using --no-build? No
  • Are you using --no-use-binaries? No
  • Are you using --use-submodules? No
  • Are you using --cache-builds? No
  • Are you using --new-resolver? No
  • Are you using --use-xcframeworks? yes

Cartfile

github "airbnb/lottie-ios" ~> 4.4.1

Actual outcome
Whenever I run carthage update lottie-ios --platform iOS --use-xcframeworks I get one of two different variants (it seems that it is alternating every time I run it.
Once I get:
Screenshot 2024-03-12 at 17 15 36
And then next time I run it I get:
Screenshot 2024-03-12 at 17 16 09
and so on...

I have also tried splitting in two steps:
carthage update "$LIBRARY_NAME" --no-build --use-xcframeworks carthage build "$LIBRARY_NAME" --platform iOS --use-xcframeworks
But that didn't help as well, it still switches between the two each time I run it.

Also, a side question - why does it fetch other variants (eg. such as macOS or tvOS) when I have passed --platform iOS?

Thanks in advance.

@jdhealy
Copy link
Member

jdhealy commented Mar 12, 2024

Currently, lottie-ios 4.4.1 lists two assets on the GitHub release.

▼ Assets (4)

Lottie-Xcode-14.1.xcframework.zip 40.2 MB 3 weeks ago

Lottie-Xcode-15.2.xcframework.zip 53.4 MB 3 weeks ago

Source code (zip) 3 weeks ago

Source code (tar.gz) 3 weeks ago

I'd wager that Carthage is downloading both .xcframework.zip assets and extracting-with-overwriting-whats-currently-in-place for both of them.

And when extracting, there's no ordering that Carthage does. So, one Lottie.xcframework remains at the end (sometimes the Xcode-15.2.xcframework.zip one with xros directories, sometimes not.)


〜 For the side question, we don’t modify what vendors put in their xcframeworks (as they might have instructions. or other special content in there) — we just extract them as-is.

that is, assuming the whole xcframework to be extracted as is passes…

that is, assuming the whole xcframework to be extracted as is passes checkFrameworkCompatibility which is mostly localSwiftVersionNumber >= 5.1 && frameworkSwiftVersionNumber >= 5.1 && hasSwiftInterfaceFile == true

…which lottie clearly saw passed for you/your CI.


If there was a feature improvement to Carthage to better handle this: (1) I imagine we wouldn't get rid of the overwriting (2) we'd likely land the change here and here.

〜 I might return here with a PR, lemme think on it.

In the meantime, lemme see if I can find the old 'roll your own simple Carthage fork on homebrew tutorial' — ah, it's here.

@jdhealy jdhealy changed the title Inconsistent output of carthage update Inconsistent extraction-and-overwrite of xcframeworks with identical names from GitHub Release assets. Mar 13, 2024
@jdhealy
Copy link
Member

jdhealy commented Mar 13, 2024

Vending your own 'binary-only framework json and uploaded .zip' for lottie-ios might be an option (probably simpler) too.

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

No branches or pull requests

2 participants