What's Changed
Bug Fixes
- Recognition: probe
cc/c++to pick Clang vs GCC on BSD/macOS hosts (#694). When a build invokes the compiler under the ambiguous namesccorc++, Bear now runs the executable once with--versionto classify it as GCC or Clang before dispatching to an interpreter. The result is cached per canonical path. This fixes empty/incorrectcompile_commands.jsonentries on macOS, FreeBSD, OpenBSD, NetBSD, and DragonFly, whereccis Clang rather than GCC. The probe is skipped for known wrappers (ccache,distcc,sccache), stripsLD_PRELOAD/DYLD_INSERT_LIBRARIESto avoid re-entry, and a usercompilers:config entry continues to override classification.
Performance
- Reduce dependency footprint and clean-build compile time of the workspace:
- Drop
regexin favor ofregex-lite(no PCRE features were used). - Drop
env_logger'shumantimefeature (pulled injiff). - Drop
tempfilefrombear's runtime dependencies (only used in tests). - Drop
directoriesin favor of a direct env lookup for config paths.
- Drop
platform-checksnow probes the host once per workspace build and replays results to consumers viaemit_cfg()/emit_check_cfg(), instead of re-running the probe in each consuming crate'sbuild.rs.
Internal Refactoring
- Extract
generate-completionsinto a dedicatedbear-completionscrate so the mainbearbinary does not needclap_complete. - Drop the
Eventwrapper in the intercept channel; sendExecutiondirectly. - Replace the
PathFormattertrait in the Clang output path with resolver function pointers. - Rename
CommandConverter::to_entriestoconvert. - Replace
ValidationCollectorin config with free helper functions. - Switch test-suite verbosity control from
BEAR_TEST_VERBOSEto standardRUST_LOG.
Documentation
- Per-crate
CLAUDE.mdfiles explain the build pipeline (codegen, platform-checks, preload shim) and the layering between crates. - New requirement spec:
requirements/recognition-ambiguous-name-probe.mddocuments the cc/c++ probe contract.
Closed Issues
- #694 - MacOS create a blank compile_commands.json
Thanks
Full Changelog: 4.1.2...4.1.3