Repository navigation
Bear 4.3.0 changes some defaults. Response files are now read, and entries
for missing source files are dropped again. Bear also ends the way the build
ends, handles Ctrl-C with care, and reports over a UNIX socket. Logs from
another machine get their own switch. Building Bear now needs Rust 1.90.
Features
- Response files are inlined by default -
@filearguments are replaced
by the file's flags, so a source or a-Einside the file is seen. Set
arguments.from_response_files: falseto keep the old behavior. Bear logs
once whether it reads them. A flag value that starts with@, such as
-install_name @rpath/x, is no longer taken for a response file, so macOS
links stop warning. A file that is gone (Ninja deletes them) stays as
@filewith a warning. sources.only_existing_filesworks again, on by default - the key was
ignored since 4.0.3. Entries whose source file is known to be missing are
dropped. Entries read back with--appendare checked too, so
--appendwith a no-op build trims a stale database. When nothing is written,
one error line names every cause. In combined mode a file the build deletes
after compiling is usually kept. In semantic and parse-sh mode it is
dropped.--no-local-lookupsforbear semanticandbear parse-sh- use it
for a log or events file from another machine. The missing-source filter
is off, configured compiler paths need not exist here, parse-sh starts
from an empty environment, and response files are not read. No compiler is
run and no path is resolved. An unconfiguredcc,c++orCCis parsed
with the Clang table, which can misread rare GCC-only flags such as-load.
Settings that read this machine's files are rejected with an error that
names the key.- Reports travel over a UNIX socket - on Unix, each intercepted call
reports to Bear through a private socket, not loopback TCP. A build step in
its own network namespace (bitbake, discussion #724) is now captured, and
other local users cannot write to it. If no socket can be made, Bear falls
back to loopback TCP. Windows keeps TCP. - New
intercept.socketconfig section -socket.dirsets the base
directory andsocket.accessisownerorall. The default isowner,
orallwhen Bear runs as root. Any key in the section turns the TCP
fallback off. It is an error on Windows. - Bear ends like the build - the exit code is the build's. If the build
dies by a signal, Bear dies by the same signal, so a script that runs
Bear stops at Ctrl-C. The wrapper does the same. Bear turns
off its own core dump, so a crashing build leaves no core file for Bear. - Better Ctrl-C and signal handling - Bear never kills the build now. It
relays each termination signal to the build and waits as long as the build
needs. The build stays in Bear's process group, so Ctrl-Z, terminal
reads and a closed terminal work as without Bear. Ignored signals stay
ignored, so background runs andnohupbehave.SIGHUPis handled. A
signal that arrives before the build starts, while Bear writes, or in
semantic and parse-sh mode stops Bear cleanly, removes its temp files and
prints "interrupted by SIG; stopped before finishing". - An interrupted build publishes only when overwriting - with
--append,
Ctrl-C leaves the output as it was. With--overwrite, the captured
entries replace it, and one warning says so. Intercept mode writes the
events captured so far. A build that exits 0 always publishes. - Assemblers are their own kind -
nasm,yasmandfasmget compile
steps and no link step. - A language flag makes files sources -
gcc -x c -c gen.inc, glued
-xc, and MSVC/TC,/TP,/Tcand/Tpnow give an entry for files
with an unknown extension. The null device is never a source.
Bug Fixes
- Linker flags on cross builds (#725) - the build script picked the
platform from the host, so a macOS host building for Android passed
-force_loadtold.lld. It now reads the target. install.shinstalls the preload library on cross builds (#725) - it
choselibexec.soorlibexec.dylibfrom the host and skipped the library
without a word. It now installs whichever the build made.gcc -S foo.sgets no entry - the compiler does not use the input.
gcc -S foo.Skeeps its entry.- The
outputfield is the object -cl /Feapp.exe /Foa.obj a.crecords
a.obj, notapp.exe, whichever comes first. - Environment flags are read like command-line flags -
CL=/c /Fofoo.obj
now means a stop flag and an output. A stop flag inCLsuch as/Egives
no entry. Values are split with response-file rules, which changes
ARMCOMPILER6_CLANGOPT. An unknown key in a YAML environment entry is an
error. - Info-only calls get no entry -
gcc -###, armclang--vsnand
--version_number, and valac--version,--helpand--api-version. - Flag parsing fixes - each was checked against the vendor docs:
- MSVC
clandclang-claccept-as well as/for options./Fi
names the output,/onames the clang-cl output, and/Tcand/Tp
files are inputs. -fsyntax-onlyand/Zsstop at compiling.- nvcc: the whole option table follows NVIDIA's guide.
-odir,-link
and-ltono longer make bogus outputs or libraries.--ptx,--cubin
and--fatbinstop at compiling. Some options give no entry. - NVIDIA HPC and PGI:
-acc,-gpu,-mp,-Minfo,-Mneginfo,
-Mvect,-Mconcur,-Mcuda,-Mipaand-Mprofno longer swallow
the next argument, sonvc -acc -o a a.ckeeps its output and source. - Clang
-xknows more languages, and-x c++-modulegives a module
interface. Intel-x cand-Tfwork. - TI
--silicon_versionis recognized. clang-rpathtakes its value as
a separate token.
- MSVC
- Header entries for symlinked headers - a header that is a symlink to a
header file now gets an entry. - Path formats resolve against the right base - the symlink-resolving
format used the working directory, not the entry's directory. A relative
working directory such asbuildno longer becomesbuild/build. - A clearer interrupt warning - overwriting no longer names a flag you
may not have typed. Appending to a missing output says it was not written. - Lost reports are explained - the UNIX read timeout is 200 ms, up from
100 ms, after a Yocto build lost reports on a loaded machine. The warning
now says how long Bear waited and how much it received.
Removed
relativeis rejected forformat.paths.directory- it wrote.for
every entry, and released clang tools ignore such entries. Useabsolute.
relativestill works forfile.- A launcher is rejected as a configured compiler family -
as: wrapper,
as: ccache,distcc,sccacheoriceccfails at startup with a message
that names the entry. A renamed launcher is not supported. Launchers are
still found by their file name.
Internal Refactoring
- Rust 1.90 is now required - the UNIX socket write needs
SIGPIPE
handling that std provides only from 1.90. - Semantic recognition now builds one interpretation of each call, and the
output step builds entries from it. Pass and file-role rules live in
semantic, next to the flag knowledge.shell-wordsleftsemantic. - Naming now follows the terms launcher, compiler wrapper and masquerade.
- CI lints on Linux, macOS and Windows, runs nightly on Linux only, and uses
a workflow lockfile for actions. - Test and comment cleanups across the crates. Dev container uses Fedora 45.
Documentation
- Man page and site - they state the new defaults, the socket section,
--no-local-lookups, config search and compiler path checks, and what an
interrupted build does to the output. The Windows page is rewritten. - Known limit - on FreeBSD, a burst of reports over loopback TCP can be
lost, with no error on the sender. - New requirements and rationale entries cover these changes.
Closed Issues
- #725 - ld.lld: error: unknown argument '-force_load' on a macOS host building for Android
Thanks
Thanks to @leleliu008 for #725 and #726, and for testing the cross-build fix
on their own CI until it worked end to end. Thanks to @Avinesh for the
openSUSE install instructions in #727.
Thanks to the downstream packagers who keep Bear available and current -
chronically invisible work that this project depends on.
New Contributors
Full Changelog: 4.2.4...4.3.0