Skip to content

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

Closed
@dynamicdispatch

Description

@dynamicdispatch

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

Activity

MichaelKellyTD

MichaelKellyTD commented on Sep 26, 2017

@MichaelKellyTD

Also reported in #441

dynamicdispatch

dynamicdispatch commented on Sep 26, 2017

@dynamicdispatch
Author

Appears this might be related to the new "Enable-Index while Building" setting. By disabling COMPILER_INDEX_STORE_ENABLE I was able to get further in the build process. I now see this:

Compiling /Users/dbeard/Downloads/oclint-test-repository-master/oclint-test-repository/ViewController.m1 error generated.
2 errors generated.
 - Failed
Compiling /Users/dbeard/Downloads/oclint-test-repository-master/oclint-test-repository/AppDelegate.m1 error generated.
2 errors generated.
 - Failed
Compiling /Users/dbeard/Downloads/oclint-test-repository-master/oclint-test-repository/main.m1 error generated.
2 errors generated.
 - Failed
ryuichis

ryuichis commented on Sep 26, 2017

@ryuichis
Contributor

This type of issues, based on its reporting history, always happen during the time from June (WWDC, and developer beta versions) to Sept (the GM is finally available), when many things are in a transition unstable state. I speculate this is the same case this year.

Usually a new OCLint that matches the macOS/Xcode version will fix the issue. The High Sierra was finally officially released yesterday, so I can cut an OCLint release this week.

Before that, you may pre-download from this link https://github.com/oclint/oclint/releases/download/untagged-91b3ee2c6975e6f3ed68/oclint-0.13-x86_64-darwin-17.0.0.tar.gz, and manually set up locally.

dynamicdispatch

dynamicdispatch commented on Sep 26, 2017

@dynamicdispatch
Author

Thanks @ryuichis, I'll test that out. Your link doesn't work for me?

dynamicdispatch

dynamicdispatch commented on Sep 26, 2017

@dynamicdispatch
Author

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 :)

cuixuejiao

cuixuejiao commented on Sep 27, 2017

@cuixuejiao

https://github.com/oclint/oclint/releases/download/untagged-91b3ee2c6975e6f3ed68/oclint-0.13-x86_64-darwin-17.0.0.tar.gz
@ryuichis Does this link correct? 404 not found....

---Update:
The link above does not correct. Disable COMPILER_INDEX_STORE_ENABLE with the latest 0.13 version does work for me. Thank you~

shorbenko

shorbenko commented on Oct 2, 2017

@shorbenko

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
kronenthaler

kronenthaler commented on Oct 3, 2017

@kronenthaler
Contributor

Xcode9, macOS 10.12.6 and oclint 0.13 doesn't work with disabling COMPILER_INDEX_STORE_ENABLE (=NO).
I tried both version published on the Release page (16.7.0 and 17.0.0) without luck.

workhardupc

workhardupc commented on Oct 11, 2017

@workhardupc

same as @kronenthaler, not work

ryzn0518

ryzn0518 commented on Oct 16, 2017

@ryzn0518

same as @kronenthaler , not work again

lubbo

lubbo commented on Oct 16, 2017

@lubbo

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 ...

a13906285175

a13906285175 commented on Oct 31, 2017

@a13906285175

same as @kronenthaler, not work.
Xcode9, macOS 10.12.6 and oclint 0.13 doesn't work with disabling COMPILER_INDEX_STORE_ENABLE (=NO).Set COMPILER_INDEX_STORE_ENABLE for all pod targets.

a13906285175

a13906285175 commented on Oct 31, 2017

@a13906285175

It works after settings COMPILER_INDEX_STORE_ENABLE = NO on all projects (pods and not).But So many "1 error generated" logs ...

WishQi

WishQi commented on Nov 16, 2017

@WishQi

I have the same problem. And the methods above did not work for me.

GipsySh

GipsySh commented on Nov 17, 2017

@GipsySh

macOS Sierra 10.12.6
Xcode: 9.1

I've dowloaded archive from https://github.com/oclint/oclint/releases/download/v0.13/oclint-0.13-x86_64-darwin-17.0.0.tar.gz and then replaced my installed oclint files and folders with the appropriate ones from the archive. But unfortunately the error still occurs.

14 remaining items

Allyess

Allyess commented on Jan 21, 2019

@Allyess

@shorbenko
thanks.

fixed, I set COMPILER_INDEX_STORE_ENABLE=NO, and update my podfile to set COMPILER_INDEX_STORE_ENABLE for all pod targets.
Mac OS:10.14.2 Xcode:10.1 OCLint: 0.13.1

tonight1988

tonight1988 commented on Mar 6, 2019

@tonight1988

Good morning

yousefhamza

yousefhamza commented on Apr 7, 2019

@yousefhamza

Setting COMPILER_INDEX_STORE_ENABLE to NOto the project instead of target worked for me.

How? Setting COMPILER_INDEX_STORE_ENABLE to NO works but you have to make sure to apply it to the target your are building and all the targets depending on it too.

kirinzer

kirinzer commented on Nov 8, 2019

@kirinzer

I have the same problem.
I have tried to set COMPILER_INDEX_STORE_ENABLE to NO, but it does not work for me.
My project have some pod dependencies. So I append -e Pods to oclint-json-compilation-database. And the error is still there. What is the real problem there?

Environment:
Mac os 10.13.6, Xcode:10.1, OCLint:0.13.

iStonesy

iStonesy commented on Jun 7, 2020

@iStonesy

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

Thanks @congpc, also works for me.

binzi56

binzi56 commented on Aug 14, 2020

@binzi56

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缓存清除

ryuichi-assistant

ryuichi-assistant commented on Dec 20, 2020

@ryuichi-assistant

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

kirinzer

kirinzer commented on Dec 28, 2020

@kirinzer

I have the same problem.
I have tried to set COMPILER_INDEX_STORE_ENABLE to NO, but it does not work for me.
My project have some pod dependencies. So I append -e Pods to oclint-json-compilation-database. And the error is still there. What is the real problem there?

Environment:
Mac os 10.13.6, Xcode:10.1, OCLint:0.13.

I solved it by update to the latest version.

ryuichi-assistant

ryuichi-assistant commented on Mar 23, 2021

@ryuichi-assistant

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

ryuichi-assistant

ryuichi-assistant commented on Apr 23, 2021

@ryuichi-assistant

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shadowrider@kronenthaler@congpc@lubbo@workhardupc

        Issue actions

          oclint: error: one compiler command contains multiple jobs: · Issue #462 · oclint/oclint