include_server(1) | General Commands Manual | include_server(1) |
include_server.py - conservative approximation of include dependencies for C/C++
include_server --port INCLUDE_SERVER_PORT [OPTIONS]
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.
The INCLUDE_SERVER_PORT argument is the name of a socket used for all communication between distcc clients and the include server. The distcc-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.
If the include server is not able to process the request, then it returns the empty list to the distcc client.
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.
The following options are understood by include_server.py.
The most likely messages and warnings to come from the include processor are listed below.
The interactions between the build system, distcc, and the include server is somewhat complex. When a distcc commands receives a failing compilation from the remote server it retries the compilation locally. This section discusses the causes of discrepancies between remote and local compilation. These are 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 distcc-pump script issues this message at the end of the build. This means that for at least one distcc invocation a local compilation succeeded after the remote compilation failed. Each distcc invocation for which such a discrepancy occurred in turn also issues a message such as:
Warning: remote compilation of '...' failed, retried locally and got a different result.
The demotion makes subsequent distcc invocations use plain distcc mode. Thus preprocessing will take place on the local machine for the remainder of the build. This technique prevents very slow builds where all compilations end up on the local machine after failing remotely.
Of course, if the local compilations 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.
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.
Next we discuss the possible causes of discrepancies.
INCLUDE_SERVER_ARGS="--stat_reset_triggers=include/linux/compile.h:include/asm/asm-offsets.h"
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.
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).
Additionally, the invocation of the compiler may use additional environment variables.
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.
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/
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>.
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.
distcc(1), distccd(1), include_server(1), and gcc(1). http://code.google.com/p/distcc/ http://ccache.samba.org/
9 June 2008 |