Errors when running sonar-swift

swift

(Lindsey Harris) #1
  • SonarQube Version: 7.2.1.14109
    I am trying to run sonar-swift on my project and I am getting testing failed because some of my pods aren’t fat files and the following build commands failed:
    PrecompileSwiftBridgingHeader normal x86_64
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

My project does run without problems from XCode.

2018-08-03 11:50:19.292 xcodebuild[47834:952673] Error Domain=IDETestOperationsObserverErrorDomain Code=14 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/q9/0tb75n5n2_n0fdsldcth9vfm0000gq/T/com.apple.dt.XCTest/IDETestRunSession-ABBF8AAF-B1DA-4AB5-A71D-5A86B8DBA461/CCAppTests-87323AD6-4234-4660-B45C-7DDA58236F0A/Session-CCAppTests-2018-08-03_114859-nH075r.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /var/folders/q9/0tb75n5n2_n0fdsldcth9vfm0000gq/T/com.apple.dt.XCTest/IDETestRunSession-ABBF8AAF-B1DA-4AB5-A71D-5A86B8DBA461/CCAppTests-87323AD6-4234-4660-B45C-7DDA58236F0A/Session-CCAppTests-2018-08-03_114859-nH075r.log}

Testing failed:

Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Reachability.framework/Reachability) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Reachability.framework/Reachability-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Reachability.framework/Reachability-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Reachability.framework/Reachability-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Reachability.framework/Reachability: No such file or directory
Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher: No such file or directory
Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac: No such file or directory
Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/SwiftKeychain.framework/SwiftKeychain) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/SwiftKeychain.framework/SwiftKeychain-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/SwiftKeychain.framework/SwiftKeychain-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/SwiftKeychain.framework/SwiftKeychain-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/SwiftKeychain.framework/SwiftKeychain: No such file or directory
Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMOAuth2.framework/GTMOAuth2) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMOAuth2.framework/GTMOAuth2-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMOAuth2.framework/GTMOAuth2-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMOAuth2.framework/GTMOAuth2-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/GTMOAuth2.framework/GTMOAuth2: No such file or directory
Lipo: input file (/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Alamofire.framework/Alamofire) must be a fat file when the -extract option is specified
Lipo: can't open input file: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Alamofire.framework/Alamofire-x86_64 (No such file or directory)
Rm: /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Alamofire.framework/Alamofire-x86_64: No such file or directory
Mv: rename /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Alamofire.framework/Alamofire-merged to /Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Products/Debug-iphonesimulator/Setec.app/Frameworks/Alamofire.framework/Alamofire: No such file or directory
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
'CCServices/CCServices-Swift.h' file not found
Failed to emit precompiled header '/Users/lindsey.vastola.cc/Library/Developer/Xcode/DerivedData/Setec-fdqdibvkiyxvknbpxvaabwfywdph/Build/Intermediates.noindex/PrecompiledHeaders/BridgingHeader-swift_1OTC38S7Q9A3M-clang_2PRDMRFAYJ2QH.pch' for bridging header '/Users/lindsey.vastola.cc/Desktop/Setec/Setec/BridgingHeader.h'
** TEST FAILED **

The following build commands failed:

PrecompileSwiftBridgingHeader normal x86_64
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
-n .
ERROR - Command 'xcodebuild clean build test -workspace Setec.xcworkspace -scheme Setec -configuration Debug -enableCodeCoverage YES -destination platform=iOS Simulator,name=iPhone 8,OS=11.1 -destination-timeout 60' failed with error code: 65

Here are my sonar-project.properties keys:

onar.projectKey=Setec
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=Setec
sonar.projectVersion=2.0
sonar.language = swift

sonar.swift.project=Setec/Setec.xcodeproj
sonar.swift.workspace=Setec/Setec.xcworkspace

sonar.sources=src

sonar.swift.appName=Setec

sonar.sourceEncoding=UTF-8

sonar.swift.appScheme=Setec

sonar.swift.simulator=platform=iOS Simulator,name=iPhone 8,OS=11.1

(Nicolas Bontoux) #2

Hi,

It’s unclear to me why do you think the error is related to SonarQube ? From what I can see it is your build/test cycle which is failing, independently of any SonarQube analysis.