Re: distcc doesn't read /etc/distcc/hosts when started by rpmbuild

Sam Varshavchik <[email protected]> Tue, 16 Jun 2015 23:08:59 -0400
Newsgroups gmane.comp.compilers.distcc
Message-ID <[email protected]>
This is a MIME GnuPG-signed message.  If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.

--===============0392638471253430205==
Content-Type: multipart/signed;
    boundary="=_monster.email-scan.com-13458-1434510539-0001";
    micalg=pgp-sha1; protocol="application/pgp-signature"

This is a MIME GnuPG-signed message.  If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.

--=_monster.email-scan.com-13458-1434510539-0001
Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Sam Varshavchik writes:

> Yassine ILMI writes:
>
>> 3 - I prefer to configure distcc using environment variable directly i=
n a =20
>> file and source it when needed. You should check if the session used t=
o run =20
>> rpmbuild also have distcc environment variables set.
>
> I did check directly what environment the distcc process inherited. It =
did =20
> not have DISTCC_HOSTS set.

After receiving some emailed tips, I'm still not really any closer to =20
figuring out what's going on.

$ distcc --show-hosts
monster.email-scan.com:3632/6,lzo
localhost/4

This looks fine, and, as I said, manually running make directly ends up =20
correctly farming out six out of ten concurrent builds to the server.

But, during an rpmbuild, all compiles still run only on localhost. I've s=
et =20
DISTCC_LOG and DISTCC_VERBOSE, and the resulting log file doesn't have =20
anything obvious in it, except for the fact that it logs localhost compil=
es =20
only. There's some cruft at the start of the log file, due to test compil=
es =20
by the autoconf script. Then, we get to this part:

distcc[2954] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2954] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2954] (main) compiler name is "distcc"
distcc[2954] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/button.o /home/mrsam=
/.ccache/tmp/button.stdout.octopus.email-scan.com.2894.UtB9Xa.ii
distcc[2954] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2954] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2954] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2954] (dcc_lock_host) got cpu lock on localhost slot 2 as fd5
distcc[2954] exec on localhost: /usr/bin/g++ -O2 -g -pipe -Wall -Werror=3D=
format-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-stro=
ng --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches -specs=3D/usr/lib/=
rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -std=3Dc++1y -fno-om=
it-frame-pointer -fPIC -c -o .libs/button.o /home/mrsam/.ccache/tmp/butto=
n.stdout.octopus.email-scan.com.2894.UtB9Xa.ii
distcc[2954] (dcc_note_state) note state 5, file "(NULL)", host "localhos=
t"
distcc[2954] (dcc_spawn_child) forking to execute: /usr/bin/g++ -O2 -g -p=
ipe -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -f=
stack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switche=
s -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric =
-std=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/button.o /home/mrs=
am/.ccache/tmp/button.stdout.octopus.email-scan.com.2894.UtB9Xa.ii
distcc[2954] (dcc_spawn_child) child started as pid2957
distcc[2957] (dcc_increment_safeguard) setting safeguard: _DISTCC_SAFEGUA=
RD=3D1
distcc[2975] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2975] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2975] (main) compiler name is "distcc"
distcc[2975] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/border.o /home/mrsam=
/.ccache/tmp/border.stdout.octopus.email-scan.com.2920.cYmPvb.ii
distcc[2975] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2975] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2975] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2975] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2975] (dcc_lock_host) got cpu lock on localhost slot 3 as fd5
distcc[2975] exec on localhost: /usr/bin/g++ -O2 -g -pipe -Wall -Werror=3D=
format-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-stro=
ng --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches -specs=3D/usr/lib/=
rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -std=3Dc++1y -fno-om=
it-frame-pointer -fPIC -c -o .libs/border.o /home/mrsam/.ccache/tmp/borde=
r.stdout.octopus.email-scan.com.2920.cYmPvb.ii
distcc[2975] (dcc_note_state) note state 5, file "(NULL)", host "localhos=
t"
distcc[2975] (dcc_spawn_child) forking to execute: /usr/bin/g++ -O2 -g -p=
ipe -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -f=
stack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switche=
s -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric =
-std=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/border.o /home/mrs=
am/.ccache/tmp/border.stdout.octopus.email-scan.com.2920.cYmPvb.ii
distcc[2975] (dcc_spawn_child) child started as pid2978
distcc[2978] (dcc_increment_safeguard) setting safeguard: _DISTCC_SAFEGUA=
RD=3D1
distcc[2982] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2982] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2982] (main) compiler name is "distcc"
distcc[2982] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/attachedpopup.o /hom=
e/mrsam/.ccache/tmp/attachedpo.stdout.octopus.email-scan.com.2895.K9IKza.=
ii
distcc[2982] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[2982] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[2991] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2991] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2991] (main) compiler name is "distcc"
distcc[2991] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/cachedfont.o /home/m=
rsam/.ccache/tmp/cachedfont.stdout.octopus.email-scan.com.2922.3Dmj8a.ii
distcc[2991] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2991] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2991] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2991] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2991] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[2991] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[2992] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2992] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2992] (main) compiler name is "distcc"
distcc[2992] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -c -o background.o /home/mrsam/.ccache=
/tmp/background.stdout.octopus.email-scan.com.2972.CeRBcF.ii
distcc[2992] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2992] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2992] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2992] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2992] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[2992] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[2993] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[2993] (dcc_recursion_safeguard) safeguard level=3D0
distcc[2993] (main) compiler name is "distcc"
distcc[2993] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -c -o canvas.o /home/mrsam/.ccache/tmp=
/canvas.stdout.octopus.email-scan.com.2956.x28TAG.ii
distcc[2993] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[2993] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2993] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2993] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2993] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[2993] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[3072] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[3072] (dcc_recursion_safeguard) safeguard level=3D0
distcc[3072] (main) compiler name is "distcc"
distcc[3072] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/colormap.o /home/mrs=
am/.ccache/tmp/colormap.stdout.octopus.email-scan.com.3047.YkKHRi.ii
distcc[3072] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[3072] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[3072] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[3072] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[3072] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[3072] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[2982] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy
distcc[2982] (dcc_lock_pause) nothing available, sleeping 1s...
distcc[3073] (dcc_trace_version) distcc 3.2rc1 x86_64-redhat-linux-gnu; b=
uilt Mar 12 2015 19:45:38
distcc[3073] (dcc_recursion_safeguard) safeguard level=3D0
distcc[3073] (main) compiler name is "distcc"
distcc[3073] (dcc_scan_args) scanning arguments: /usr/bin/g++ -O2 -g -pip=
e -Wall -Werror=3Dformat-security -D_FORTIFY_SOURCE=3D2 -fexceptions -fst=
ack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches =
-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric -s=
td=3Dc++1y -fno-omit-frame-pointer -fPIC -c -o .libs/connection.o /home/m=
rsam/.ccache/tmp/connection.stdout.octopus.email-scan.com.3069.tuKDvr.ii
distcc[3073] (dcc_scan_args) -specs=3D/usr/lib/rpm/redhat/redhat-hardened=
-cc1 must be local
distcc[3073] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_0 is =
busy
distcc[3073] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_1 is =
busy
distcc[3073] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_2 is =
busy
distcc[3073] (dcc_lock_host) /home/mrsam/.distcc/lock/cpu_localhost_3 is =
busy

And =E2=80=A6that's it. Looks like distcc is only aware of the four local=
host slots, =20
for some reasons.

I tried to check if there's anything funky in the rpmbuild environment. =20
Maybe rpmbuild sets up some funky mock chroot, so I shoved a distcc --sho=
w-=20
hosts into the rpm spec build script. The results:

+ umask 022
+ cd /home/mrsam/src/libcxxw-work/rpm/BUILD
+ cd libcxxw-0.1
+ distcc --show-hosts
monster.email-scan.com:3632/6,lzo
localhost/4
+ /usr/bin/make -j 10
make[1]: Entering directory '/home/mrsam/src/libcxxw-work/rpm/BUILD/libcx=
xw-0.1'

=E2=80=A6

Followed by the build. That still looks perfectly fine for me. And the =20
server is waiting with open arms:

$ telnet monster.email-scan.com 3632
Trying 192.168.0.2=E2=80=A6
Connected to monster.email-scan.com.
Escape character is '^]'.

Yet, the client still stubbornly sticks to four localhost slots. It has t=
o =20
be something in the rpmbuild environment, because everything works fine w=
hen =20
I build directly from source. Just can't figure out what it is.


--=_monster.email-scan.com-13458-1434510539-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJVgOTLAAoJEGs6Yr4nnb8lRlIP/3GtWynP/BtuRrJ8usaPQHLN
UyZCkJbVvkSm61JVIkqiVfgD9ErNEZO5uiydyBi2JtxXIGrWUmRNl+t6Ow0hWmYN
APyfdN3kZ7x6kZpyMCpdxBwS/sh8ze4mzbYN0pZlOBPD1zcALA1Zvk+7nc0+DpCW
Ux2ca6tmpPBIJd8a0Shd5orkAbl7Nz8YometT6FGqqSN8MnCnL2p0TI3vR+BPDfq
BJJyB0X8Sae9p9jT0Oet0JbrIoaz38AchlfgjR04ikgGoKqqGz/+rjz187VDcnjL
A98iwtwNzBvq/ZKSKXSzqUlgCSM5Ka9Mjc2lQPFEte+YWKcr4qlmSKdnMo5iJNxb
uTj6MmWuwVmVcnvwdV9K9h9FZ9OpbNm8oWmg5chIaiB9zErimQnMzcWU5STpdhIq
7bezHUk9yHFLePI5GMpSoW7lfnvtYFd0Zsb4u57TsZJgKx2WANNUCdIvjhKHHJBp
T2J1AufusOrSydBaNIVW7UeQnwlkY2C688Yg4C/NIA6u9+3N+nx4vi8tKlXdQlYR
Dup7gdJMNnCBahQJ6BQ+t+Nc67Gj5nKc4Tkk/VbRA8nNGDDrozZpMnNnHXK/knqg
UWTCDJBx9tNIqCCwzko7Awr13K1k5aa7/818Srs+d2hmupeHyJfEUwmQ125VOUVI
Y/99XnPhRTxDv80HT0Au
=P/kv
-----END PGP SIGNATURE-----

--=_monster.email-scan.com-13458-1434510539-0001--

--===============0392638471253430205==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options:
https://lists.samba.org/mailman/listinfo/distcc
--===============0392638471253430205==--