infer
infer copied to clipboard
infer run return err clang-15: error: unknown argument: '-ivfsstatcache'
infer --version
Infer version v1.1.0-7fb6d4011
Copyright 2009 - present Facebook. All Rights Reserved.
Mac mini
Apple M1
Ventura 13.3
xcodebuild -version
Xcode 14.3
Build version 14E222b
command infer run --keep-going --skip-analysis-in-path Pods --compilation-database-escaped compile_commands.json
log:
clang-15: error: unknown argument: '-ivfsstatcache'
*** Infer needs a working compilation command to run.
Usage Error: Failed to execute compilation command:
'/usr/local/lib/infer/infer/bin/../../facebook-clang-plugins/clang/install/bin/clang'
@/Users/Shared/Jenkins/workspace/ios_test/infer-out/tmp/cdb_clang_args.tmp.89ff0b.txt
-fsyntax-only -fno-builtin ++Contents of '/Users/Shared/Jenkins/workspace/ios_test/infer-out/tmp/cdb_clang_args.tmp.89ff0b.txt':
-x c -ivfsstatcache /Users/xxx/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos16.4-20E238-.sdkstatcache -target arm64-apple-ios9.0 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=gnu11 -fmodules -gmodules -fmodules-cache-path\=/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/xxx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=LzmaSDK_ObjC -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Werror\=deprecated-objc-isa-usage -Werror\=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -iquote /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/LzmaSDK_ObjC-generated-files.hmap -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/LzmaSDK_ObjC-own-target-headers.hmap -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/LzmaSDK_ObjC-all-non-framework-target-headers.hmap -ivfsoverlay /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/all-product-headers.yaml -iquote /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/LzmaSDK_ObjC-project-headers.hmap -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Products/Debug-iphoneos/LzmaSDK-ObjC/include -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/DerivedSources-normal/arm64 -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/DerivedSources/arm64 -I/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/DerivedSources -F/Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Products/Debug-iphoneos/LzmaSDK-ObjC -DNS_FORMAT_ARGUMENT\(A\)\= -D_Nullable_result\=_Nullable -DLZMASDKOBJC\=1 -DLZMASDKOBJC_OMIT_UNUSED_CODE\=1 -w -Xanalyzer -analyzer-disable-all-checks -include /Users/Shared/Jenkins/workspace/ios_test/Pods/Target\ Support\ Files/LzmaSDK-ObjC/LzmaSDK-ObjC-prefix.pch -MMD -MT dependencies -MF /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/Objects-normal/arm64/Ppmd7.d --serialize-diagnostics /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/Objects-normal/arm64/Ppmd7.dia -c /Users/Shared/Jenkins/workspace/ios_test/Pods/LzmaSDK-ObjC/lzma/C/Ppmd7.c -o /Users/xxx/Library/Developer/Xcode/DerivedData/testiOS-etqfnkjdhckdayfrbdjnysttvzvd/Build/Intermediates.noindex/LzmaSDK-ObjC.build/Debug-iphoneos/LzmaSDK-ObjC.build/Objects-normal/arm64/Ppmd7.o
维护infer的成本比较高,clang官方增加的特性都可能潜在导致infer不能工作,太难了
将-ivfsstatcache参数移除掉即可
You can use --clang-block-listed-flags-with-arg -ivfsstatcache
so that infer doesn't pass that argument down to its own clang (which is at a different version than Apple's clang, which is why it doesn't know this argument).
@jvillard
- black, not block
- this option does not appear to be working. error is still there
Is any progress about this issue ? I also face this error ,on M1 with the latest mac os version
You can use
--clang-block-listed-flags-with-arg -ivfsstatcache
so that infer doesn't pass that argument down to its own clang (which is at a different version than Apple's clang, which is why it doesn't know this argument).
Hi, I use this ,but still have this error , is there anything wrong about this :"infer run --keep-going --skip-analysis-in-path Pods --clang-block-listed-flags-with-arg -ivfsstatcache --clang-compilation-db-files-escaped compile_commands.json " ?
Error message is "Error message: clang-16: error: unknown argument: '-ivfsstatcache' "
Could you help check it please . Many thanks .
将-ivfsstatcache参数移除掉即可 怎么移除
将-ivfsstatcache参数移除掉即可
@songgeb 请问下你说的这个参数移除掉是什么意思?怎么操作 我后来又测试了,只有使用compile_commands.json解析这种方式才会报这个错误,infer run -- xcodebuild的方式是没有问题的。 而且就像上面说的有人测试了--clang-block-listed-flags-with-arg -ivfsstatcache,这个使用compile_commands.json解析的时候也不好用,谢谢
就是将json文件中这个参数及其value都删掉
发自我的iPhone
在 2023年8月15日,下午8:09,zhengzhiwen @.***> 写道:
将-ivfsstatcache参数移除掉即可
@songgeb 请问下你说的这个参数移除掉是什么意思?怎么操作 我后来又测试了,只有使用compile_commands.json解析这种方式才会报这个错误,infer run -- xcodebuild的方式是没有问题的。 而且就像上面说的有人测试了--clang-block-listed-flags-with-arg -ivfsstatcache,这个使用compile_commands.json解析的时候也不好用,谢谢
他的意思应该是把compile_commands.json里的ivfsstatcache删除,我试了还是会报错,我是m1的电脑
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
m1的机器上,移除ivfsstatcache参数后,还会报其他错误:
fatal error: could not build module 'Foundation'
To be honest, I strongly do not recommend use infer. It can only find some simple mistakes that most experienced engineers do not make.
将-ivfsstatcache参数移除掉即可
@songgeb 请问下你说的这个参数移除掉是什么意思?怎么操作 我后来又测试了,只有使用compile_commands.json解析这种方式才会报这个错误,infer run -- xcodebuild的方式是没有问题的。 而且就像上面说的有人测试了--clang-block-listed-flags-with-arg -ivfsstatcache,这个使用compile_commands.json解析的时候也不好用,谢谢
@pastel001 infer run -- xcodebuild 这种方式的完整命令是什么
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
可以使用 sed -i '' 's/-ivfsstatcache[^\"]*\.sdkstatcache//g' "/Users/**/Desktop/***/***/compile_commands.json"
先处理json文件,然后在使用infer run 去分析json文件
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
Try the commands below. This setup supports Xcode 15 on ARM64 (not x86_64) Mac, including the fix for '-ivfsstatcache'
git clone -b support_xcode15 https://github.com/Lianghuajian/oclint.git oclint
cd oclint/oclint-scripts && ./make && cd ..
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
Try the commands below. This setup supports Xcode 15 on ARM64 (not x86_64) Mac, including the fix for '-ivfsstatcache'
git clone -b support_xcode15 https://github.com/Lianghuajian/oclint.git oclint cd oclint/oclint-scripts && ./make && cd ..
这个编译出来的oclint 本身是x86_64,怎么编译出arm64的
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
Try the commands below. This setup supports Xcode 15 on ARM64 (not x86_64) Mac, including the fix for '-ivfsstatcache'
git clone -b support_xcode15 https://github.com/Lianghuajian/oclint.git oclint cd oclint/oclint-scripts && ./make && cd ..
这个编译出来的oclint 本身是x86_64,怎么编译出arm64的
机器如果是 M 芯片,理论上编译时会自动识别并编译出 Arm64 的 OCLint ,我这边是在 M 机器上执行的
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
Try the commands below. This setup supports Xcode 15 on ARM64 (not x86_64) Mac, including the fix for '-ivfsstatcache'
git clone -b support_xcode15 https://github.com/Lianghuajian/oclint.git oclint cd oclint/oclint-scripts && ./make && cd ..
这个编译出来的oclint 本身是x86_64,怎么编译出arm64的
机器如果是 M 芯片,理论上编译时会自动识别并编译出 Arm64 的 OCLint ,我这边是在 M 机器上执行的
是我环境的问题,cmake是x86版本重装了arm64的版本再编译就好了(但如果重装cmake版本是最新的要处理一下项目中cmakelist.txt 中CMAKE_MINIMUM_REQUIRED(VERSION 3.5) 改成3.5,不然会报错"engine" "IN_LIST" "link_components"
Unknown arguments specified)
说实话,我强烈不建议使用infer。它只能发现一些大多数有经验的工程师不会犯的简单错误。
OCLint也有问题,没有适配最新的Xcode15,也是各种报错,还有哪个好用检测工具推荐吗?太难了😂
Try the commands below. This setup supports Xcode 15 on ARM64 (not x86_64) Mac, including the fix for '-ivfsstatcache'
git clone -b support_xcode15 https://github.com/Lianghuajian/oclint.git oclint cd oclint/oclint-scripts && ./make && cd ..
这个编译出来的oclint 本身是x86_64,怎么编译出arm64的
机器如果是 M 芯片,理论上编译时会自动识别并编译出 Arm64 的 OCLint ,我这边是在 M 机器上执行的
是我环境的问题,cmake是x86版本重装了arm64的版本再编译就好了(但如果重装cmake版本是最新的要处理一下项目中cmakelist.txt 中CMAKE_MINIMUM_REQUIRED(VERSION 3.5) 改成3.5,不然会报错"engine" "IN_LIST" "link_components"
Unknown arguments specified)
嗯嗯,3.5 这个我没提交上去分支里,怕会有其他人报错 ;你这个信息很有帮助。