Releases: rizsotto/Bear
Releases · rizsotto/Bear
Release list
4.1.5
What's Changed
Features
- Vala (
valac) compiler support (#709). Bear now recognizesvalacinvocations and emits one compilation entry per Vala (.vala) or Genie (.gs) source, sovala-language-servercan consume a Bear-generatedcompile_commands.jsonon non-meson builds. - Inline
@fileresponse files (#701, opt-in). Response-file arguments can be expanded inline into each entry, so the recorded command is self-contained instead of pointing at a file the consumer has to resolve. - Configurable environment-derived flags. Flags Bear derives from the build environment are now configurable, giving finer control over what ends up in each entry.
--append: latest compilation wins for rebuilt files. When appending to an existing database, the newest compilation of a rebuilt file supersedes the stale one instead of leaving a duplicate.- Full process-tree teardown with signal fidelity. The supervisor now tears down the entire build tree and forwards the real terminating signal, reaping detached descendants via cgroup v2 so nothing is left running after an interrupted build.
Bug Fixes
- Recognize GCC by its FSF copyright, not the
(GCC)tag (#711). Fixesccrecognition on Alpine Linux, whose GCC banner omits the(GCC)marker Bear previously relied on. - OS-independent output path handling. The
output_from_opath logic no longer assumes a specific platform's path conventions. execthe driver from the install entry script. The installedbearentry script nowexecsbear-driverinstead of spawning it as a child.
Internal Refactoring
- Regroup the workspace crates by role into directory roots, extract the shared interception runtime into an
interceptcrate, split driver-side interception intointercept-supervisor, and splitbear-driver/bear-wrapperinto dedicated binary crates. - Rename the interpreter YAML directory to
compilersand buildCompilerInterpreterin a single pass. - Refresh workspace dependencies:
ctor0.6 -> 1.0 plus a sweep to the latest compatible versions.
Tests
- New
bear-test-toolscdb-comparebinary for comparing compilation databases, with invariants, sampling, and a CMake-oracle comparison mode. - A staged dogfooding harness (containerized golden-regression, CMake-oracle, and determinism self-checks) that validates Bear against real projects at kernel and midsize scale.
Documentation
- Reorganize the docs tree: split requirements and rationale, make requirements contract-only, and repoint the routing tables.
- Turn the release procedure into an invocable skill and capture the shared coding-style and commit conventions.
- Man page fixes, including escaping
--to prevent unintended smartification (#708).
Closed Issues
- #711 - Bear-4.1.4 fails to recognize
ccon Alpine Linux (fixed) - #701 - Allow inlining response files in command line arguments (implemented)
- #702 -
ld.so$LIBpreload warning with 32-bitarm-linux-gcc(documented; not a Bear defect)
Thanks
- @vdualb for requesting Vala support (#709)
- @qaqland for reporting #711
- @jonathanharg for requesting #701
- @CSharperMantle for #708
- @duanjianbo3330 for reporting #702
New Contributors
- @CSharperMantle made their first contribution in #708
Full Changelog: 4.1.4...4.1.5
4.1.4
What's Changed
Bug Fixes
- Intercept
pclose(#698).pcloseis now in the exported symbol list, so thepopen/pclosepair is intercepted as a unit. Fixes thehardened_popen_after_unsetenvtest on FreeBSD. - Report nested
exec*on musl / s390x (#705). Bear now intercepts musl's__execvpe, so commands launched by a nestedexecare captured on musl-based systems (observed on linux/s390x). - Do not lose the last compile on collector shutdown (#704). The TCP collector now drains its backlog on shutdown instead of racing the final event, so the last compilation is no longer dropped (observed on linux/s390x).
- Use
shinstead ofbash(#703). Build and test scripting no longer assumesbash; the project targets POSIXsh. This unblocks environments wherebashis absent.
Internal Refactoring
- Drop the
bashdependency project-wide: test fixtures, the Dockerfile pipe, the coverage check, and documentation code fences all moved frombashto POSIXsh. - Refresh workspace dependency constraints for the release. Each declared floor stays at-or-below what Fedora rawhide ships, so packagers need no substitution patches:
clap/clap_complete4.5 -> 4.6,tempfile3.19 -> 3.27,assert_cmd2.0 -> 2.2 (dev-dep), andserde-saphyr0.0.24 -> 0.0.27 (upstream patch fixes; the crate is not packaged in Fedora).instais deliberately held at 1.46 because rawhide does not yet carry 1.47. - Bump the devcontainer base image to Fedora 44.
- Add regression guards for precompiled-header source recognition (#601),
--appendperformance on large databases (#532), and non-UTF-8 argv interception (#506). - Issue/PR tooling: add
labels.ymlas the source of truth for labels, convert the bug report to a structured issue form, disable blank issues, and link Discussions from the issue picker.
Documentation
- Document the libsandbox env-clear preload conflict as a known limitation (#699, #675). When Bear's suite runs inside a sandbox (e.g. Gentoo's emerge),
libsandbox.sostrips Bear's library fromLD_PRELOADafter anenv -i, so the env-clear tests are not intercepted. This is not a Bear defect; the packaging-side fix isRESTRICT="test"orFEATURES="-sandbox -usersandbox". - New requirement proposals:
@fileresponse-file inlining (#701), an events file as an external interchange format (#644), and C++20 module recognition (#637). - Spell out the three-place sync required when adding a new intercept in
intercept-preload.
Closed Issues
- #705 - LD_PRELOAD does not report nested exec* on musl linux/s390x
- #704 - source_directory_filter_config loses last compile on linux/s390x (TCP collector shutdown race)
- #702 - ld.so: object '/usr/$LIB/bear/libexec.so' from LD_PRELOAD cannot be preloaded
- #699 - some tests are failing (documented as a sandbox/libsandbox limitation, not a Bear defect)
Thanks
- @aokblast for #698 and #703
- @rtmongold for reporting #704 and #705
- @DarthGandalf for reporting #699
- @duanjianbo3330 for reporting #702
Full Changelog: 4.1.3...4.1.4
4.1.3
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
4.1.2
What's Changed
Features
- Wrapper mode: compiler env vars with embedded flags: accept
CC="gcc -std=c11"/CXX="clang++ -stdlib=libc++"style values (GNU Make convention) - the first token resolves as the compiler, trailing tokens become flags - Wrapper mode: masquerade compiler resolution: bare names like
cl,gcc,ccnow resolve throughPATHbefore wrapper registration, with case-insensitive matching on Windows (#686) - Output: drop invalid entries with a warning instead of aborting the whole pipeline (#692)
- Install script: install binaries to
/usr/libexecinstead of/usr/share(FHS-compliant, fixes packaging in distros)
Bug Fixes
- fix(msvc): handle all per-warning
cl.exeoptions -/wd,/we,/wowith space-separated value, plus previously-unsupported/w1-/w4and/Wv[:version](#690) - fix(install): correct script for distro packaging (#685)
- fix(output): return
"."fromrelative_tofor self-referential paths - fix(intercept): apply review findings for masquerade-wrapper handling
Internal
- Refresh dependency pins and consolidate into the workspace
- Bump
rand0.9.2 -> 0.9.4 - Rewrite preload and wrapper interception requirement specs; document output pipeline
- Tag existing tests with the requirements they protect
- Substantial new test coverage: output transformation rules, atomic-write success/failure, canonical/relative path formats, duplicate-detection match fields, wrapper-mode
.bear/lifecycle, mid-compile signal interruption, MSVC glued/clang-cl inheritance
Documentation
INSTALL.md: documentlldrequirement on Linuxbear.1: document compiler env vars with embedded flags- Replace
AGENTS.mdwith topic-scopedCLAUDE.mdfiles - Add
RELEASE.mdcapturing the release process
Closed Issues
- #647 - hangs during
dotnet restore(verified fixed with 4.1.x) - #685 - install.sh wrong
- #686 - Windows wrapper mode masquerade compiler resolution
- #690 - MSVC per-warning option handling
- #692 - channel disconnect when using a format option
Thanks
- @scc-tw for reporting #686 and #690 and contributing the MSVC fix in #691
- @oreadvanthink for reporting #692 and confirming the fix
- @sandord for retesting and confirming #647 resolved
- @grawlinson for reporting #685
- @DarthGandalf for #684 (
/usr/libexec) - @Watersrc-stack for #689 (
lldinstall docs)
Full Changelog: 4.1.1...4.1.2
4.1.1
What's Changed
Features
- New compiler support: MSVC, clang-cl, Intel C/C++ (icx, icpx), NVIDIA HPC SDK (nvc, nvc++, nvfortran), ARM Compiler 6, and IBM Open XL
- Windows improvements: case-insensitive executable matching and slash-prefix flag support (e.g.
/Fo,/Ot) - Environment variable forwarding: data-driven per-compiler environment variable extraction, replacing hardcoded GCC-only handling
- Install script: add
DESTDIRsupport for packaging workflows
Bug Fixes
- fix: canonical path generation on Windows stripping
\\?\prefix (#683) - fix: inconsistent flag inheritance - make all resolution transitive
- fix: replace remaining panics with proper
anyhowerror handling
Performance
- Eliminate temporary
Stringallocations in flag pattern matching - Remove intermediate
Vec<String>fromFlagMatch - Pre-allocate
Veccapacity inparse_argumentsandparse_environment - Replace
Box<dyn Arguments>withArgumentenum (static dispatch)
Code Generation Overhaul
- Extract
bear-codegencrate frombuild.rsflag generation - Add flag dedup and conflict detection during inheritance
- Add colon separator patterns and pass-through flag support
- Add flag terminator support
- Introduce
ResolvedTablewith snapshot, schema validation, and property-based tests
Internal Refactoring
- Decouple intercept layer from semantic compiler recognition
- Extract
EntryFiltertrait andFilteredOutputWriterinto filtering module - Tighten module visibility (
pubtopub(super)and private) - Simplify
CompilerCommandtoCommand, removeOutputCommandwrapper
Documentation
- Updated man page with correct schema version, complete compiler list, and
cc/c++defaults - Cleaned up README
Closed Issues
Full Changelog: 4.1.0...4.1.1
4.1.0
What's Changed
Features
- Shell completions: generate completions for bash, zsh, fish, and elvish
- Compiler executable paths: preserve full compiler executable path in compilation database; resolve bare executable filenames to absolute paths
- Install script: new
scripts/install.shwith build-timeINTERCEPT_LIBDIRvalidation, replacing manual setup - DevContainer: introduce devcontainer for streamlined development environment
Bug Fixes
- fix: inline va_arg extraction in variadic exec shims for i686 compatibility
- fix: preserve co-resident LD_PRELOAD libraries during env doctoring
- fix: restore session env vars in
system()/popen()for older glibc - fix: unify preload restoration for
system()/popen()with exec-family doctoring - fix: recover from poisoned mutex in
popen/pcloseinstead of panicking - fix: replace panic with
TryFromerror for empty Execution arguments - fix: return
fmt::Errorinstead of panicking in ConfigurationDisplayimpl - fix: handle Prefix flags with
=in name in build-time codegen
Robustness & Stability
- Replace multiple
panic!/unwrappaths with proper error handling (thiserror,TryFrom,fmt::Error) - Reimplement
system()/popen()on top ofposix_spawnpfor safer process creation - Add hardened interception tests for environment sabotage scenarios
- Replace
serde_ymlwithserde-saphyrfor YAML parsing
Compiler Recognition Overhaul
- Move compiler flag definitions from Rust source to YAML with build-time code generation
- Replace per-compiler interpreter structs with a generic
FlagBasedInterpreter - Auto-generate recognition patterns and ignored-executable lists from YAML schema
- Match ignored executables by filename instead of full path
Documentation
- Expanded README with usage guidance, platform info, and limitations
- Improved INSTALL with prerequisites, package manager instructions, and verification steps
- Improved CONTRIBUTING with developer workflow and guidelines
Internal Refactoring
- Split
config.rs,infrastructure.rsinto module directories - Split
outputmodule (formats.rs,writers.rs) into focused submodules - Centralize
envptraversal intoenvp_iteriterator; consolidate session context - Replace empty-string sentinels with
Option<String> - Extensive new test coverage across output, compiler interpreter, and interception modules
New Contributors
- @DarthGandalf made their first contribution in #676
Full Changelog: 4.0.4...4.1.0
4.0.4
What's Changed
- fix: add -arch flag to GCC flags to prevent argument loss on macOS ARM by @thisalihassan in #674
- fix: Internal f951 gfortran compiler execution not-excluded #672
- fix: flaky test in tcp module
- fix: compiler wrapper handling bugs, improve test coverage
New Contributors
- @thisalihassan made their first contribution in #674
Full Changelog: 4.0.3...4.0.4
4.0.3
What's Changed
- intercept-preload: Force use lld as the linker by @aokblast in #664 #662
- semantic: Do not require - or _ for versioned compilers by @derekschrock in #663
- semantic: Source files with identical names in separate directories erroneously dropped #667
- intercept: Crash when trying to execute a build script without shebang #666
- intercept: add IPv6 loopback address to fall back to
- intercept: reporting in wrapper mode using the configuration file only
- intercept: preload mode defends against environment variables reset
- intercept: preload library errno handling clean up
New Contributors
- @aokblast made their first contribution in #664
- @derekschrock made their first contribution in #663
Full Changelog: 4.0.2...4.0.3
4.0.2
What's Changed
- docs: update man page by @antonkesy in #653
- build: Add Windows notes for configurable paths by @alvrogd in #655
- bugfix: wrapper mode does not work with configure #656
- bugfix: preload mode does not work with vararg functions #658
- bugfix: semantic interpreter misqualifies compilations #656
New Contributors
- @antonkesy made their first contribution in #653
- @alvrogd made their first contribution in #655
Full Changelog: 4.0.1...4.0.2
4.0.1
What's Changed
- Use correct SPDX identifier for GPL by @DarthGandalf in #651
New Contributors
- @DarthGandalf made their first contribution in #651
Full Changelog: 4.0.0...4.0.1