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

[4.0.3] [Carthage] Carthage bootstrap fails to resolve package dependencies of Example.xcodeproj #919

Closed
jhandguy opened this issue Jul 13, 2020 · 18 comments

Comments

@jhandguy
Copy link

jhandguy commented Jul 13, 2020

Regression

Failing version: 4.0.3
Last working version: 4.0.2
Carthage version: 0.35.0

Description

When installing analytics-ios version 4.0.3 via carthage bootstrap --platform iOS, the build fails with the following error:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/****/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Could not resolve package dependencies:

It seems the newly introduced Example project in #915 as part of https://github.com/segmentio/analytics-ios/releases/tag/4.0.3 has introduced this issue.
Reverting in Cartfile.resolved to version 4.0.2 won't reproduce the error.

Logs

A shell task (/usr/bin/xcrun xcodebuild -project /Users/****/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Could not resolve package dependencies:
@migs647
Copy link
Contributor

migs647 commented Jul 13, 2020

@jhandguy FullExampleFlow is only Swift Package Manager compatible. You should not need Carthage with FullExampleFlow. Please continue using CarthageExample for demonstrations on Carthage configuration.

@jhandguy
Copy link
Author

@migs647 I am aware of that and this issue is not about FullExampleFlow, I only tried running carthage bootstrap --platform iOS with github "segmentio/analytics-ios" "4.0.3" inside Cartfile.resolved.
FullExampleFlow seems to be the root cause of the Carthage failure, not the object of this issue.

Can you maybe try running a clean carthage bootstrap --platform iOS with the version 4.0.3 on your end as well?

@dchohfi
Copy link

dchohfi commented Jul 13, 2020

Having same issue when building project in a CI container

@migs647
Copy link
Contributor

migs647 commented Jul 13, 2020

@jhandguy @dchohfi I may need some more context in your setup. If I create a new project with a Cartfile.resolved that contains github "segmentio/analytics-ios" "4.0.3" and execute carthage bootstrap --platform iOS I don't get any errors. Any other setup information would be helpful so I can assist in tracking down the issue.

** Edit ** This was from a fresh project (ie no Carthage cache directory)

@jhandguy
Copy link
Author

@migs647 interesting, could it be related to Carthage itself?
I have the latest version of Carthage on my end (0.35.0) maybe it can only be reproduced using this specific version.

@migs647
Copy link
Contributor

migs647 commented Jul 14, 2020

@jhandguy @dchohfi I'm also on 0.35.0. I also tried --no-use-binaries and --new-resolver, these did not replicate it. I'm out of ideas at this point without being able to replicate this.

@dchohfi
Copy link

dchohfi commented Jul 14, 2020

this is the log the is being printed on my CI:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/semaphore/iOS/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
924 xcodebuild: error: Could not resolve package dependencies:
926 The server SSH fingerprint failed to verify.

It seems to be something weird on Xcode 11 but I couldn't figure out, reverting the version and building in 4.0.2 made it work again.

Don't know if is related, but tried this and din't work too, but the error message was different.
webfactory/ssh-agent#4

A shell task (/usr/bin/xcrun xcodebuild -project /Users/semaphore/iOS/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
888 | xcodebuild: error: Could not resolve package dependencies:
890 | Authentication failed because the credentials were rejected

@jhandguy
Copy link
Author

@dchohfi you're right, this Bitrise issue also seems relevant: https://discuss.bitrise.io/t/xcode-11-resolving-packages-fails-with-ssh-fingerprint/10388.

# Reproducibility
Have an Xcode 11 project that uses Swift Package Manager with private package (like hosted on Bitbucket)

@teodorpenkov
Copy link

Any solution for this one?

@jhandguy
Copy link
Author

@teodorpenkov not really a solution but a workaround, run this before your build step:

for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts

I haven't tried it out myself yet but it seems to have resolved the issue for some people.

@dchohfi
Copy link

dchohfi commented Jul 15, 2020

@jhandguy - I've tried this, gave me another error:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/semaphore/iOS/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
888 | xcodebuild: error: Could not resolve package dependencies:
890 | Authentication failed because the credentials were rejected

But this was inside a CI container, don't know if they are related

@migs647
Copy link
Contributor

migs647 commented Jul 15, 2020

Hi @dchohfi and @jhandguy. I was able to replicate this on our CI and believe we have fixed it. It was related to our example apps using ssh instead of https for SPM.

I'm also curious why Carthage is building our sub-sub projects, but either way this should be fixed with our latest 4.0.4 prerelease.

@dchohfi
Copy link

dchohfi commented Jul 15, 2020

that was amazing @migs647! thank you

@bsneed
Copy link
Contributor

bsneed commented Jul 15, 2020

Seems like this is resolved now, yay!! Please reopen if further issues are identified around this. Thanks @migs647, @dchohfi and @jhandguy ! 🙇‍♂️

@bsneed bsneed closed this as completed Jul 15, 2020
@jhandguy
Copy link
Author

I can confirm the issue is fixed in 4.0.4! 🎉
Thank you for the fast reaction time! 💯

@lluisgerard
Copy link

I'm having a similar issue now with 4.1.0

A shell task (/usr/bin/xcrun xcodebuild -project /Users/alderson/Xcode/apps/notes-ios/Carthage/Checkouts/analytics-ios/Examples/FullExampleFlow/Analytics\ Example.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Could not resolve package dependencies:

@bsneed
Copy link
Contributor

bsneed commented Oct 27, 2020

@lluisgerard @migs647 is looking at this here already. Will write back when we figure out what's up.

@bsneed bsneed reopened this Oct 27, 2020
@migs647
Copy link
Contributor

migs647 commented Oct 27, 2020

@lluisgerard We released 4.1.1 today that should fix your issue. Can you verify please?

https://github.com/segmentio/analytics-ios/releases/tag/4.1.1

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

6 participants