Carthage / Carthage

A simple, decentralized dependency manager for Cocoa
Other
14.93k stars 1.55k forks source link

[Xcode 16.0 Beta] Carthage fails to `xcodebuild archive -showBuildSettings`, mentions `no destinations`. #3375

Open henrik-dmg opened 3 weeks ago

henrik-dmg commented 3 weeks ago

Cartfile

github "CocoaLumberjack/CocoaLumberjack"

Carthage Output

*** Fetching CocoaLumberjack
*** Checking out CocoaLumberjack at "3.8.5"
*** xcodebuild output can be found in /var/folders/4n/hzc7z9y54g3dmn6204bg0lfm0000gq/T/carthage-xcodebuild.6LK8Jt.log
*** Skipped downloading CocoaLumberjack binary due to the error:
    "Bad credentials"
A shell task (/usr/bin/xcrun xcodebuild -project /Users/hpanhans/Developer/CocoaLumberjackDebug/Carthage/Checkouts/CocoaLumberjack/Tests/Tests.xcodeproj -scheme iOS\ Tests -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -showBuildSettings -skipUnavailableActions) failed with exit code 6:
2024-06-11 14:40:27.934 xcodebuild[99335:9919534] Writing error result bundle to /var/folders/4n/hzc7z9y54g3dmn6204bg0lfm0000gq/T/ResultBundle_2024-11-06_14-40-0027.xcresult
xcodebuild: error: Found no destinations for the scheme 'iOS Tests' and action archive.
2024-06-11 14:40:29.049 xcodebuild[99335:9919534] Writing error result bundle to /var/folders/4n/hzc7z9y54g3dmn6204bg0lfm0000gq/T/ResultBundle_2024-11-06_14-40-0029.xcresult
2024-06-11 14:40:29.049 xcodebuild[99335:9919534] *** -[__NSCFConstantString stringByAppendingPathExtension:]: cannot append extension 'xcactivitylog' to path ''
2024-06-11 14:40:29.072 xcodebuild[99335:9919534] [MT] DVTAssertions: ASSERTION FAILURE in DVTFrameworks/DVTFoundation/FilePaths/DVTFilePath.m:602
Details:  string should be a string, but it is nil
Object:   <DVTFilePath>
Method:   +_filePathForParent:pathString:
Thread:   <_NSMainThread: 0x600000114280>{number = 1, name = main}
Hints:

Backtrace:
  0   -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   +[DVTFilePath _filePathForParent:pathString:] (in DVTFoundation)
  4   -[DVTFilePath filePathForRelativePathString:] (in DVTFoundation)
  5   -[IDESchemeActionResult setLocalResultDirectoryFilePath:] (in IDEFoundation)
  6   -[IDESchemeActionRecord setLocalRecordDirectoryFilePath:] (in IDEFoundation)
  7   __48-[IDESchemeActionsInvocationRecord setFilePath:]_block_invoke (in IDEFoundation)
  8   __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ (in CoreFoundation)
  9   -[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:] (in CoreFoundation)
 10   -[IDESchemeActionsInvocationRecord setFilePath:] (in IDEFoundation)
 11   -[Xcode3CommandLineBuildTool saveResultBundleForError:triageWithSchemeTask:error:] (in Xcode3Core)
 12   -[Xcode3CommandLineBuildTool _printError:schemeTask:andFailWithCode:] (in Xcode3Core)
 13   -[Xcode3CommandLineBuildTool _printErrorString:andFailWithCode:] (in Xcode3Core)
 14   -[Xcode3CommandLineBuildTool _showBuildSettings] (in Xcode3Core)
 15   -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
 16   XcodeBuildMain (in libxcodebuildLoader.dylib)
 17   -[XcodebuildPreIDEHandler loadXcode3ProjectSupportAndRunXcode3CommandLineBuildToolWithArguments:] (in xcodebuild)
 18   -[XcodebuildPreIDEHandler runWithArguments:] (in xcodebuild)
 19   main (in xcodebuild)
 20   start (in dyld)

Actual outcome Carthage fails to build CocoaLumberjack because it seemingly tries to build an iOS unit test scheme that has no run destinations (project Tests/Tests.xcodeproj in CocoaLumberjack repo)

Expected outcome Carthage should build CocoaLumberjack correctly

jdhealy commented 3 weeks ago

[!NOTE]
Put up a commit. Commit description details more. Try it out (at one’s own discretion) with brew uninstall carthage; brew install --head carthage. ℹ️ℹ️ℹ️

How we researched this (historical info from mid-2024.) Going to look into this¹, drawing context (first off) from: > [xcodebuild · Release Notes Xcode 16A5171c · Resolved Issues](https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#xcodebuild) Fixed an issue where xcodebuild silently selects the first compatible run destination when it fails to match the destination specifier provided by the user. (112043381) **⑴** Probably involves me filing in Feedback Assistant. But if I find success with 'modify the carthage code'-based options, I may post a prototype carthage homebrew formula.
jdhealy commented 3 weeks ago

@henrik-dmg just to be thorough in asking questions — any chance the iOS platform had not yet been installed when this run happened?

Sometimes there's a window like:

Screenshot 2024-06-11 at 7 38 55 AM

[!NOTE]
Help us grab debugging info: as soon as you first see the above issue, if you were already planning to download the iOS platform (sometime colloquially called iOS SDK), then run and grab the following:

$ /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild -version | grep version
Build version 16A5171c
$ /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild -downloadPlatform iOS
Downloading iOS 18.0 Simulator (22A5282m): 29.6% (2.51 GB of 8.46 GB)^C
$ : echo ___ nicely the download does not stop with control-C pressed
henrik-dmg commented 3 weeks ago

Thanks for your quick reply. No, the iOS SDK was definitely installed the Xcode 16 Command line Tools were selected

wrutkowski-tyro commented 3 weeks ago

Similar issue here. Platform iOS is specified, Xcode 16 beta 1 and iOS SDK installed, but carthage update Alamofire --platform iOS --use-xcframeworks --no-use-binaries results in:

*** Skipped building Alamofire due to the error:
Dependency "Alamofire" has no shared framework schemes for any of the platforms: iOS
aykutguvendh commented 3 weeks ago

We have a similar issue in our project as well. The specifics:

We run carthage bootstrap --platform iOS --cache-builds --no-use-binaries --use-ssh --use-xcframeworks

 *** Skipped building Quick due to the error:
 Dependency "Quick" has no shared framework schemes for any of the platforms: iOS
 If you believe this to be an error, please file an issue with the maintainers at https://github.com/Quick/Quick/issues/new
 *** Skipped building InputBarAccessoryView due to the error:
 Dependency "InputBarAccessoryView" has no shared framework schemes for any of the platforms: iOS
 If you believe this to be an error, please file an issue with the maintainers at https: //github.com/nathantannar4/InputBarAccessoryView/issues/new
 A shell task (/us/bin/xcrun xcodebuild -project /Users/n.gueven/Projects/pd-mob-bc-ios/Carthage/Checkouts/RxSwift/Rx.codeproj -scheme AlTests-iOS -configuration Debug CODE_SIGNING_REQU
GN_IDENTITY= CARTHAGE=YES archive -showBuildSettings -skipUnavailableActions) failed with exit code 6:
 2024-06-11 14:50:19.285 xcodebuild[23672:195613] Writing error result bundle to /var/folders/dp/v41xtm191zv8kd00tnzlp_t1dh24hm/T/ResultBundle_2024-11-06_14-50-0019. xcresult
 xcodebuild: error: Found no destinations for the scheme 'AllTests-iOS' and action archive.
jdhealy commented 2 weeks ago

Put up a commit. Commit description details more. Try it out (at one’s own discretion) with brew uninstall carthage; brew install --head carthage.

〜 Carthage maintainers will have to restore CI (to test, unit and integration style) before we ship it. Details in the commit description. We have a plan in mind.

wrutkowski-tyro commented 2 weeks ago

@jdhealy I had a go and this is what I'm seeing.

I got an error re unlinking, so I did that and:

Error: carthage 0.39.1 is already installed
To install HEAD, first run:
  brew unlink carthage
> brew unlink carthage
Unlinking /opt/homebrew/Cellar/carthage/0.39.1... 4 symlinks removed.
> brew uninstall carthage; brew install --head carthage
Error: Unexpected method 'appcast' called on Cask adoptopenjdk8.
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
==> Fetching carthage
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/a0299599c065580bb5f9e85482b28d5ed5fa5bfd/Formula/c/car
######################################################################################################################## 100.0%
==> Cloning https://github.com/Carthage/Carthage.git
Cloning into '/Users/wrutkowski/Library/Caches/Homebrew/carthage--git'...
warning: templates not found in /usr/share/git-core/templates
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> make prefix_install PREFIX=/opt/homebrew/Cellar/carthage/HEAD-87fedfb
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/carthage/HEAD-87fedfb: 9 files, 5.7MB, built in 4 minutes 4 seconds
==> Running `brew cleanup carthage`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/wrutkowski/Library/Caches/Homebrew/carthage_bottle_manifest--0.39.1... (8KB)
Removing: /Users/wrutkowski/Library/Caches/Homebrew/carthage--0.39.1... (1.6MB)
> xcode-select -p
/Applications/Xcode_16b1.app/Contents/Developer
> carthage version
0.39.1
> carthage update Alamofire --platform iOS --use-xcframeworks --no-use-binaries
*** Fetching Alamofire
*** Checking out Alamofire at "5.9.1"
*** xcodebuild output can be found in /var/folders/7l/r6n559c94qd1kpmsnxdsnpw80000gr/T/carthage-xcodebuild.nwXwSS.log
*** Skipped building Alamofire due to the error:
Dependency "Alamofire" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/Alamofire/Alamofire/issues/new
henrik-dmg commented 2 weeks ago

@jdhealy following your steps I was able to build CocoaLumberjack using carthage update --use-xcframeworks, thanks! 👍🏼 haven't tested with other frameworks though

einar-notland commented 2 weeks ago

Seems to fail when specifying --platform iOS Doesn't fail when removing this platform parameter, but then it requires all simulators relevant for the specific projects to be installed (tvOS for example).

Something wrong with the platform scheme lookup or something?

jdhealy commented 2 weeks ago

@wrutkowski-tyro yes, great to have you post that feedback (on has no shared framework schemes for any of the platforms: iOS). Thank you!

Helped us find an additional bug 🎉 , which — it being a separate issue — gonna link there and hide the comment to allow folks consuming all no destinations info or additional feedback to scroll quickly.

jdhealy commented 2 weeks ago

@einar-notland, we put up another commit. Good chance we fixed what you’re hitting. Try using the below:

[!NOTE]
Put up a second commit for June. Commit description details more. Try it out (at one’s own discretion) with brew uninstall carthage; brew install --head carthage. ℹ️ℹ️ℹ️

einar-notland commented 2 weeks ago

@jdhealy Thank you so much. The latest commit seems to fix the problems we have seen related to using --platform iOS on Xcode 16 Beta 🙂