oclint: oclint: error: one compiler command contains multiple jobs:

Issue Summary

Seeing a similar issue to #221, where I get an error of oclint: error: one compiler command contains multiple jobs: when trying to run OCLint.

Environment

  • Operation system name and version: macOS 10.12.6
  • OCLint version: 0.12 & 0.13
  • How OCLint is installed: local build? prebuilt binary downloaded from github? homebrew install? others? Tested with local build and prebuilt binary from github.
  • I am also using Xcode 9

Reproduction Steps

Download attached zip file, run build.sh

Sample code

See sample project

Expected Behavior

Should be able to lint.

Actual Behavior

oclint: error: one compiler command contains multiple jobs:

Sample project

https://drive.google.com/file/d/0B7brsNYK8KqpS1BKR0djZE1hbE0/view?usp=sharing

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 36 (2 by maintainers)

Most upvoted comments

It works for me. I using MacOS 10.13, XCode Version 9.0 (9A235), OCLint 0.13.

1.cd current project folder 2.xcodebuild -target Target -configuration Debug -scheme Scheme -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' CLANG_ENABLE_MODULE_DEBUGGING=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=NO COMPILER_INDEX_STORE_ENABLE=NO | tee xcodebuild.log | xcpretty -r json-compilation-database --output compile_commands.json 3.oclint-json-compilation-database -- -max-priority-1 '10' -max-priority-2 '2000' -max-priority-3 '5000' -report-type pmd -o pmd.xml or oclint-json-compilation-database -- -max-priority-1 '10' -max-priority-2 '2000' -max-priority-3 '5000' -report-type html -o pmd.html

I can also confirm that the combination of disabling COMPILER_INDEX_STORE_ENABLE and 0.13 does indeed work for me. Thanks for all your work on OCLint @ryuichis, it’s definitely appreciated 😃

Xcode9, macOS 10.12.6 and oclint 0.13

Using test project and setting COMPILER_INDEX_STORE_ENABLE = NO on project build setting all goes fine.

In my project: Settings COMPILER_INDEX_STORE_ENABLE = NO on all projects (pods and not):

Exit status of command 'cd /___/platform-ios && oclint -report-type=pmd -o=/___/platform-ios/iOS/lib/___/Build/fastlane_workspace/oclint-reports/oclint.xml -list-enabled-rules -rc=LONG_LINE=200 -max-priority-1=10000 -max-priority-2=10000 -max-priority-3=10000 -p /___/platform-ios/iOS/lib/___/Build/fastlane_workspace/test-reports " [...] was 6 instead of 0.

As per http://oclint-docs.readthedocs.io/en/stable/manual/oclint.html means

6 - COMPILATION_ERRORS

But the source code compiles properly …

Let me add that many people tried it and it was useless because the cache of the project in Xcode was not cleared. After modifying the settings, you must clear the cache!!! If you find it useful, put me up and let others see.

xcode缓存清除

I had same issue, COMPILER_INDEX_STORE_ENABLE=NO fixed it for me. My environment is Mac OS X 10.13.3, Xcode 9.2, OCLint version 0.13. Built Sep 18 2017 (10:27:44).

If you are using Cocoa Pods don’t forget to set COMPILER_INDEX_STORE_ENABLE for all pod targets.

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['COMPILER_INDEX_STORE_ENABLE'] = "NO"
        end
    end
end

Any update on this? Still not working on MacOS 10.14.1, Xcode 10.1 with COMPILER_INDEX_STORE_ENABLE=NO set.