build fail with ios app
The infer version I used is V0.9.2. when I execute infer -- xcodebuild -workspace QQNews.xcworkspace -scheme QQNews -configuration Debug -sdk iphoneos I met the error clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-c68750.s'
Thanks for the report @zhangying19871987
Could you edit this line to change
if [ "$1" = "-cc1" ]; then
to
if [ "$1" = "-cc1" ] || [ "$1" = "-cc1as" ]; then
and report back?
After I edit the line, I got the same error as follows:
clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-08684d.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1 ** BUILD FAILED **
The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/darwin64_x86_64.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
which version of xcode are you using (you can run xcodebuild -version to find out)?
Xcode 7.3 Build version 7D175
I comment the line in infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh I change the line
sed -e "s#^[[:space:]]"([^"])" "-cc1" (.)$# "$CLANG_CC1_CAPTURE" "-cc1" \2#g" | \
to
#sed -e "s#^[[:space:]]"([^"])" "-cc1" (.)$# "$CLANG_CC1_CAPTURE" "-cc1" \2#g" | \
My ios app build success, but I got the print Analyzed 0 files
No issues found
So, I guess I cannot do this.
Could you paste the full output of infer prior to the changes please? Please use a paste site such as https://gist.github.com/.
You could also try not executing -cc1as commands by inserting this line right after the sed line that you commented out (but uncomment the sed line as well):
grep -v "\"-cc1as\"" | \
More precisely, could try to apply this diff? Thanks!
https://gist.github.com/jvillard/5fd9b9dc32a402aa5347edc5d327f45b
The problem is I got the error when I compile my ios project
clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-08684d.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1 ** BUILD FAILED **
The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/darwin64_x86_64.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
I do not change anything about infer except that change
if [ "$1" = "-cc1" ]; then to
if [ "$1" = "-cc1" ] || [ "$1" = "-cc1as" ]; then
Please tell me what shall I do ?
I try not executing -cc1as commands by inserting this line right after the sed line
grep -v "\"-cc1as\"" | \
and I got error as well:
/Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:3:1: error: expected identifier or '('
GENERATED CODE - DO NOT EDIT
^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:41:5: error: unknown type name 'ldr' ldr r0, [pc, #-4092] ^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:41:14: error: use of undeclared identifier 'pc' ldr r0, [pc, #-4092] ^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:44:8: error: expected ';' after top level declarator ldr pc, [pc, #-4092] ^ ; 4 errors generated. Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1
** BUILD FAILED **
The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/trampoline_armv7.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/arm/trampoline_armv7.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler
It was fixed this issue. Thanks a lot.
Infer 0.9.3 has been released, please try and reopen this issue if the problem remains.