Skip to content

infer failed in Xcode9: infer xcodebuild output error - *** Infer needs a working compilation command to run #759

@tianshunjian

Description

@tianshunjian

My project is created by Objective-C. And infer v0.12.0 was run successfully for my project in xcode 8 yesterday. Today I update my xcode to xcode 9, use some APIs in iOS 11, and update infer to v0.12.1.
Then when I run infer v0.12.1 on Xcode 9 with iOS 11 and LLVM v9.0.0 using the following command:

infer -- xcodebuild -workspace myProject.xcworkspace -scheme myProject -configuration Debug -sdk iphonesimulator

I got the following results:

Build Succeeded
Starting translating 463 files 

*** ERROR: Failed to execute compilation command. Output:
clang: error: cannot specify -o when generating multiple output files
*** Infer needs a working compilation command to run.

..MANY OF THESE ERRORS...then...

...
*** ERROR: Failed to execute compilation command. Output:
clang: error: cannot specify -o when generating multiple output files
*** Infer needs a working compilation command to run.
..

Nothing to compile. Try running `xcodebuild -workspace myProject.xcworkspace -scheme myProject -configuration Debug -sdk iphonesimulator clean` first.

There was nothing to analyze.

Activity

Kaspik

Kaspik commented on Sep 29, 2017

@Kaspik

The same issue here.

Objective-C project.

tianshunjian

tianshunjian commented on Sep 30, 2017

@tianshunjian
Author

@jvillard Any advice will be appreciated so much

Kaspik

Kaspik commented on Oct 2, 2017

@Kaspik

@dulmarod Hey, any ideas what's happening here on new XCode or if current master (source) version has fixed this? Thanks!

jvillard

jvillard commented on Oct 3, 2017

@jvillard
Contributor

There's a chance that the current master fixes this since it ships with a newer clang (5.0) than the 0.12.1 release. I'm not sure how to reproduce this locally to check so it would be great if you could try on your end. Let me know if you need any help with that.

kaelinda

kaelinda commented on Oct 12, 2017

@kaelinda

The same issue here.

IanLuo

IanLuo commented on Oct 18, 2017

@IanLuo

same here, swift project

ljfantin

ljfantin commented on Oct 18, 2017

@ljfantin

the same issue.
ObjC project

tianshunjian

tianshunjian commented on Oct 24, 2017

@tianshunjian
Author

@jvillard I tried infer 0.12.1 with clang 6.0, however the same issue is still there.

jvillard

jvillard commented on Oct 24, 2017

@jvillard
Contributor

Please try the new 0.13.0 release and let me know if the issue is still there: https://github.com/facebook/infer/releases/tag/v0.13.0

It's not yet in Homebrew but should be soon.

@tianshunjian 0.12.1 is the one that ships with an older clang.

tianshunjian

tianshunjian commented on Oct 24, 2017

@tianshunjian
Author

@jvillard thanks very much

StefanoBiasu

StefanoBiasu commented on Oct 24, 2017

@StefanoBiasu

Tried version 0.13.

After a clean of the project, running infer run with option --keep-going

infer run --keep-going -- xcodebuild -workspace < workspace > -scheme < scheme > -destination "platform=iOS Simulator,name=iPad Air" clean build

I got many issues:

Error: the following clang command did not run successfully:
'/usr/local/lib/infer/facebook-clang-plugins/clang/install/bin/clang' "@/var/folders/l2/j0r5rdh13yz3qmz97l5zj2h80000gp/T/clang_command_b483e4.txt"

and then

Nothing to compile. Try running xcodebuild -workspace <workspace> -scheme <scheme> -destination platform=iOS Simulator,name=iPad Air clean first.
There was nothing to analyze.

lizuba

lizuba commented on Nov 2, 2017

@lizuba

@jvillard the same issue with StefanoBiasu

jvillard

jvillard commented on Nov 3, 2017

@jvillard
Contributor

Any project I can try to reproduce this on?

Can you try passing --no-xcpretty to infer and see if that helps?

Error: the following clang command did not run successfully:
'/usr/local/lib/infer/facebook-clang-plugins/clang/install/bin/clang' "@/var/folders/l2/j0r5rdh13yz3qmz97l5zj2h80000gp/T/clang_command_b483e4.txt"

What was the error? Can you paste the contents of the argfile when that happens (here /var/folders/l2/j0r5rdh13yz3qmz97l5zj2h80000gp/T/clang_command_b483e4.txt).

tianshunjian

tianshunjian commented on Nov 6, 2017

@tianshunjian
Author

@jvillard I tried infer 0.13.0 installed by Homebrew, and the same issue with StefanoBiasu is there. I run the command

infer --keep-going -- xcodebuild -workspace SohuLive.xcworkspace -scheme SohuLiveSDK-Video -configuration Debug -sdk iphonesimulator

then I got the following results:

▸ Build Succeeded
Starting translating 657 files
error error error: : : error reading '/Users/alien/Library/Developer/Xcode/DerivedData/SohuLive-ghdkpzrqqcwsfodvmauljdvdpvlo/Index/DataStore'error reading '/Users/alien/Library/Developer/Xcode/DerivedData/SohuLive-ghdkpzrqqcwsfodvmauljdvdpvlo/Index/DataStore'error reading '/Users/alien/Library/Developer/Xcode/DerivedData/SohuLive-ghdkpzrqqcwsfodvmauljdvdpvlo/Index/DataStore'


error: error reading '/Users/alien/Library/Developer/Xcode/DerivedData/SohuLive-ghdkpzrqqcwsfodvmauljdvdpvlo/Index/DataStore'
1 error generated.
1 error generated.
1 error generated.
1 error generated.
ERROR RUNNING CAPTURE: Bi_inbuf.End_of_input
Raised at file "src/bi_inbuf.ml", line 49, characters 6-24
Called from file "src/bi_io.ml" (inlined), line 508, characters 12-35
Called from file "atd/clang_ast_b.ml", line 27505, characters 7-24
Called from file "clang/Capture.ml", line 48, characters 8-39
Called from file "clang/Capture.ml" (inlined), line 93, characters 6-35
Called from file "clang/Capture.ml", line 157, characters 26-73

Error: the following clang command did not run successfully:
  '/usr/local/Cellar/infer/0.13.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang' "@/var/folders/nz/q5nqx70930b0b1vszw0v4qm80000gn/T/clang_command_63740c.txt"
ERROR RUNNING CAPTURE: Bi_inbuf.End_of_input
Raised at file "src/bi_inbuf.ml", line 49, characters 6-24
Called from file "src/bi_io.ml" (inlined), line 508, characters 12-35
Called from file "atd/clang_ast_b.ml", line 27505, characters 7-24
Called from file "clang/Capture.ml", line 48, characters 8-39
Called from file "clang/Capture.ml" (inlined), line 93, characters 6-35
Called from file "clang/Capture.ml", line 157, characters 26-73

and lots of those, finally I got "No issues found".

And this is the log file
logs.txt

3 remaining items

jvillard

jvillard commented on Nov 6, 2017

@jvillard
Contributor

Thanks all for testing. By default infer pipes xcodebuild output to xcpretty to get a compilation database. --no-xcpretty makes infer use a different integration that works by having xcodebuild call infer directly instead of calling clang. The latter used to be more fragile, but now it looks like it's the other way around.

The xcpretty-based integration should be fixed, but in the meantime please use the --no-xcpretty workaround.

StefanoBiasu

StefanoBiasu commented on Nov 16, 2017

@StefanoBiasu
dulmarod

dulmarod commented on Nov 16, 2017

@dulmarod
Contributor

Hi @tefanoBiasu, the options are available in infer --help. The help is very comprehensive, it's work getting familiar with the different options.

StefanoBiasu

StefanoBiasu commented on Nov 16, 2017

@StefanoBiasu
TimorYang

TimorYang commented on Jan 6, 2018

@TimorYang

@jvillard I tried it the way you offered it, but it didn't work, just printed it.
0.13.0
log:

TimorYangdeMBP:AllInOne_IOS TimorYang$ infer --keep-going --no-xcpretty -- xcodebuild -workspace AllInOne.xcworkspace -scheme AllInOne -configuration Debug -sdk iphonesimulator
Capturing in xcodebuild mode...
argument -o/--out: invalid decode value: u'/Users/TimorYang/Documents/\u4f17\u5305/AllInOne_IOS/infer-out'

/usr/local/Cellar/infer/0.13.0/libexec/bin/infer --keep-going --no-xcpretty -- xcodebuild -workspace AllInOne.xcworkspace -scheme AllInOne -configuration Debug -sdk iphonesimulator
Infer version v0.13.0
Copyright 2009 - present Facebook. All Rights Reserved.
Usage: infer command [options]
See infer --help for more information.

Command does not exist

lizuba

lizuba commented on Jan 6, 2018

@lizuba

哥们 你路径中是有中文么 换个英文路径看看@TimorYang

TimorYang

TimorYang commented on Jan 8, 2018

@TimorYang

@lizuba 好的,谢谢.

crespoxiao

crespoxiao commented on Mar 21, 2018

@crespoxiao

interesting

liumingzhi

liumingzhi commented on Jul 15, 2018

@liumingzhi

Internal Error: /usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py
-j 4 --project-root /Users/mingzhi.liu/Desktop/工程1/lianjia_ios_platc
--out /Users/mingzhi.liu/Desktop/工程1/lianjia_ios_platc/infer-out --
xcodebuild -workspace LJShell.xcworkspace -scheme LJShell -configuration
Debug -sdk iphonesimulator -arch i386:
exited with code 1
Error backtrace:
Raised at file "base/Die.ml" (inlined), line 25, characters 6-36
Called from file "base/Logging.ml", line 314, characters 58-80
Called from file "integration/Driver.ml", line 159, characters 2-16
Called from file "integration/Driver.ml", line 280, characters 6-420
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

gearcapitan

gearcapitan commented on Apr 3, 2019

@gearcapitan

mexico5dii_08114_1_6x7

gearcapitan

gearcapitan commented on Apr 3, 2019

@gearcapitan

I have the same problem. @liumingzhi

NameOfSelf

NameOfSelf commented on May 29, 2019

@NameOfSelf

The same problem here. Infer version -- 0.15.0 @liumingzhi
Internal Error: /usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py
-j 8 --project-root /Users/guwei --out /Users/guwei/infer-out -- xcodebuild
-workspace ios_hello.xcodeproj -scheme ios_hello -configuration Debug -sdk
iphonesimulator:
exited with code 66
Error backtrace:
Raised at file "base/Die.ml" (inlined), line 25, characters 6-36
Called from file "base/Logging.ml", line 314, characters 58-80
Called from file "integration/Driver.ml", line 159, characters 2-16
Called from file "integration/Driver.ml", line 280, characters 6-420
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jvillard@crespoxiao@IanLuo@ljfantin@liumingzhi

        Issue actions

          infer failed in Xcode9: infer xcodebuild output error - *** Infer needs a working compilation command to run · Issue #759 · facebook/infer