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

Xcode14.3,OCLint: 20.11 oclint: error: compilation contains multiple jobs: #651

Open
tenxun123 opened this issue May 29, 2023 · 22 comments

Comments

@tenxun123
Copy link

Issue Summary

oclint: error: compilation contains multiple jobs:

Environment

  • Operation system name and version: Mac OS:13.3 (22E252), Xcode 14.3
  • OCLint version: /bin/oclint-20.11
  • How OCLint is installed: local build? prebuilt binary downloaded from github? homebrew install? others?

Reproduction Steps

Running OCLint.....
oclint: error: compilation contains multiple jobs:
"/usr/local/Cellar/oclint/20.11/bin/oclint-20.11" "-cc1" "-triple" "arm64-apple-ios11.0.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "iphoneos16.4-20E238-.sdkstatcache" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=non-leaf" "-fno-rounding-math" "-munwind-tables" "-target-sdk-version=16.4" "-fcompatibility-qualified-id-

Sample code

C
C++
Objective-C
@Vincentzzg
Copy link

兄弟,问题有解决吗

@luqiuan
Copy link

luqiuan commented Jul 6, 2023

兄弟,问题有解决吗

兄弟,问题有解决吗?

@michaelrourke
Copy link

Comparing Xcode 14.2 vs Xcode 14.3 oclint-json-compilation-database output yields some differences.
In my case, Xcode 14.3 sometimes issues an extra argument over XCode 14.2:
-ivfsstatcache XXXXXXX.sdkstatcache

Using sed to strip this out of the xcpretty json output before feeding to oclint-json-compilation-database resolves the issue.

sed 's/-ivfsstatcache [^ ]*//g' < compile_commands.json > icompile_commands.json
mv icompile_commands.json compile_commands.json

@Vincentzzg
Copy link

Comparing Xcode 14.2 vs Xcode 14.3 oclint-json-compilation-database output yields some differences. In my case, Xcode 14.3 sometimes issues an extra argument over XCode 14.2: -ivfsstatcache XXXXXXX.sdkstatcache

Using sed to strip this out of the xcpretty json output before feeding to oclint-json-compilation-database resolves the issue.

sed 's/-ivfsstatcache [^ ]*//g' < compile_commands.json > icompile_commands.json mv icompile_commands.json compile_commands.json

xcode14.2 is OK?

@michaelrourke
Copy link

Yes Xcode14.2 is ok. With OCLint version 23.0. At least for my simple app.

@Vincentzzg
Copy link

Yes Xcode14.2 is ok. With OCLint version 23.0. At least for my simple app.

I will try Xcode14.2。But the lastest version of OCLint is 22.02.

@Vincentzzg
Copy link

image

@michaelrourke
Copy link

michaelrourke commented Jul 6, 2023

Sorry for the confusion. With the move to Apple silicon I followed the recommendations in the issue titled Please upgrade oclint to llvm14.0 so built from this source: https://github.com/Lianghuajian/oclint/tree/support_xcode14

@Vincentzzg
Copy link

ok,I will try this version with Xcode14.2

@Vincentzzg
Copy link

Comparing Xcode 14.2 vs Xcode 14.3 oclint-json-compilation-database output yields some differences. In my case, Xcode 14.3 sometimes issues an extra argument over XCode 14.2: -ivfsstatcache XXXXXXX.sdkstatcache

Using sed to strip this out of the xcpretty json output before feeding to oclint-json-compilation-database resolves the issue.

sed 's/-ivfsstatcache [^ ]*//g' < compile_commands.json > icompile_commands.json mv icompile_commands.json compile_commands.json

Is this solution with OCLint version 23.0?

@michaelrourke
Copy link

yes. this works with the so called OCLint version 23.0 (which isn't an official release but from lianghuajian)

@lshdfp726
Copy link

基于 https://github.com/Lianghuajian/oclint fork 一份源码,修改了oclint 编译脚本重新基于clang 14.0.6 编译的一份oclint,产物,测试在xcode14.3 上可以正常工作,具体怎么操作可以 下载编译好的产物操操作一下: https://github.com/lshdfp726/oclint/releases/tag/23.0_clang%E2%80%94%E2%80%9414.0.6

@manuelzi
Copy link

manuelzi commented Aug 24, 2023

To resolve the issue on Xcode 14.3.1, I followed these steps:

  1. Built the OCLint fork by Lianghuajian, which adds support for Xcode 14. You can find more details here.
  2. Set "Supports Mac Catalyst" to "NO" in the app target's Build Settings.
  3. Removed extra arguments from compile_commands.json that are automatically added by Xcode 14.3.1, as suggested by michaelrourke. More information can be found here.

@ryuichi-assistant
Copy link

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.

@manuelzi
Copy link

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.

Ok, I was using version 22.02 when I experienced this issue.

@Vincentzzg
Copy link

大家问题有解决吗?我一直在等OCLint的新版本修复这个问题,项目的静态扫描已经停了几个月了

@FirstDKS521
Copy link

xcode 15, oclint 22.02,解析compile_commands.json时报错,oclint: error: compilation contains multiple jobs: 怎么处理

@CodeSnowMonkey
Copy link

xcode 15.1, oclint 22.02,解析compile_commands.json时报错,oclint: error: compilation contains multiple jobs: 怎么处理

@ryuichi-assistant
Copy link

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.

@Coder-Star
Copy link

xcode 15.1, oclint 22.02,解析compile_commands.json时报错,oclint: error: compilation contains multiple jobs: 怎么处理

这个有解决吗

@FirstDKS521
Copy link

xcode 15.1, oclint 22.02,解析compile_commands.json时报错,oclint: error: compilation contains multiple jobs: 怎么处理

这个有解决吗

没有解决,等官方更新

@shunsongshiyi
Copy link

image
My same issueoclint: error: compilation contains multiple jobs fixed by remove -ivfsstatcache /Users/mrzhao/derivedData/SDKStatCaches.noindex/macosx14.0-23A334-4a76ee93ef69e462914ffe9883de22b8.sdkstatcache in compile_command.json
then run oclint-json-compilation-database will generate oclint report successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests