INTERCEPT(1)
β¨ NAME β¨
okay so bestie, welcome to the intercept(1) manual page π this one's all about intercept β the tool that intercepts command executions in user space. yes, it's giving spy movie but for your build system π΅οΈβοΈβ¨
πΈ SYNOPSIS πΈ
intercept [options] -- [build command]
π¦ DESCRIPTION π¦
so the tea is: intercept runs the build command you hand it, and then it spits out an output file that's absolutely packed with every single process-execution-related event that went down while that build was doing its thing. π
the process execution events you're gonna see are:
- start
- signal
- termination
and like, heads up β the output contains only the child processes. not the whole family tree, just the kiddos. π
depending on the interception mode, the output might only contain a subset of the commands that actually ran. the interception modes are, in no particular order of slay:
- preload β this one uses the
LD_PRELOADorDYLD_INSERT_LIBRARIESmechanisms that the dynamic linker provides. the pre-loaded library hijacks the process execution calls and executes a supervisor process, which reports the execution. π however β and this is the important part β the method fails when the executable is statically linked, or when security protection disables the dynamic linker. no cap, that's a hard limitation. - wrapper mode β this one interposes a wrapper program into the build. the wrapper sends the execution report and then calls the original program. π but it fails when the build system is not flexible enough for interposing build tools. tragic, honestly.
and then the reports? they get collected by intercept over a gRPC interface, and written into an output file. the whole pipeline is lowkey iconic. β
π OPTIONS π
--versionβ prints the version number. simple. clean. ate.--helpβ prints the help message. your bestie when you're lost fr fr.--verboseβ turns on verbose logging. for when you want the full play-by-play commentary. π--output fileβ specify the output file. (there's a default file name provided, don't worry.) the output is a command execution list, with some extra information sprinkled on top. the syntax gets its own dedicated section below β see it, love it. π«Ά--force-preloadβ forces the use of the preload method to intercept the children processes. periodt.--force-wrapperβ forces the use of the wrapper method to intercept the children processes. also periodt.
π₯ EXIT STATUS π₯
the exit status of the program is the exit status of the build command. that's it, that's the whole vibe. β¨
except when the program itself crashes β then it gets set to non-zero. π so if you see a non-zero and your build was fineβ¦ yeah, that's what happened.
π OUTPUT FILE π
the output file has JSON lines format β that's https://jsonlines.org/ for anyone who wants the full lore π β where each line is terminated with a \n line separator, and each line is a JSON object.
the JSON objects are process execution events:
- process start
- process got signal
- process terminated
(for the schema of these events, please consult with the source code of this project. iykyk π§)
π TROUBLESHOOTING π
okay so the potential problems you might face are:
- the build behaves differently with and without the interception (eg.: the build crashes with the
intercepttool, but succeeds otherwise) π - the output is empty, and it failed to intercept the children process execution by the build command
the most common cause for empty outputs is that the build command did not execute any commands. and the reason for that could beβ¦ incremental builds not running the compilers if everything is already up-to-date. π
remember:interceptdoes not understand the build file (eg.:makefile). it only intercepts the executed commands. it's not reading your makefile, bestie, it's watching what actually runs. π
there could be many reasons for any of these failures. it's better to consult with the project wiki page for known problems before you open a bug report. do your research first, queen. π«Ά
π SEE ALSO π
π COPYRIGHT π
Copyright (C) 2012-2022 by LΓ‘szlΓ³ Nagy <https://github.com/rizsotto/Bear>
π AUTHORS π
LΓ‘szlΓ³ Nagy.
and that's the whole page, bestie!! π this gem came to you courtesy of the Bear User Manuals, dated Sep 04, 2021 β take care of her, she's iconic β¨π¦π
π¦ where this page comes from
- epel 9: bear 3.0.20-2.el9 Β· GPLv3+
- ubuntu jammy: bear 3.0.18-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms