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

I can't install Bugsnag on Carthage + Xcode11 #418

Closed
marcelosalloum opened this issue Oct 4, 2019 · 17 comments · Fixed by #423
Closed

I can't install Bugsnag on Carthage + Xcode11 #418

marcelosalloum opened this issue Oct 4, 2019 · 17 comments · Fixed by #423
Labels
bug Confirmed bug released This feature/bug fix has been released

Comments

@marcelosalloum
Copy link

marcelosalloum commented Oct 4, 2019

Description

Bugsnag won't install using XCode 11 + Carthage

Environment

Library versions:

  • Bugsnag version (from your Podfile, Podfile.lock, or elsewhere): 5.22.7
  • Carthage version (if any): 0.33
  • iOS/tvOS/macOS version(s): MacOSX 10.15 Catalina

Example code snippet

carthage update bugsnag-cocoa --no-use-binaries --cache-builds --platform iOS

Result

(1 failure)
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -workspace /Users/marcelosalloum/Workspace/persona-ios/Carthage/Checkouts/bugsnag-cocoa/OSX.xcworkspace -scheme Bugsnag -configuration Release -derivedDataPath /Users/marcelosalloum/Library/Caches/org.carthage.CarthageKit/DerivedData/11.0_11A420a/bugsnag-cocoa/v5.22.7 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/g_/x9df0hls2k51twkgxtx68k9w0000gn/T/bugsnag-cocoa SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/marcelosalloum/Workspace/persona-ios/Carthage/Checkouts/bugsnag-cocoa)

This usually indicates that project itself failed to compile.
@Sidetalker
Copy link

+1 Same issue here, I'm looking into a fix.

The xcodebuild log ends with:

ld: framework not found Cocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@Sidetalker
Copy link

Sidetalker commented Oct 4, 2019

For the time being, I've just reverted the commit that broke Carthage. No PR because this is not a real "fix" - https://github.com/Sidetalker/bugsnag-cocoa

@mattdyoung
Copy link

Hi @marcelosalloum @Sidetalker

Thanks, we'll take a look at what's required for the proper fix for this.

@mattdyoung mattdyoung added the bug Confirmed bug label Oct 7, 2019
@EmDee
Copy link

EmDee commented Oct 7, 2019

I'm seeing a similar/same error. What is weird is that Carthage wants to build for OSX although I specified --platform iOS.

Here's the error output:

*** Building scheme "Bugsnag" in OSX.xcworkspace
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -workspace /Users/user/Developer/app-ios/Carthage/Checkouts/bugsnag-cocoa/OSX.xcworkspace -scheme Bugsnag -configuration Release -derivedDataPath /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/bugsnag-cocoa/v5.22.7 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/yg/bkvgkyvx5zzct0bxx1zhn9t80000gp/T/bugsnag-cocoa SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/user/Developer/app-ios/Carthage/Checkouts/bugsnag-cocoa)

@Sidetalker
Copy link

Yep @EmDee, that’s consistent with what I’m seeing. From what I can tell the project started using a common xcconfig that covered all the platforms so Carthage can no longer tell what’s an iOS workspace.

@bugsnagbot bugsnagbot added the scheduled Work is starting on this feature/bug label Oct 8, 2019
@EmDee
Copy link

EmDee commented Oct 8, 2019

By the way: I can install v5.22.6 just fine.

@marcelosalloum
Copy link
Author

By the way: I can install v5.22.6 just fine.

Thanks a lot, @EmDee! That works for me too.

For the time being, I've just reverted the commit that broke Carthage. No PR because this is not a real "fix" - https://github.com/Sidetalker/bugsnag-cocoa

Your branch hasn't worked for me, @Sidetalker. I'm on Xcode 11 + MacOS 10.15 Beta 10

@kattrali
Copy link
Contributor

kattrali commented Oct 8, 2019

This is very weird; all of the Xcode projects were updated to be multi-platform, with the intent to:

  1. Allow people to integrate into an environment with cross-platform dependencies
  2. Eventually consolidate to just one project in the repo - I kept the existing ones around for now to avoid needing to update the integration instructions for people using Carthage and manual installation.

If I open OSX.xcworkspace, the framework target can be added to any platform, so I'm trying to figure out why Carthage is building for macOS.

@kattrali
Copy link
Contributor

kattrali commented Oct 8, 2019

Now that I say that, I think I figured it out. This is working for me, can someone verify that my fix works for them by adding this to their cartfile:

github "bugsnag/bugsnag-cocoa" "kattrali/carthage-build-fix"

@marcelosalloum
Copy link
Author

Now that I say that, I think I figured it out. This is working for me, can someone verify that my fix works for them by adding this to their cartfile:

github "bugsnag/bugsnag-cocoa" "kattrali/carthage-build-fix"

@kattrali, this fix has entered a build loop for me:
Screen Shot 2019-10-08 at 14 34 55
I'm new on Carthage, so I'm not sure what may be the issue there.

@Sidetalker
Copy link

By the way: I can install v5.22.6 just fine.

Thanks a lot, @EmDee! That works for me too.

For the time being, I've just reverted the commit that broke Carthage. No PR because this is not a real "fix" - https://github.com/Sidetalker/bugsnag-cocoa

Your branch hasn't worked for me, @Sidetalker. I'm on Xcode 11 + MacOS 10.15 Beta 10

@marcelosalloum you should specify the "master" branch as I haven't bothered to update the release tag. Your Cartfile entry should be github "Sidetalker/bugsnag-cocoa" "master". I haven't tested this on Catalina, but it should behave the same.

@kattrali
Copy link
Contributor

kattrali commented Oct 8, 2019

I'm new on Carthage, so I'm not sure what may be the issue there.

Try removing ~/Library/Caches/org.carthage.CarthageKit/? Sometimes the cache is stale.

@Sidetalker Sidetalker mentioned this issue Oct 8, 2019
12 tasks
@Sidetalker
Copy link

Sidetalker commented Oct 8, 2019

@kattrali I've made some updates to your changes so we no longer build all three frameworks when carthage --platform XXX is used and opened a PR against your branch (#419).

My changes update scheme names to make it obvious what is building and set the SUPPORTED_PLATFORMS for each of the projects so that Carthage knows which ones to build.

@marcelosalloum
Copy link
Author

I'm new on Carthage, so I'm not sure what may be the issue there.

Try removing ~/Library/Caches/org.carthage.CarthageKit/? Sometimes the cache is stale.

Ok @kattrali, cleaning the cache and updating carthage did the trick, which means this update command is working for me:
github "bugsnag/bugsnag-cocoa" "kattrali/carthage-build-fix"

kattrali added a commit that referenced this issue Oct 10, 2019
Fixes an issue mentioned in #418 where the Bugsnag project would build
multiple times, once for each architecture.
kattrali added a commit that referenced this issue Oct 10, 2019
Fixes an issue mentioned in #418 where the Bugsnag project would build
multiple times, once for each architecture.
@kattrali
Copy link
Contributor

Thanks for checking, @marcelosalloum.

I've made some updates to your changes so we no longer build all three frameworks when carthage --platform XXX is used and opened a PR against your branch (#419).

Thanks for this, @Sidetalker. The changeset resolves the issue, but due to the way that some people integrate (vendoring/submoduling bugsnag-cocoa and adding the project to theirs), I can't change the target name or project locations without first seeing just how breaking it will be and making the appropriate upgrade guide or major version. I've made an near-term fix in #423 to get Carthage working again, though it does still build three times. I've also updated the automated tests to ensure Carthage builds succeed on every platform so this doesn't happen again.

I am working on a slightly different approach in the branch kattrali/fix-carthage-building-multiple-times which instead removes the different projects in favor of one in the root of the repository, which resolves the build repeat issue as well as reducing risk of Carthage builds for the different platforms being different from counterparts using other packaging systems.

@Sidetalker
Copy link

Great, thanks for the update @kattrali!

@mattdyoung
Copy link

Released in v5.22.9

@mattdyoung mattdyoung added released This feature/bug fix has been released and removed scheduled Work is starting on this feature/bug labels Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug released This feature/bug fix has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants