include_server(1)
π NAME π
okay so include_server(1) β yes, the General Commands Manual girlie β is the page for include_server.py, and it's a conservative approximation of include dependencies for C/C++. That's the whole assignment: figuring out what needs to show up for the compile. π
β¨
β¨ SYNOPSIS β¨
include_server --port INCLUDE_SERVER_PORT [OPTIONS]
π¦ DESCRIPTION π¦
include_server.py starts an include server process. This process answers queries from distcc(1) clients about what files to include in C/C++ compilations. The include_server.py command itself terminates as soon as the include server has been spawned. So the launcher does its thing and immediately peaces out β iconic behavior, honestly. π«Ά
The INCLUDE_SERVER_PORT argument is the name of a socket used for all communication between distcc clients and the include server. The pump(1) command is responsible for creating the socket location, for passing it to this script, and for passing it to all distcc clients via the environment variable named INCLUDE_SERVER_PORT. π
The protocol used by the include server uses distcc's RPC implementation. Each distcc request consists of (1) the current directory and (2) the list of arguments of the compilation command.
If the include server is able to process the request, then it answers the distcc client by sending a list of filepaths. The filepaths are those of the compressed source and header files found to be necessary for compilation through include analysis. The list also comprises symbolic links and even dummy files needed for the compilation server to construct an accurate replica of the parts of the filesystem needed for compilation. In this way, a needed header file like /path/foo.h is compressed, renamed, and stored in a temporary location, such as /dev/shm/tmpiAvfGv.include_server-9368-1/path/foo.h.lzo. The distcc client will pass these files on to a compilation server, where they will be uncompressed and mounted temporarily. Literally the filesystem version of packing a little suitcase. π§³β¨
If the include server is not able to process the request, then it returns the empty list to the distcc client. No notes, just an empty vibe check. π
There are two kinds of failures that relate to the include server. The include server may fail to compute the includes or fail in other ways, see section INCLUDE SERVER SYMPTOMS. Also, the compilation on the remove server may fail due to inadequacy of the calculated include closure, but then succeed when locally retried, see section DISTCC DISCREPANCY SYMPTOMS. (yes, it says βremove serverβ π keep it moving bestie)
β¨ OPTION SUMMARY β¨
The following options are understood by include_server.py. Bestie, there are a lot of them, but every single one is here β no skips, no shortcuts. π
-dPAT,--debug_pattern=PATβ Bit vector for turning on warnings and debugging:1= warnings2= trace some functions- other powers of two: see
include_server/basics.py.
-e,--emailβ Send email to'distcc-pump-errors'or if defined, the value of environment variableDISTCC_EMAILLOG_WHOM_TO_BLAME, when include server gets in trouble. The default is to not send email.--email_bound NUMBERβ Maximal number of emails to send (in addition to a final email). Default:3.--no-emailβ Do not send email. This is the default.--path_observation_re=REβ Issue warning message whenever a filename is resolved to a realpath that is matched byRE, which is a regular expression in Python syntax. This is useful for finding out where files included actually come from. UseRE=""to find them all. Note: warnings must be enabled with at least-d1.--pid_file FILEPATHβ The pid of the include server is written to fileFILEPATH. This allows a script such apumpto tear down the include server.-s,--statisticsβ Print information to stdout about include analysis.--stat_reset_triggers=LISTβ Flush stat caches when the timestamp of any filepath inLISTchanges or the filepath comes in or out of existence.LISTis a colon separated string of filepaths, possibly containing simple globs (as allowed by Python'sglobmodule). Print a warning whenever such a change happens (if warnings are enabled). This option allows limited exceptions todistcc_pump's normal assumption that source files are not modified during the build.-t,--timeβ Print elapsed, user, and system time to stderr.--unsafe_absolute_includesβ Do preprocessing on the compilation server even if includes of absolute filepaths are encountered. Normally the include-server will fall back on local preprocessing if it detects any absolute includes. Thus, this flag is useful for preventing such fallbacks when the absolute includes are a false alarm, either because the absolute include is discarded during preprocessing or because the absolutely included file exists on the compilation servers.
More precisely, with --unsafe_absolute_includes absolute includes are ignored for the purposes of gathering the include closure. Using this option may lead to incorrect results because (1) the header may actually be included on the compilation server and it may not be the same as on the client, (2) the include directives of the header are not further analyzed.
The option is useful for compiling code that has such hardcoded absolute locations of header files inside conditional directives (e.g. "#ifdef") that render the includes irrelevant. More precisely, these includes must be eliminated during preprocessing for the actual configuration. Then the question of existence of the header file is moot and the remote compilation is sound. This is often the case if such includes are meant for unusual configurations different from the actual configuration. π¨ This one can lead to incorrect results, so don't treat it like a cute little accessory. π¨
--no_force_dirsβ Do not force the creation of all directories used in an include path. May improve performance for some cases, but will break builds which use include structures like"<foo/../file.h>"without including other files infoo/.-v,--verifyβ Verify that files in CPP closure are contained in closure calculated by include processor.-w,--write_include_closureβ Write a.d_approxfile which lists all the included files calculated by the include server; with-x, additionally write the included files as calculated by CPP to a.d_exactfile.-x,--exact_analysisβ Use CPP instead, do not omit system headers files.
π INCLUDE SERVER SYMPTOMS AND ISSUES π
The most likely messages and warnings to come from the include processor are listed below. These are the group-chat receipts of include-server problems. π«Ά
Preprocessing locally. Include server not covering: Couldn't determine default system include directoriesβ To determine the default system header directories, the include server runs the compiler once for each language needed during its session. This message indicates that the compiler specified todistccis not present on the client.Preprocessing locally. Include server not covering: Bailing out because include server spent more than ...s user time handling requestβ In uncommon situations, the include server fails to analyze very complicated macro expressions. Thedistccclient will use plaindistccmode.Warning: Filepath must be relative but isn'tβ The include server does not accept absolute filepaths, such as/usr/include/stdio.h, in include directives, because there is no guarantee that this header on the compilation server machine will be the same as that on the client. The include server gives up analyzing the include closure. Thedistccclient cannot use pump-mode.
To overcome this problem in a not always reliable way, set the environment variable INCLUDE_SERVER_ARGS='--unsafe_absolute_includes' when invoking the pump script to pass the --unsafe_absolute_includes option to the include server.
Warning: Absolute filepath ... was IGNOREDβ The--unsafe_absolute_includesis in use. This situation happens under the same circumstances as when"Filepath must be relative but isn't"is issued, but in this case the include will provide an answer to thedistccclient.Warning: Path '/PATH/FILE' changed/came into existence/no longer existsβ These warnings are issued when using stat reset triggers. Because/PATH/FILEchanged, the include server clears its caches; the new version of the file (or the lack of it) renders the include analysis invalid. This message can usually be ignored; it does signify a somewhat precarious use of files by the build system. It is recommended to fix the build system so that files are not rewritten.Warning: For translation unit ..., lookup of file ... resolved to ... whose realpath is ...β This warning occurs with--path_observation_rewhen a new realpath matching a source or header file is observed.
π DISTCC DISCREPANCY SYMPTOMS π
okay so the build system, distcc, and the include server are doing a little too much together, and sometimes that trio has drama π
. When a distcc command gets a failing compilation from the remote server, it retries the compilation locally. This section is all about why remote and local compilation can disagree. These discrepancies get flagged by the demotion message:
Warning: ... pump-mode compilation(s) failed on server, but succeeded locally.
Distcc-pump was demoted to plain mode. See the Distcc Discrepancy Symptoms section in the include_server(1) man page.
The pump script drops this message at the end of the build. Translation: for at least one distcc invocation, a local compilation succeeded after the remote compilation failed π. Each distcc invocation where that kind of discrepancy happened also issues a message like:
Warning: remote compilation of '...' failed, retried locally and got a different result.
The demotion makes later distcc invocations use plain distcc mode. So preprocessing will happen on the local machine for the rest of the build. This technique prevents very slow builds where every compilation ends up on the local machine after failing remotely. Iconic little safety net, honestly π«Ά.
Of course, if the local compilation fails after the remote failures, then the distcc invocation exits with the non-zero status of the local compilation. The error messages printed are also those of the local compilation. No cap.
The fallback behavior for distcc-pump mode to local compilation can be disabled by setting the environment variable DISTCC_FALLBACK to 0, which makes the distcc command fail as soon as the remote compilation has failed π₯. This setting is very useful for debugging why the remote compilation went wrong, because now the output from the server will be printed. Debugging main character energy.
Next we discuss the possible causes of discrepancies.
- The user changed a source or header file during the build. This yields inconsistent results of course. Classic chaos.
- A source or header file changed during the build. The build system rewrites a file. For Linux kernel 2.6, this happens for
include/linux/compile.handinclude/asm/asm-offsets.h. This condition is fixed by letting the include server know that it must reset its caches when a stat of any of the files changes. Practically, this is done by gathering the files in a colon-separated list and then setting theINCLUDE_SERVER_ARGSenvironment variable when invoking the pump script, so that it passes the--stat_reset_triggersoption; for example,
INCLUDE_SERVER_ARGS="--stat_reset_triggers=include/linux/compile.h:include/asm/asm-offsets.h"
- A header file is potentially included, but does not exist, and is then later included. This occurs when some header
foo.hincludes another header filetrick.h, but thetrick.hfile has not yet been generated and the inclusion is actually ignored because of preprocessing directives. The include server will probe for the existence oftrick.h, because it overapproximates all possible ways directives actually evaluate. The filetrick.his determined not to exist. If it is later generated, and then really included, then the include server will falsely believe that the file still does not exist π. The solution to this problem is to make the build system generatetrick.hbefore the first time any header file is included that makes a syntactic reference totrick.h. - The include server was started with
--unsafe_absolute_includes. This is a problem if there are header files locally that do not exist remotely and that are actually used. Such includes are often protected by conditional directives that evaluate so that they are actually used only on specific and often uncommon platforms. If you are not compiling for such a platform, then it may be correct to use--unsafe_absolute_include. - The include server has calculated the wrong includes. We do not know of such a situation. Mystery behavior, allegedly not a thing.
πͺ EXIT CODES πͺ
The exit code of include_server.py is usually 0. That the include server has been started properly is communicated through the existence of the pid_file. Subtle, but valid.
π± ENVIRONMENT VARIABLES π±
DISTCC_EMAILLOG_WHOM_TO_BLAMEβ the email address to use for include server automated emails. The default is'distcc-pump-errors'(which is an email address that probably will not exist in your domain). lol.
Additionally, the invocation of the compiler may use additional environment variables.
π BUGS π
If you think you have found a distcc bug, please see the file reporting-bugs.txt in the documentation directory for information on how to report it. Do it properly, bestie.
In distcc-pump mode, the include server is unable to handle certain very complicated computed includes as found in parts of the Boost library. The include server will time out and distcc will revert to plain mode.
Other known bugs may be documented on http://code.google.com/p/distcc/
π AUTHOR π
The include server was written by Nils Klarlund, with assistance from Fergus Henderson, Manos Renieris, and Craig Silverstein. Please report bugs to <distcc@lists.samba.org>. Collab royalty.
π LICENCE π
You are free to use distcc. distcc (including this manual) may be copied, modified or distributed only under the terms of the GNU General Public Licence version 2 or later. distcc comes with absolutely no warrany. A copy of the GPL is included in the file COPYING.
π SEE ALSO π
distcc(1), distccd(1), include_server(1), and gcc(1).
http://code.google.com/p/distcc/ https://ccache.dev/
okay that's the whole page, bestie β footer cuteness: include_server(1) and 9 June 2008 πβ¨π
π¦ where this page comes from
- alpine 3.22: distcc-doc 3.4-r9 Β· GPL-2.0-or-later
- alpine 3.23: distcc-doc 3.4-r9 Β· GPL-2.0-or-later
- alpine 3.24: distcc-doc 3.4-r10 Β· GPL-2.0-or-later
- arch rolling: distcc 3.4-16 Β· GPL-2.0-only
- epel 10: distcc 3.4-9.el10_1 Β· GPL-2.0-or-later
- epel 9: distcc 3.4-9.el9 Β· GPL-2.0-or-later
- fedora 43: distcc 3.4-12.fc43 Β· GPL-2.0-or-later
- fedora 44: distcc 3.4-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: distcc 3.4
- nixpkgs unstable: distcc 3.4
- opensuse-leap 16.0: distcc-server 3.4-bp160.1.10 Β· GPL-2.0-or-later
- opensuse-leap 16.0: distcc-server 3.4-bp160.1.10 Β· GPL-2.0-or-later
- opensuse-leap 16.0: distcc-server 3.4-bp160.1.10 Β· GPL-2.0-or-later
- opensuse-leap 16.0: distcc-server 3.4-bp160.1.10 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms