Carthage/Carthage

''SignalProducer" causes an Abort, does not result in a readable error

Open

#2.736 aberto em 19 de mar. de 2019

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Swift (1.544 forks)batch import
bughacktoberfest

Métricas do repositório

Stars
 (15.179 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Cartfile none

Carthage Output Running copy-frameworks from within Xcode:

Could not cast value of type 'NSError' (0x1092e9610) to 'Result.NoError' (0x108e19688). Abort trap: 6 /usr/local/bin/carthage copy-frameworks

Actual outcome No framework copied

Expected outcome Framework copied, or a readable error.

In the end I rebuilt the program using Xcode, added my own logs to CopyFrameworks.swift.

I have found I am not the only one who has had this issue. The problem is I copied a "File string" in Xcode to the "File List" pane by mistake. Found that, cut the string, pasted it into "File", and didn't realize that there was still a single File List entry that was empty. This is the root cause (and I tell you how to reproduce it below).

--- PROBLEM CODE in CopyFrameworks.swift --- private func scriptInputFileLists() -> SignalProducer<String, CarthageError> { switch getEnvironmentVariable("SCRIPT_INPUT_FILE_LIST_COUNT") { case .success(let count): if let count = Int(count) { return SignalProducer<Int, CarthageError>(0..<count) .attemptMap { getEnvironmentVariable("SCRIPT_INPUT_FILE_LIST_($0)") } .flatMap(.merge) { fileList -> SignalProducer<String, CarthageError> in let fileListURL = URL(fileURLWithPath: fileList, isDirectory: true) // points to the project directory - not a file - when there is an empty FileList string return SignalProducer<String, NSError>(result: Result(catching: { try String(contentsOfFile: fileList) }))

--- Reproduce ---

Take any simple Xcode project that has a copy-frameworks run script - a working one with a File entry, not a FileList entry.

  1. open the Build Phase Run Script, and copy the File path string into the FileList pane.
  2. Double click on the FileList entry you just added, and hit delete to remove the string.
  3. See a bunch of lines under FileList. Click on the top one - it should take "focus" but its empty.
  4. Try to build the project.

Result - Failure, copy frameworks fails, but there is no error string just the "Abort trap 6"

Guia do colaborador