New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dynamicdispatch opened this Issue Sep 26, 2017 · 27 comments

Comments

Projects
None yet
@dynamicdispatch
Copy link

dynamicdispatch commented Sep 26, 2017

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

@MichaelKellyTD

This comment has been minimized.

Copy link

MichaelKellyTD commented Sep 26, 2017

Also reported in #441

@dynamicdispatch

This comment has been minimized.

Copy link
Author

dynamicdispatch commented Sep 26, 2017

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

This comment has been minimized.

Copy link
Contributor

ryuichis commented Sep 26, 2017

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

This comment has been minimized.

Copy link
Author

dynamicdispatch commented Sep 26, 2017

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

@dynamicdispatch

This comment has been minimized.

Copy link
Author

dynamicdispatch commented Sep 26, 2017

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

This comment has been minimized.

Copy link

cuixuejiao commented Sep 27, 2017

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

This comment has been minimized.

Copy link

shorbenko commented Oct 2, 2017

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

This comment has been minimized.

Copy link

kronenthaler commented Oct 3, 2017

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

This comment has been minimized.

Copy link

workhardupc commented Oct 11, 2017

same as @kronenthaler, not work

@diaojunxian

This comment has been minimized.

Copy link

diaojunxian commented Oct 16, 2017

same as @kronenthaler , not work again

@lubbo

This comment has been minimized.

Copy link

lubbo commented Oct 16, 2017

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

This comment has been minimized.

Copy link

a13906285175 commented Oct 31, 2017

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

This comment has been minimized.

Copy link

a13906285175 commented Oct 31, 2017

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

@WishQi

This comment has been minimized.

Copy link

WishQi commented Nov 16, 2017

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

@GipsySh

This comment has been minimized.

Copy link

GipsySh commented Nov 17, 2017

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.

@congpc

This comment has been minimized.

Copy link

congpc commented Nov 21, 2017

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

@CoreOne23

This comment has been minimized.

Copy link

CoreOne23 commented Nov 27, 2017

thanks @congpc .

@stonedauwg

This comment has been minimized.

Copy link

stonedauwg commented Dec 26, 2017

Had same issue, using COMPILER_INDEX_STORE_ENABLE=NO fixed it for me
using MacOS 10.13.2, XCode 9.1, OCLint 0.13

@ryuichi-assistant

This comment has been minimized.

Copy link

ryuichi-assistant commented Feb 21, 2018

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.

@gtatgh

This comment has been minimized.

Copy link

gtatgh commented Mar 7, 2018

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

@BrodJP

This comment has been minimized.

Copy link

BrodJP commented Apr 5, 2018

Any Idea how to fix this issue for MacOS 10.13.3, Xcode 9.2, OCLint 0.13?

@AdorkDean

This comment has been minimized.

Copy link

AdorkDean commented Apr 10, 2018

same as @kronenthaler , not work

@passol1988

This comment has been minimized.

Copy link

passol1988 commented Jul 18, 2018

I tried, when u use command from the terminal, it works, while u use script from Xcode, it fails.
MaxOS 10.13, Xcode 9.4.1, Oclint 0.13

@ZZinKin

This comment has been minimized.

Copy link

ZZinKin commented Sep 20, 2018

l congpc

It works for me, thank you very much.

@MagLiC

This comment has been minimized.

Copy link

MagLiC commented Oct 31, 2018

I have already set COMPILER_INDEX_STORE_ENABLE=NO. but it doesn't work for me. Is any idea to fix it?

@shadowrider

This comment has been minimized.

Copy link

shadowrider commented Dec 18, 2018

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

@Allyess

This comment has been minimized.

Copy link

Allyess commented Jan 21, 2019

@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

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