github rizsotto/Bear 4.1.3

7 hours ago

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 names cc or c++, Bear now runs the executable once with --version to classify it as GCC or Clang before dispatching to an interpreter. The result is cached per canonical path. This fixes empty/incorrect compile_commands.json entries on macOS, FreeBSD, OpenBSD, NetBSD, and DragonFly, where cc is Clang rather than GCC. The probe is skipped for known wrappers (ccache, distcc, sccache), strips LD_PRELOAD/DYLD_INSERT_LIBRARIES to avoid re-entry, and a user compilers: config entry continues to override classification.

Performance

  • Reduce dependency footprint and clean-build compile time of the workspace:
    • Drop regex in favor of regex-lite (no PCRE features were used).
    • Drop env_logger's humantime feature (pulled in jiff).
    • Drop tempfile from bear's runtime dependencies (only used in tests).
    • Drop directories in favor of a direct env lookup for config paths.
  • platform-checks now probes the host once per workspace build and replays results to consumers via emit_cfg() / emit_check_cfg(), instead of re-running the probe in each consuming crate's build.rs.

Internal Refactoring

  • Extract generate-completions into a dedicated bear-completions crate so the main bear binary does not need clap_complete.
  • Drop the Event wrapper in the intercept channel; send Execution directly.
  • Replace the PathFormatter trait in the Clang output path with resolver function pointers.
  • Rename CommandConverter::to_entries to convert.
  • Replace ValidationCollector in config with free helper functions.
  • Switch test-suite verbosity control from BEAR_TEST_VERBOSE to standard RUST_LOG.

Documentation

  • Per-crate CLAUDE.md files explain the build pipeline (codegen, platform-checks, preload shim) and the layering between crates.
  • New requirement spec: requirements/recognition-ambiguous-name-probe.md documents the cc/c++ probe contract.

Closed Issues

  • #694 - MacOS create a blank compile_commands.json

Thanks

Full Changelog: 4.1.2...4.1.3

Don't miss a new Bear release

NewReleases is sending notifications on new releases.