Bear 4.2.2 is a small maintenance release. It ships one new flag,
--overwrite, which changes nothing today and exists so that scripts can
adopt it before a future release makes appending the default. The rest is
a test fix for a false failure on Gentoo, a dependency refresh, and the
documentation for the flag.
Features
-
--overwritenames the current default - accepted wherever
--appendis, in combined mode and in thesemanticandparse-sh
subcommands. It selects the behaviour Bear already has: replace the
output file with only this run's entries. Passing it today changes
nothing.The flag exists to give scripts a migration path. A future release
makes appending the default, so that a run which captures nothing stops
replacing a goodcompile_commands.jsonwith an empty one. Until that
flag existed there was no way for a script to name the behaviour it
depends on, so the break would have landed with no way to prepare for
it. A script that needs today's overwrite behaviour can adopt
--overwritenow and keep working across the change.Passing
--appendand--overwritetogether is a usage error rather
than a precedence rule. The two state opposite intents, and picking a
winner would let the contradiction survive the default change, where it
would quietly start losing or keeping entries depending on which rule
had been chosen.
Internal Refactoring
- The ambiguous-name probe test reads the dispatch verdict - it now
parses the interpreter id and the verdict from their own positions in
the log line instead of substring-matching it. The old check read
NotRecognized(asRecognized(, and matched "gcc" anywhere in the
dumped build environment, so a Gentoo package build that exports
CFLAGS=-frecord-gcc-switchestripped it even though Bear had
dispatched to Clang correctly. Bear's behaviour was never wrong here;
only the test's reading of the log was. The test now reproduces the
Gentoo environment rather than leaving it to the host. (#716) - Refreshed
Cargo.lockahead of the release, taking semver-compatible
updates toserde-saphyr,which,log,ccand five transitive
crates. No manifest requirements changed and no advisories are
outstanding.
Documentation
- The man page documents
--overwritein all three modes and states that
appending becomes the default in a future release. - A new rationale entry,
append-default-migration, records why the flag
ships a release ahead of the behaviour it selects, why--overwrite
rather than--no-appendor--truncate, and why the two flags are
rejected together rather than ordered by precedence.
Closed Issues
- #716 - probe dispatch test fails on Gentoo package builds
Thanks
Thanks to @DarthGandalf for reporting #716 with the environment detail
that made it reproducible; the failure needed a specific CFLAGS value
to show up at all. It surfaced while packaging Bear for Gentoo, which is
the kind of report only a packager runs into.
Thanks to the downstream packagers who keep Bear available and current -
chronically invisible work that this project depends on. Everyone below
has shipped a 4.x release:
- Alpine - @rtmongold
- ALT Linux - Mikhail Tergoev
- AOSC OS
- Arch, Artix, Manjaro, and Parabola maintainers
- Fedora and EPEL maintainers
- FreeBSD - aokblast
- Gentoo and LiGurOS - @DarthGandalf, with Gentoo proxy-maint
- Homebrew
- MSYS2
- Nix - Justin Restivo
- SlackBuilds
- Termux - @nguynkhn
Full Changelog: 4.2.1...4.2.2