-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Build and Configuration
CoreTrace is a CMake C++20 project (cmake_minimum_required(VERSION 3.11)).
Main target:
- executable:
ctrace
Dependency integration is split between FetchContent and ExternalProject.
-
nlohmann/json(v3.11.3 archive) -
coretrace-stack-analyzer(Git,main) -
coretrace-log(Git,main) -
cpp-httplib(Git tagv0.14.3)
-
tscancode(Gitmaster, built in its own external directory) -
flawfinder(Gitmaster)
cd /Users/hugopayet/Desktop/CLaude/coretrace
mkdir -p build && cd build
cmake .. -DPARSER_TYPE=CLI11 -DUSE_THREAD_SANITIZER=OFF -DUSE_ADDRESS_SANITIZER=OFF
make -j4Run smoke check:
./ctrace --help-
PARSER_TYPE:GetoptorCLI11(defaultCLI11) -
USE_THREAD_SANITIZER:ON|OFF -
USE_ADDRESS_SANITIZER:ON|OFF -
USE_EXTERNAL_CLI11: download/link external CLI11 when parser type is CLI11
Sanitizer note:
- ThreadSanitizer and AddressSanitizer should not be enabled together.
Factory logic (createArgumentParser) chooses:
-
GetoptArgumentParserwhenUSE_GETOPTis defined -
CLI11ArgumentParserotherwise
USE_GETOPT is set when CMake PARSER_TYPE=Getopt.
Local scripts:
./scripts/format.sh
./scripts/format-check.shCMake targets:
cmake --build build --target format
cmake --build build --target format-checkCI currently checks:
-
clang-formatworkflow installs clang-format 17 and runsscripts/format-check.sh -
buildworkflow builds on Linux and macOS, and runs./ctrace -h
Project workflows install LLVM/Clang 20 in CI for Linux and macOS builds.
For local parity with CI, prefer LLVM 20 toolchains when working on stack-analyzer integration.
- Parse CLI options into
ArgumentManager. - If
--tool-configexists, load JSON intoProgramConfigfirst. - Apply CLI commands (
ConfigProcessor) afterward.
Result: CLI flags/options override overlapping values loaded from tool-config.
- Apply boolean request fields.
- If
tool_configis provided, load JSON. - Apply request string/list fields afterward.
Result: explicit request string/list values can override loaded file values.
Current loader supports:
- Root:
invokeinput
- Analyzer section at either:
stack_analyzer- or
tools.ctrace_stack_analyzer
Supported analyzer keys include:
- Paths:
compile_commands,resource_model,escape_model,buffer_model - Booleans:
demangle,timing,include_compdb_deps,quiet - Scalars:
stack_limit,analysis-profile/analysis_profile,smt*keys - Lists:
smt-rules/smt_rules,entry_points
Path values in config file are resolved relative to the config file directory.
- Some tool executables are invoked with specific paths/commands in implementation.
-
cppcheckpath is hardcoded to/opt/homebrew/bin/cppcheckin current code. - Environment/runtime setup therefore affects which tools can actually execute.