Skip to content
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

Closed
dynamicdispatch opened this issue Sep 26, 2017 · 36 comments
Closed

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

dynamicdispatch opened this issue Sep 26, 2017 · 36 comments

Comments

@dynamicdispatch
Copy link

@dynamicdispatch 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
Copy link

@MichaelKellyTD MichaelKellyTD commented Sep 26, 2017

Also reported in #441

@dynamicdispatch
Copy link
Author

@dynamicdispatch 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
Copy link
Contributor

@ryuichis 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
Copy link
Author

@dynamicdispatch dynamicdispatch commented Sep 26, 2017

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

@dynamicdispatch
Copy link
Author

@dynamicdispatch 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
Copy link

@cuixuejiao 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
Copy link

@shorbenko 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
Copy link
Contributor

@kronenthaler 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
Copy link

@workhardupc workhardupc commented Oct 11, 2017

same as @kronenthaler, not work

@diaojunxian
Copy link

@diaojunxian diaojunxian commented Oct 16, 2017

same as @kronenthaler , not work again

@lubbo
Copy link

@lubbo 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
Copy link

@a13906285175 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
Copy link

@a13906285175 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
Copy link

@WishQi WishQi commented Nov 16, 2017

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

@GipsySh
Copy link

@GipsySh 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
Copy link

@congpc 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
Copy link

@CoreOne23 CoreOne23 commented Nov 27, 2017

thanks @congpc .

@stonedauwg
Copy link

@stonedauwg 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
Copy link

@ryuichi-assistant 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
Copy link

@gtatgh 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
Copy link

@BrodJP BrodJP commented Apr 5, 2018

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

@AdorkDean
Copy link

@AdorkDean AdorkDean commented Apr 10, 2018

same as @kronenthaler , not work

@passol1988
Copy link

@passol1988 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

@chew-lone
Copy link

@chew-lone chew-lone commented Sep 20, 2018

l congpc

It works for me, thank you very much.

@MagLiC
Copy link

@MagLiC 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
Copy link

@shadowrider 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
Copy link

@Allyess 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

@tonight1988
Copy link

@tonight1988 tonight1988 commented Mar 6, 2019

Good morning

@yousefhamza
Copy link

@yousefhamza yousefhamza commented Apr 7, 2019

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
Copy link

@kirinzer kirinzer commented Nov 8, 2019

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
Copy link

@iStonesy iStonesy commented Jun 7, 2020

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
Copy link

@binzi56 binzi56 commented Aug 14, 2020

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
Copy link

@ryuichi-assistant ryuichi-assistant commented Dec 20, 2020

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
Copy link

@kirinzer kirinzer commented Dec 28, 2020

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
Copy link

@ryuichi-assistant ryuichi-assistant commented Mar 23, 2021

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
Copy link

@ryuichi-assistant ryuichi-assistant commented Apr 23, 2021

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet