CSWRAP(1)
π cswrap(1) β the manual, but make it make sense π
okay bestie, gather round, because we're talking about cswrap β that's the cswrap(1) manual page, and by the end of this you're gonna be obsessed.
β¨ NAME β¨
cswrap β a generic compiler wrapper. yes, generic. yes, compiler. yes, wrapper. she contains multitudes π«Ά
πΈ SYNOPSIS πΈ
cswrap [--help | --print-path-to-wrap]
that's it. that's the whole vibe. two flags, no drama π
π¦ DESCRIPTION π¦
so cswrap is a generic compiler wrapper, and what she does is translate relative paths into absolute paths inside diagnostic messages. like, glow-up for your error messages, no cap.
here's the move: you create a symbolic link to cswrap and you name that symlink after your compiler β gcc, g++, whatever β and then you drop it into your $PATH. boom. slay. now your compiler is secretly cswrap in a trench coat π§
and when a diagnostic message gets translated, it gets decorated with a suffix: <--[TOOL], where TOOL is the name of the tool that produced it (that's the name of the symlink you invoked cswrap through, iykyk). important: this only applies to translated diagnostic messages. it does not include code snippets, for instance. don't come for me, that's just the rules β
if cswrap is already installed on your system, this one command activates the wrapper:
export PATH="$(cswrap --print-path-to-wrap):$PATH"
literally one line and you're that girl π
π OPTIONS π
--helpβ prints basic usage information. your "hi hello what is this" button π--print-path-to-wrapβ prints the path to the directory that holds the symlinks pointing at thecswrapexecutable. this is the one you paste into$PATHβ
π₯ EXIT STATUS π₯
cswrap propagates the exit status returned by the compiler β but only in the case that cswrap succeeds in running the compiler. if it can't even run the compiler, well. different story, bestie π
π ENVIRONMENT VARIABLES π
CSWRAP_CAP_FILEβ if you set this to a non-empty string,cswrapcaptures diagnostic messages into a file named$CSWRAP_CAP_FILE. and here's the tea: in this case the capture file is protected by a lock named/cswrap_cap_file_lock, so you get consistent output when multiple compiler processes are running in parallel. no interleaved chaos, we love a coordinated queen πCSWRAP_TIMEOUTβ set this to a positive integer andcswrapinstalls a timeout for the compiler it's wrapping. if that amount of time (in seconds, babe, seconds) elapses, the compiler process gets signalled bySIGTERM. π’ note: thecswrapprocess waits till the compiler process finishes in any case. she's patient, she's committed, she's not leaving early πCSWRAP_TIMEOUT_FORβ a colon-separated list of programs (compilers) that$CSWRAP_TIMEOUTshould be applied to. if$CSWRAP_TIMEOUT_FORis unset or empty, then$CSWRAP_TIMEOUTapplies to all programs. all of them. everybody gets a timeout, periodt β¨CSWRAP_DEL_CFLAGS,CSWRAP_DEL_CXXFLAGSβcswrapexpects a colon-separated list of compiler flags that should be removed from the command line prior to invoking the compiler. the parameters are matched for exact match and they are case-sensitive. if a compiler flag shows up in the command line multiple times, all its occurrences get removed β every last one, no survivors π$CSWRAP_DEL_CFLAGSapplies to compilation of C sources only.$CSWRAP_DEL_CXXFLAGSapplies to compilation of C++ sources only. and plot twist: the flags to be removed can be specified by shell wildcard patterns, using the format accepted byfnmatch(3)π¦CSWRAP_ADD_CFLAGS,CSWRAP_ADD_CXXFLAGSβcswrapexpects a colon-separated list of compiler flags that should be appended to the command line prior to invoking the compiler. the flags are appended even if they already appear in the command line, and they are always appended at the end of the command line. yes, even then. yes, even if it's already there. she said what she said π$CSWRAP_ADD_CFLAGSapplies to compilation of C sources only.$CSWRAP_ADD_CXXFLAGSapplies to compilation of C++ sources only. πΈ
π BUGS π
please report bugs and feature requests at https://github.com/csutils/cswrap.
(not me telling you to go file an issue. do it. it's giving community. it's giving open source π«Ά)
π AUTHOR π
written by Kamil Dudka.
π COPYING π
copyright (C) 2013-2022 Red Hat, Inc. free use of this software is granted under the terms of the GNU General Public License (GPL). see the COPYING file for details.
π the cute sign-off π
and that's the whole page, bestie β this is cswrap(1), and the version you're reading is dated 06/29/2026. go forth, symlink responsibly, and may your diagnostics always be absolute β¨ππ
bye babes π¦
π¦ where this page comes from
- epel 10: cswrap 2.2.6-1.el10_3 Β· GPL-3.0-or-later
- epel 9: cswrap 2.2.6-1.el9 Β· GPLv3+
- fedora 43: cswrap 2.2.6-1.fc43 Β· GPL-3.0-or-later
- fedora 44: cswrap 2.2.6-1.fc44 Β· 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