docs/requirements/interception-mode-selection.md
The user runs bear -- <build> without choosing how the interception
happens. Bear has two interception mechanisms -- injecting a shared
library into the build's processes (interception-preload-mechanism)
and placing wrapper executables on PATH
(interception-wrapper-mechanism) -- and selects exactly one of them
per invocation, before the build starts. The default fits the platform;
a configuration option forces either mode for users who need the other
one.
Given a Linux host and no interception configuration:
When the user runs
bear intercept --output events.json -- sh build.sh, then the shell and the processes it spawns are all reported -- evidence that the preload mechanism is active, since wrapper mode never observes the shell.
Given a macOS or Windows host and no interception configuration:
When the user runs
bear -- make, then the wrapper directory is present in the working directory while the build runs -- evidence that the wrapper mechanism is the platform default there.
Given a Linux host and a configuration forcing wrapper mode:
When the user runs
bear --config config.yaml -- sh build.sh, then the wrapper directory is present in the working directory while the build runs -- evidence that the wrapper mechanism is active even though the platform default is preload.
Given a macOS host with System Integrity Protection enabled and a configuration forcing preload mode:
When the user runs
bear -- make, then Bear exits with an error suggesting wrapper mode, and the build is not started.
interception-preload-mechanism and interception-wrapper-mechanism.