Carthage: Firebase storage binary with "alt=media" parameter fails

Created on 2 Jun 2021  路  3Comments  路  Source: Carthage/Carthage

  • carthage install method: [ ] .pkg, [x] homebrew, [ ] source
  • which carthage: /usr/local/bin/carthage
  • carthage version: 0.38.0
  • xcodebuild -version: 12.4
  • Are you using --no-build? N
  • Are you using --no-use-binaries? N
  • Are you using --use-submodules? N
  • Are you using --cache-builds? Y
  • Are you using --new-resolver? N

Cartfile

binary "https://firebasestorage.googleapis.com/[redacted]/my-framework.json?alt=media" == 1.0.0

Carthage Output

Unable to parse binary-only framework JSON at https://firebasestorage.googleapis.com/[redacted]/my-framework.json?alt=media due to error: specified URL 'media' must be HTTPS

Actual outcome
Carthage is failing to parse the hosted json. Probably related to this change: https://github.com/Carthage/Carthage/compare/0.37.0..0.38.0#diff-6ba99d96beeeef256123068e5ec53b51d71afee6d011edc03f572817c6bc7977R34

Expected outcome
Carthage should run the url without attempting to use alt as another url. Probably should make the query parameter more unique so as to not overlap with existing urls, such as "carthage_alt".

bug

Most helpful comment

That sounds like a good solution to me. Keeps backwards compatibility while fixing the issue.

All 3 comments

Ack, yeah I can see how that's a problem here. I would prefer we don't backtrack and pick a new parameter name, since that'll be confusing to users. What do you think about this?

  1. If an alt= parameter _isn't_ a URL, assume it's part of the first URL and pass it unchanged
  2. Pick a new, more specific parameter (carthage-alt= is fine with me), and if the URL contains it, use it instead of alt URLs.

AFAICT, 1 would fix this situation, and 1 + 2 would allow this library to upload multiple binaries in the future, as needed.

That sounds like a good solution to me. Keeps backwards compatibility while fixing the issue.

@elliottwilliams I took a stab at this, let me know if it's ok: https://github.com/Carthage/Carthage/pull/3196

Was this page helpful?
0 / 5 - 0 ratings