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

CodeChecker trashing all C++ files #4297

Open
efagerho opened this issue Jul 18, 2024 · 5 comments
Open

CodeChecker trashing all C++ files #4297

efagerho opened this issue Jul 18, 2024 · 5 comments
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. platform-macOS 🍎

Comments

@efagerho
Copy link

Describe the bug

I have an Xcode project and I've created the compile_commands.json as follows:

xcodebuild -project path/to/.xcodeproj | \
    xcpretty -r json-compilation-database --output path/for/compile_commands.json

Following the manual, I've then execute CodeChecker as follows:

CodeChecker analyze ./compile_commands.json --enable sensitive --output ./reports

The code checker will then print lots of output as follows:

[ERROR 2024-07-18 15:51] - Analyzing SetText.cpp with clangsa  failed!
[ERROR 2024-07-18 15:51] - 

[ERROR 2024-07-18 15:51] - 
clang: error: no input files

[ERROR 2024-07-18 15:51] - 

[ERROR 2024-07-18 15:51] - 
clang: error: no input files

[ERROR 2024-07-18 15:51] - 

[ERROR 2024-07-18 15:51] - 
clang: error: no input files

[ERROR 2024-07-18 15:51] - 

[ERROR 2024-07-18 15:51] - 
clang: error: no input files

If I after running the analyzer run git status I see that it has trashed every C++ file in my project. I can manually run the compilation commands in the JSON and they work just fine. Paths that it generates to the files are also correct.

CodeChecker version

6.23.1

Expected behaviour

It should actually do the analysis.

Desktop (please complete the following information)

  • OS: MacOS Sonoma 14.5
@efagerho
Copy link
Author

efagerho commented Jul 18, 2024

Here's an example command that it generates:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/com.apple.DeveloperTools/15.4-15F31d/Xcode/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fno-color-diagnostics -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body @/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_editor_tests.build/Debug/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -include /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/9519247166719033948/cmake_pch.hxx -MMD -MT dependencies -MF /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_editor_tests.build/Debug/Objects-normal/arm64/SetText.d --serialize-diagnostics /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_editor_tests.build/Debug/Objects-normal/arm64/SetText.dia -c /Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp -o /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_editor_tests.build/Debug/Objects-normal/arm64/SetText.o

@whisperity
Copy link
Contributor

Could you please run CodeChecker analyze --verbose debug_analyzer or even --verbose debug and share the results? Preferably for only one file (so the compilation database should only contain that one example you elaborated). At first glance, I can't see what is wrong, or why would clang be tricked into outputting the analysis output back into the source file itself.

@whisperity whisperity added bug 🐛 analyzer 📈 Related to the analyze commands (analysis driver) clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. platform-macOS 🍎 labels Jul 18, 2024
@efagerho
Copy link
Author

Here are some edited output:

% CodeChecker analyze ./compile_commands_pretty.json --enable sensitive --output ./reports --verbose debug
[DEBUG][2024-07-18 22:05:06] {system} [76410] <8225655808> - analyze.py:1045 main() - args: Namespace(input='/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/compile_commands_pretty.json', jobs=12, keep_gcc_include_fixed=False, keep_gcc_intrin=False, output_format='plist', makefile=False, compile_uniqueing='none', config_file=None, func=<function main at 0x102687560>, func_process_config_file=<function process_config_file at 0x102686fc0>, ordered_checkers=[('sensitive', True)], output_path='/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports', verbose='debug')
[DEBUG][2024-07-18 22:05:06] {system} [76410] <8225655808> - analyze.py:1046 main() - Output will be stored to: '/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports'
[DEBUG][2024-07-18 22:05:06] {buildlogger} [76410] <8225655808> - log_parser.py:1035 parse_options() - Same clang is used for compilation and analysis.
[DEBUG][2024-07-18 22:05:06] {buildlogger} [76410] <8225655808> - log_parser.py:546 dump_compiler_info() - Writing compiler info into: /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports/compiler_info.json
[DEBUG][2024-07-18 22:05:06] {buildlogger} [76410] <8225655808> - log_parser.py:1357 parse_unique_log() - Parsing log file done.
[DEBUG_ANALYZER][2024-07-18 22:05:06] {system} [76410] <8225655808> - logger.py:40 debug_analyzer() - Total number of compile commands without skipping or uniqueing: 1
[DEBUG_ANALYZER][2024-07-18 22:05:06] {system} [76410] <8225655808> - logger.py:40 debug_analyzer() - Compile commands removed by uniqueing: 0
[DEBUG_ANALYZER][2024-07-18 22:05:06] {system} [76410] <8225655808> - logger.py:40 debug_analyzer() - Compile commands skipped during log processing: 0
[DEBUG_ANALYZER][2024-07-18 22:05:06] {system} [76410] <8225655808> - logger.py:40 debug_analyzer() - Compile commands forwarded for analysis: 1
[DEBUG_ANALYZER][2024-07-18 22:05:06] {analyzer} [76410] <8225655808> - logger.py:40 debug_analyzer() - /usr/bin/clang --version
clang: error: no input files
[WARNING][2024-07-18 22:05:06] {analyzer.gcc} [76410] <8225655808> - analyzer.py:190 get_binary_version() - Failed to get analyzer version: /usr/bin/g++ -dumpfullversion
[WARNING][2024-07-18 22:05:06] {analyzer.gcc} [76410] <8225655808> - analyzer.py:192 get_binary_version() - Command '['/usr/bin/g++', '-dumpfullversion']' returned non-zero exit status 1.
[DEBUG_ANALYZER][2024-07-18 22:05:06] {analyzer} [76410] <8225655808> - logger.py:40 debug_analyzer() - /usr/bin/g++ --version
[DEBUG_ANALYZER][2024-07-18 22:05:06] {analyzer} [76410] <8225655808> - logger.py:40 debug_analyzer() - 'Namespace' object has no attribute 'clangsa_args_cfg_file'
[INFO][2024-07-18 22:05:06] {analyzer} [76410] <8225655808> - analyzer.py:237 perform_analysis() - Enabled checkers:
clangsa: alpha.core.BoolAssignment, alpha.core.CastSize, alpha.core.Conversion, alpha.core.DynamicTypeChecker, alpha.core.SizeofPtr, alpha.core.TestAfterDivZero, alpha.cplusplus.DeleteWithNonVirtualDtor, alpha.cplusplus.EnumCastOutOfRange, alpha.cplusplus.InvalidatedIterator, alpha.cplusplus.IteratorRange, alpha.cplusplus.MismatchedIterator, alpha.cplusplus.STLAlgorithmModeling, alpha.cplusplus.SmartPtr, alpha.security.MmapWriteExec, alpha.security.ReturnPtrRange, alpha.security.cert.pos.34c, alpha.security.taint.TaintPropagation, alpha.unix.BlockInCriticalSection, alpha.unix.Chroot, alpha.unix.PthreadLock, alpha.unix.Stream, alpha.unix.cstring.NotNullTerminated, alpha.unix.cstring.OutOfBounds, core.CallAndMessage, core.DivideZero, core.NonNullParamChecker, core.NullDereference, core.StackAddressEscape, core.UndefinedBinaryOperatorResult, core.VLASize, core.uninitialized.ArraySubscript, core.uninitialized.Assign, core.uninitialized.Branch, core.uninitialized.CapturedBlockVariable, core.uninitialized.NewArraySize, core.uninitialized.UndefReturn, cplusplus.InnerPointer, cplusplus.Move, cplusplus.NewDelete, cplusplus.NewDeleteLeaks, cplusplus.PlacementNew, cplusplus.PureVirtualCall, cplusplus.StringChecker, deadcode.DeadStores, nullability.NullPassedToNonnull, nullability.NullReturnedFromNonnull, nullability.NullableDereferenced, nullability.NullablePassedToNonnull, nullability.NullableReturnedFromNonnull, optin.cplusplus.UninitializedObject, optin.cplusplus.VirtualCall, optin.mpi.MPI-Checker, optin.portability.UnixAPI, alpha.security.cert.env.InvalidPtr, security.FloatLoopCounter, security.insecureAPI.UncheckedReturn, security.insecureAPI.getpw, security.insecureAPI.gets, security.insecureAPI.mkstemp, security.insecureAPI.mktemp, security.insecureAPI.rand, security.insecureAPI.vfork, unix.API, alpha.unix.Errno, unix.Malloc, unix.MallocSizeof, unix.MismatchedDeallocator, unix.Vfork, unix.cstring.BadSizeArg, unix.cstring.NullArg, valist.CopyToSelf, valist.Uninitialized, valist.Unterminated
[INFO][2024-07-18 22:05:06] {analyzer} [76410] <8225655808> - analyzer.py:312 perform_analysis() - Starting static analysis ...
[DEBUG_ANALYZER][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - logger.py:40 debug_analyzer() - Constructing clangsa analyzer.
[DEBUG][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analyzer_base.py:108 analyze() - Running analyzer ...
[DEBUG_ANALYZER][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - logger.py:40 debug_analyzer() -
/usr/bin/clang --analyze -Qunused-arguments -Xclang -analyzer-opt-analyze-headers -Xclang -analyzer-output=plist-multi-file -o /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports/SetText.cpp_clangsa_9dd950b853513e42e0b55c61809bb358.plist -Xclang -analyzer-config -Xclang expand-macros=true -Xclang -analyzer-checker=alpha.core.BoolAssignment,alpha.core.CastSize,alpha.core.Conversion,alpha.core.DynamicTypeChecker,alpha.core.SizeofPtr,alpha.core.TestAfterDivZero,alpha.cplusplus.DeleteWithNonVirtualDtor,alpha.cplusplus.EnumCastOutOfRange,alpha.cplusplus.InvalidatedIterator,alpha.cplusplus.IteratorRange,alpha.cplusplus.MismatchedIterator,alpha.cplusplus.STLAlgorithmModeling,alpha.cplusplus.SmartPtr,alpha.security.MmapWriteExec,alpha.security.ReturnPtrRange,alpha.security.cert.pos.34c,alpha.security.taint.TaintPropagation,alpha.unix.BlockInCriticalSection,alpha.unix.Chroot,alpha.unix.PthreadLock,alpha.unix.Stream,alpha.unix.cstring.NotNullTerminated,alpha.unix.cstring.OutOfBounds,core.CallAndMessage,core.DivideZero,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.VLASize,core.uninitialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized.NewArraySize,core.uninitialized.UndefReturn,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.PlacementNew,cplusplus.PureVirtualCall,cplusplus.StringChecker,deadcode.DeadStores,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullableDereferenced,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,optin.cplusplus.UninitializedObject,optin.cplusplus.VirtualCall,optin.mpi.MPI-Checker,optin.portability.UnixAPI,alpha.security.cert.env.InvalidPtr,security.FloatLoopCounter,security.insecureAPI.UncheckedReturn,security.insecureAPI.getpw,security.insecureAPI.gets,security.insecureAPI.mkstemp,security.insecureAPI.mktemp,security.insecureAPI.rand,security.insecureAPI.vfork,unix.API,alpha.unix.Errno,unix.Malloc,unix.MallocSizeof,unix.MismatchedDeallocator,unix.Vfork,unix.cstring.BadSizeArg,unix.cstring.NullArg,valist.CopyToSelf,valist.Uninitialized,valist.Unterminated -Xclang -analyzer-config -Xclang aggressive-binary-operation-simplification=true -x c++ --target=arm64-apple-macos10.15 -ivfsstatcache -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fno-color-diagnostics -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wshadow -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 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -std=c++17 -fmodules -fmodules-cache-path=/Users/edvard.fagerholm/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fpascal-strings -O0 '-DCMAKE_INTDIR="Debug"' -DDEBUG=1 -DDISABLE_PARTNERS -DDUMMY_HELPSHIFT -D_DEBUG -DNDEBUG -DSC3D_OPTIMIZED_GETMESH -DUSE_FMOD_STUDIO -DDUMMY_TRACK -DSBM_DEBUG -DBAR_USE_FLUTTER -DENABLE_ODIN -DUSE_ODIN -DLOAD_ODIN_GLB '-DPROJECT_RES_DIR="/Users/edvard.fagerholm/git/foo/build/bin/res"' -DSC_APP_NAME=Foo '-DSC_APP_NAME_STRING="Foo"' -DSC3D_ENABLE_VALIDATION -DTEST_RUNNER_ENABLED -DSCGEOMETRY_ENABLED=1 -DSC_ENABLE_CRUXITE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -g -fvisibility=hidden -fvisibility-inlines-hidden -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug/include -I/Users/edvard.fagerholm/git/foo/build/client -I/Users/edvard.fagerholm/git/foo/build/baz -I/Users/edvard.fagerholm/git/foo/build/baz/baz -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common/crux/zlib -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/gltf -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/zstd/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/flatbuffers/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/astcenc/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/asio/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb_image/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/kiwi -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/spirv/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/renderdoc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/glad/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/fmod-osx/inc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/PVRSDK/Utilities -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/baz/crux/flatbuffers -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/usercentrics/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/appsflyer/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sc-geometry/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui_test_engine -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources-normal/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources -F/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sentry/apple -std=gnu++17 -fpch-instantiate-templates -include /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/10784983011846035314/cmake_pch.hxx -MMD --serialize-diagnostics /Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp
[ERROR][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analysis_manager.py:629 check() - Analyzing SetText.cpp with clangsa  failed!

[ERROR][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analysis_manager.py:635 check() -

[ERROR][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analysis_manager.py:636 check() -
clang: error: no input files

[DEBUG][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analysis_manager.py:254 handle_reproducer() - Fetching other dependent files from analyzer output...
[DEBUG][2024-07-18 22:05:06] {analyzer} [76432] <8225655808> - analysis_manager.py:267 handle_reproducer() - Collecting debug data
[DEBUG][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:296 handle_reproducer() - [ZIP] Writing analyzer STDOUT to /stdout
[DEBUG][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:299 handle_reproducer() - [ZIP] Writing analyzer STDERR to /stderr
[DEBUG][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:302 handle_reproducer() - [ZIP] Writing extra information...
[DEBUG][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:319 handle_reproducer() - ZIP file written at '/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports/failed/SetText.cpp_clangsa_9dd950b853513e42e0b55c61809bb358.plist_compile_error.zip'
[ERROR][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:685 check() -

[ERROR][2024-07-18 22:05:07] {analyzer} [76432] <8225655808> - analysis_manager.py:686 check() -
clang: error: no input files

[INFO][2024-07-18 22:05:07] {analyzer} [76410] <6211072000> - analysis_manager.py:82 worker_result_handler() - ----==== Summary ====----
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <6211072000> - analysis_manager.py:54 print_analyzer_statistic_summary() - Failed to analyze
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <6211072000> - analysis_manager.py:59 print_analyzer_statistic_summary() -   clangsa: 1
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analysis_manager.py:838 start_workers() - Total analyzed compilation commands: 1
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analysis_manager.py:847 start_workers() - ----=================----
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:328 perform_analysis() - Analysis finished.
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:329 perform_analysis() - To view results in the terminal use the "CodeChecker parse" command.
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:331 perform_analysis() - To store results use the "CodeChecker store" command.
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:332 perform_analysis() - See --help and the user guide for further options about parsing and storing the reports.
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:334 perform_analysis() - ----=================----
[INFO][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer.py:337 perform_analysis() - Analysis length: 0.45084595680236816 sec.
[WARNING][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'cppcheck' is enabled but CodeChecker is failed to execute analysis with it: 'Failed to detect analyzer binary!'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!
[WARNING][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'clang-tidy' is enabled but CodeChecker is failed to execute analysis with it: 'Failed to detect analyzer binary!'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!
[WARNING][2024-07-18 22:05:07] {analyzer} [76410] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'gcc' is enabled but CodeChecker is failed to execute analysis with it: 'Incompatible version: GCC binary is too old to support -dumpfullversion. Maybe try setting an absolute path to a different analyzer binary via the env variable CC_ANALYZER_BIN?'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!
[DEBUG][2024-07-18 22:05:07] {system} [76410] <8225655808> - analyze.py:1138 main() - Cleanup metadata file started.
[DEBUG][2024-07-18 22:05:07] {system} [76410] <8225655808> - analyze.py:1140 main() - Cleanup metadata file finished.
[DEBUG][2024-07-18 22:05:07] {system} [76410] <8225655808> - analyze.py:1142 main() - Analysis metadata write to '/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports/metadata.json'
[DEBUG][2024-07-18 22:05:07] {system} [76410] <8225655808> - analyze.py:1159 main() - Failed to send analyzer statistics!

My compiler version is:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@efagerho
Copy link
Author

efagerho commented Jul 19, 2024

Here's the commands file. To me it seems like the --serialize_diagnostics is the problem as it's not correctly cleaned up and now points the output to the original input file.

[
    {
        "command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/com.apple.DeveloperTools/15.4-15F31d/Xcode/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache -fmessage-length\\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\\=0 -fno-color-diagnostics -fmodules-prune-interval\\=86400 -fmodules-prune-after\\=345600 -fbuild-session-file\\=/var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\\=non-modular-include-in-framework-module -Wno-trigraphs -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wshadow -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 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body @/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -include /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/10784983011846035314/cmake_pch.hxx -MMD -MT dependencies -MF /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/SetText.d --serialize-diagnostics /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/SetText.dia -c /Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp -o /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/SetText.o",
        "file": "/Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp",
        "directory": "/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos"
    }
]

@efagerho
Copy link
Author

efagerho commented Jul 19, 2024

I've now tried to fix the compile_commands.json file by running the following Python script on it:

import json
import re

remove_flags = [
  r"--serialize-diagnostics\s+\S+",
  r"-f\S+\s+",
  r"-W\S+\s+"
]

def clean_command(pattern, command):
    return re.sub(pattern, "", command)

def clean(command):
    for flag in remove_flags:
        command = clean_command(flag, command)

    return command

f = open('compile_commands.json')
data = json.load(f)

for x in data:
   x['command'] = clean(x['command'])

print(json.dumps(data, indent=4))
f.close()

This will give me the following JSON:

[
    {
        "command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/34/rrfx8jzj0kbd5ch_t9bk5nb40000gn/C/com.apple.DeveloperTools/15.4-15F31d/Xcode/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache @/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp -include /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/10784983011846035314/cmake_pch.hxx -MMD -MT dependencies -MF /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/SetText.d -c /Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp -o /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/SetText.o",
        "file": "/Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp",
        "directory": "/"
    }
]

This now fails with:

[ERROR 2024-07-19 10:30] - 
fatal error: stat cache file '-std=c++17' not found
1 error generated.

[ERROR 2024-07-19 10:30] - 

[ERROR 2024-07-19 10:30] - 
fatal error: stat cache file '-std=c++17' not found
1 error generated.

The problem seems to be that there's this common args file that is included in the clang command, which adds various flags:

@/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/Objects-normal/arm64/82b82416624d2658e5098eb0a28c15c5-common-args.resp

This file has the following contents:

-target arm64-apple-macos10.15 '-std=c++17' -fmodules '-fmodules-cache-path=/Users/edvard.fagerholm/Library/Developer/Xcode/DerivedData/ModuleCache.noindex' -fpascal-strings -O0 '-DCMAKE_INTDIR="Debug"' '-DDEBUG=1' -DDISABLE_PARTNERS -DDUMMY_HELPSHIFT -D_DEBUG -DNDEBUG -DSC3D_OPTIMIZED_GETMESH -DUSE_FMOD_STUDIO -DDUMMY_TRACK -DSBM_DEBUG -DBAR_USE_FLUTTER -DENABLE_ODIN -DUSE_ODIN -DLOAD_ODIN_GLB '-DPROJECT_RES_DIR="/Users/edvard.fagerholm/git/foo/build/bin/res"' '-DSC_APP_NAME=Foo' '-DSC_APP_NAME_STRING="Foo"' -DSC3D_ENABLE_VALIDATION -DTEST_RUNNER_ENABLED '-DSCGEOMETRY_ENABLED=1' -DSC_ENABLE_CRUXITE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -g '-fvisibility=hidden' -fvisibility-inlines-hidden -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug/include -I/Users/edvard.fagerholm/git/foo/build/client -I/Users/edvard.fagerholm/git/foo/build/baz -I/Users/edvard.fagerholm/git/foo/build/baz/baz -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common/crux/zlib -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/gltf -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/zstd/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/flatbuffers/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/astcenc/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/asio/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb_image/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/kiwi -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/spirv/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/renderdoc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/glad/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/fmod-osx/inc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/PVRSDK/Utilities -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/baz/crux/flatbuffers -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/usercentrics/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/appsflyer/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sc-geometry/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui_test_engine -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources-normal/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources -F/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sentry/apple '-std=gnu++17' -fpch-instantiate-templates

Just seems like the tool doesn't quite handle these sorts of complexities. The full debug output of the checker is:

% CodeChecker analyze ./compile_commands_pretty_fix.json --enable sensitive --output ./reports --verbose debug_analyzer
[DEBUG_ANALYZER][2024-07-19 10:36:15] {system} [55761] <8225655808> - logger.py:40 debug_analyzer() - Total number of compile commands without skipping or uniqueing: 1
[DEBUG_ANALYZER][2024-07-19 10:36:15] {system} [55761] <8225655808> - logger.py:40 debug_analyzer() - Compile commands removed by uniqueing: 0
[DEBUG_ANALYZER][2024-07-19 10:36:15] {system} [55761] <8225655808> - logger.py:40 debug_analyzer() - Compile commands skipped during log processing: 0
[DEBUG_ANALYZER][2024-07-19 10:36:15] {system} [55761] <8225655808> - logger.py:40 debug_analyzer() - Compile commands forwarded for analysis: 1
[DEBUG_ANALYZER][2024-07-19 10:36:15] {analyzer} [55761] <8225655808> - logger.py:40 debug_analyzer() - /usr/bin/clang --version
clang: error: no input files
[WARNING][2024-07-19 10:36:15] {analyzer.gcc} [55761] <8225655808> - analyzer.py:190 get_binary_version() - Failed to get analyzer version: /usr/bin/g++ -dumpfullversion
[WARNING][2024-07-19 10:36:15] {analyzer.gcc} [55761] <8225655808> - analyzer.py:192 get_binary_version() - Command '['/usr/bin/g++', '-dumpfullversion']' returned non-zero exit status 1.
[DEBUG_ANALYZER][2024-07-19 10:36:15] {analyzer} [55761] <8225655808> - logger.py:40 debug_analyzer() - /usr/bin/g++ --version
[DEBUG_ANALYZER][2024-07-19 10:36:15] {analyzer} [55761] <8225655808> - logger.py:40 debug_analyzer() - 'Namespace' object has no attribute 'clangsa_args_cfg_file'
[INFO][2024-07-19 10:36:15] {analyzer} [55761] <8225655808> - analyzer.py:237 perform_analysis() - Enabled checkers:
clangsa: alpha.core.BoolAssignment, alpha.core.CastSize, alpha.core.Conversion, alpha.core.DynamicTypeChecker, alpha.core.SizeofPtr, alpha.core.TestAfterDivZero, alpha.cplusplus.DeleteWithNonVirtualDtor, alpha.cplusplus.EnumCastOutOfRange, alpha.cplusplus.InvalidatedIterator, alpha.cplusplus.IteratorRange, alpha.cplusplus.MismatchedIterator, alpha.cplusplus.STLAlgorithmModeling, alpha.cplusplus.SmartPtr, alpha.security.MmapWriteExec, alpha.security.ReturnPtrRange, alpha.security.cert.pos.34c, alpha.security.taint.TaintPropagation, alpha.unix.BlockInCriticalSection, alpha.unix.Chroot, alpha.unix.PthreadLock, alpha.unix.Stream, alpha.unix.cstring.NotNullTerminated, alpha.unix.cstring.OutOfBounds, core.CallAndMessage, core.DivideZero, core.NonNullParamChecker, core.NullDereference, core.StackAddressEscape, core.UndefinedBinaryOperatorResult, core.VLASize, core.uninitialized.ArraySubscript, core.uninitialized.Assign, core.uninitialized.Branch, core.uninitialized.CapturedBlockVariable, core.uninitialized.NewArraySize, core.uninitialized.UndefReturn, cplusplus.InnerPointer, cplusplus.Move, cplusplus.NewDelete, cplusplus.NewDeleteLeaks, cplusplus.PlacementNew, cplusplus.PureVirtualCall, cplusplus.StringChecker, deadcode.DeadStores, nullability.NullPassedToNonnull, nullability.NullReturnedFromNonnull, nullability.NullableDereferenced, nullability.NullablePassedToNonnull, nullability.NullableReturnedFromNonnull, optin.cplusplus.UninitializedObject, optin.cplusplus.VirtualCall, optin.mpi.MPI-Checker, optin.portability.UnixAPI, alpha.security.cert.env.InvalidPtr, security.FloatLoopCounter, security.insecureAPI.UncheckedReturn, security.insecureAPI.getpw, security.insecureAPI.gets, security.insecureAPI.mkstemp, security.insecureAPI.mktemp, security.insecureAPI.rand, security.insecureAPI.vfork, unix.API, alpha.unix.Errno, unix.Malloc, unix.MallocSizeof, unix.MismatchedDeallocator, unix.Vfork, unix.cstring.BadSizeArg, unix.cstring.NullArg, valist.CopyToSelf, valist.Uninitialized, valist.Unterminated
[INFO][2024-07-19 10:36:15] {analyzer} [55761] <8225655808> - analyzer.py:312 perform_analysis() - Starting static analysis ...
[DEBUG_ANALYZER][2024-07-19 10:36:15] {analyzer} [55785] <8225655808> - logger.py:40 debug_analyzer() - Constructing clangsa analyzer.
[DEBUG_ANALYZER][2024-07-19 10:36:15] {analyzer} [55785] <8225655808> - logger.py:40 debug_analyzer() -
/usr/bin/clang --analyze -Qunused-arguments -Xclang -analyzer-opt-analyze-headers -Xclang -analyzer-output=plist-multi-file -o /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/reports/SetText.cpp_clangsa_dac2b5250590e991388fa02485147cf7.plist -Xclang -analyzer-config -Xclang expand-macros=true -Xclang -analyzer-checker=alpha.core.BoolAssignment,alpha.core.CastSize,alpha.core.Conversion,alpha.core.DynamicTypeChecker,alpha.core.SizeofPtr,alpha.core.TestAfterDivZero,alpha.cplusplus.DeleteWithNonVirtualDtor,alpha.cplusplus.EnumCastOutOfRange,alpha.cplusplus.InvalidatedIterator,alpha.cplusplus.IteratorRange,alpha.cplusplus.MismatchedIterator,alpha.cplusplus.STLAlgorithmModeling,alpha.cplusplus.SmartPtr,alpha.security.MmapWriteExec,alpha.security.ReturnPtrRange,alpha.security.cert.pos.34c,alpha.security.taint.TaintPropagation,alpha.unix.BlockInCriticalSection,alpha.unix.Chroot,alpha.unix.PthreadLock,alpha.unix.Stream,alpha.unix.cstring.NotNullTerminated,alpha.unix.cstring.OutOfBounds,core.CallAndMessage,core.DivideZero,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.VLASize,core.uninitialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized.NewArraySize,core.uninitialized.UndefReturn,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.PlacementNew,cplusplus.PureVirtualCall,cplusplus.StringChecker,deadcode.DeadStores,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullableDereferenced,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,optin.cplusplus.UninitializedObject,optin.cplusplus.VirtualCall,optin.mpi.MPI-Checker,optin.portability.UnixAPI,alpha.security.cert.env.InvalidPtr,security.FloatLoopCounter,security.insecureAPI.UncheckedReturn,security.insecureAPI.getpw,security.insecureAPI.gets,security.insecureAPI.mkstemp,security.insecureAPI.mktemp,security.insecureAPI.rand,security.insecureAPI.vfork,unix.API,alpha.unix.Errno,unix.Malloc,unix.MallocSizeof,unix.MismatchedDeallocator,unix.Vfork,unix.cstring.BadSizeArg,unix.cstring.NullArg,valist.CopyToSelf,valist.Uninitialized,valist.Unterminated -Xclang -analyzer-config -Xclang aggressive-binary-operation-simplification=true -x c++ --target=arm64-apple-macos10.15 -ivfsstatcache -std=c++17 -fmodules -fmodules-cache-path=/Users/edvard.fagerholm/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fpascal-strings -O0 '-DCMAKE_INTDIR="Debug"' -DDEBUG=1 -DDISABLE_PARTNERS -DDUMMY_HELPSHIFT -D_DEBUG -DNDEBUG -DSC3D_OPTIMIZED_GETMESH -DUSE_FMOD_STUDIO -DDUMMY_TRACK -DSBM_DEBUG -DBAR_USE_FLUTTER -DENABLE_ODIN -DUSE_ODIN -DLOAD_ODIN_GLB '-DPROJECT_RES_DIR="/Users/edvard.fagerholm/git/foo/build/bin/res"' -DSC_APP_NAME=Foo '-DSC_APP_NAME_STRING="Foo"' -DSC3D_ENABLE_VALIDATION -DTEST_RUNNER_ENABLED -DSCGEOMETRY_ENABLED=1 -DSC_ENABLE_CRUXITE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -g -fvisibility=hidden -fvisibility-inlines-hidden -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug/include -I/Users/edvard.fagerholm/git/foo/build/client -I/Users/edvard.fagerholm/git/foo/build/baz -I/Users/edvard.fagerholm/git/foo/build/baz/baz -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/common/crux/zlib -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/gltf -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/zstd/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/flatbuffers/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/astcenc/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/asio/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb_image/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/stb -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/kiwi -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/spirv/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/renderdoc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/glad/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/fmod-osx/inc -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/PVRSDK/Utilities -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/baz/crux/flatbuffers -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/usercentrics/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/appsflyer/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sc-geometry/include -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui -I/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/imgui_test_engine -I/Users/edvard.fagerholm/git/foo/build/crux-server/src/logic/cpp -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources-normal/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources/arm64 -I/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/foo_macos.build/Debug/DerivedSources -F/Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/Debug -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/bar_sdk/apple/macos -F/Users/edvard.fagerholm/git/foo/build/crux-client/client/libs/sentry/apple -std=gnu++17 -fpch-instantiate-templates -include /Users/edvard.fagerholm/git/foo/build/projectfiles/xcode/build_cmake_macos/build/SharedPrecompiledHeaders/SharedPrecompiledHeaders/10784983011846035314/cmake_pch.hxx -MMD /Users/edvard.fagerholm/git/foo/build/client/game/exec/SetText.cpp
[ERROR][2024-07-19 10:36:16] {analyzer} [55785] <8225655808> - analysis_manager.py:629 check() - Analyzing SetText.cpp with clangsa  failed!
[ERROR][2024-07-19 10:36:16] {analyzer} [55785] <8225655808> - analysis_manager.py:635 check() -

[ERROR][2024-07-19 10:36:16] {analyzer} [55785] <8225655808> - analysis_manager.py:636 check() -
fatal error: stat cache file '-std=c++17' not found
1 error generated.

[ERROR][2024-07-19 10:36:17] {analyzer} [55785] <8225655808> - analysis_manager.py:685 check() -

[ERROR][2024-07-19 10:36:17] {analyzer} [55785] <8225655808> - analysis_manager.py:686 check() -
fatal error: stat cache file '-std=c++17' not found
1 error generated.

[INFO][2024-07-19 10:36:17] {analyzer} [55761] <6154530816> - analysis_manager.py:82 worker_result_handler() - ----==== Summary ====----
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <6154530816> - analysis_manager.py:54 print_analyzer_statistic_summary() - Failed to analyze
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <6154530816> - analysis_manager.py:59 print_analyzer_statistic_summary() -   clangsa: 1
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analysis_manager.py:838 start_workers() - Total analyzed compilation commands: 1
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analysis_manager.py:847 start_workers() - ----=================----
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:328 perform_analysis() - Analysis finished.
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:329 perform_analysis() - To view results in the terminal use the "CodeChecker parse" command.
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:331 perform_analysis() - To store results use the "CodeChecker store" command.
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:332 perform_analysis() - See --help and the user guide for further options about parsing and storing the reports.
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:334 perform_analysis() - ----=================----
[INFO][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer.py:337 perform_analysis() - Analysis length: 1.8838117122650146 sec.
[WARNING][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'gcc' is enabled but CodeChecker is failed to execute analysis with it: 'Incompatible version: GCC binary is too old to support -dumpfullversion. Maybe try setting an absolute path to a different analyzer binary via the env variable CC_ANALYZER_BIN?'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!
[WARNING][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'clang-tidy' is enabled but CodeChecker is failed to execute analysis with it: 'Failed to detect analyzer binary!'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!
[WARNING][2024-07-19 10:36:17] {analyzer} [55761] <8225655808> - analyzer_types.py:116 print_unsupported_analyzers() - Analyzer 'cppcheck' is enabled but CodeChecker is failed to execute analysis with it: 'Failed to detect analyzer binary!'. Please check your 'PATH' environment variable and the 'config/package_layout.json' file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 clang sa 🐉 The Clang Static Analyzer is a source code analysis tool that finds bugs in C-family programs. platform-macOS 🍎
Projects
None yet
Development

No branches or pull requests

2 participants