[ccache] gmake and ccache conspiring together in creating gremlins
Sam Varshavchik
sam.varshavchik at gmail.com
Sun Feb 7 15:45:20 UTC 2021
On Sun, Feb 7, 2021 at 7:59 AM Joel Rosdahl <joel at rosdahl.net> wrote:
> From my perspective, I don't see anything wrong with ccache dup-ing stderr – I
> guess the bug can be triggered by the user running something like
>
> exec 3>&2
>
> in the shell as well.
>
> I can think of an easy workaround for the problem: only dup2 stderr when running
> the preprocessor or compiler. Done in
> <https://github.com/ccache/ccache/commit/c4284c78e9ff286ee5208f449af4c2aaba062d37>.
In the interim I discovered a workaround that seems to work, for
anyone who's also affected by this. Instead of setting CCACHE_PREFIX
to distcc, I pointed CCACHE_PREFIX to this:
#! /bin/sh
unset MFLAGS ${!MAKE@}
exec distcc "$@"
This clears make variables from the environment and when the linker
invokes make for ...whatever it needs to invoke it for, against a
manufactured makefile it generates on the fly... it doesn't go look
for the job server file descriptors, and go sideways.
More information about the ccache
mailing list