FS#72532 - makepkg does not set the compiler correctly when using distcc and CMake
Attached to Project:
Pacman
Opened by Nicola Mori (snack) - Sunday, 24 October 2021, 10:11 GMT
Last edited by Jonas Witschel (diabonas) - Tuesday, 02 November 2021, 10:30 GMT
Opened by Nicola Mori (snack) - Sunday, 24 October 2021, 10:11 GMT
Last edited by Jonas Witschel (diabonas) - Tuesday, 02 November 2021, 10:30 GMT
|
Details
Description:
I found this issue when playing with Archlinux ARM (see https://archlinuxarm.org/forum/viewtopic.php?f=57&t=15559) but I guess it's a problem with makepkg itself. In the wiki it is written that to use distcc with makepkg it is sufficient to add distcc to BUILDENV, but I found that doing so and then building a package based on CMake the compiler is set to cc/c++ and not to distcc. This causes the compilation to be done locally, completely bypassing distcc. Setting CC and CXX to distcc before launching makepkg makes everything work as expected, so I'd say that makepkg fails to apply these settings when distcc is added to BUILDENV. Additional info: distcc 3.4-3 * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: 1) setup distcc on one machine to work both as client and volunteer 2) set distcc in makepkg.conf as described in the Arch wiki 3) download a CMake AUR package (e.g. plasma-bigscreen-git) 4) launch makepkg and check for the compiler settings in CMake output; it will be something like "-- Check for working C compiler: /usr/bin/cc" 5) set CC and CXX to distcc, then makepkg -C, then check CMake output: "-- Check for working C compiler: /usr/bin/distcc" |
This task depends upon
Closed by Jonas Witschel (diabonas)
Tuesday, 02 November 2021, 10:30 GMT
Reason for closing: Not a bug
Additional comments about closing: prepare() should be used for making modifications to the source files. build configure should be done in build().
Tuesday, 02 November 2021, 10:30 GMT
Reason for closing: Not a bug
Additional comments about closing: prepare() should be used for making modifications to the source files. build configure should be done in build().
export PATH="/usr/lib/distcc/bin:$PATH"
Why is /usr/lib/distcc/gcc etc not being picked up by CMake?
export PATH=/usr/lib/distcc/bin:$PATH
before running makepkg then I get:
-- Check for working C compiler: /usr/lib/distcc/bin/cc
But if I simply set in makepkg.conf:
BUILDENV=(distcc color ccache check !sign)
then CMake says:
-- Check for working C compiler: /usr/bin/cc
I tried also to remove ccache from BUILDENV to see it it conflicts with distcc, to no avail.
I'm not an expert of creating PKGBUILDs so I cannot tell if configuring a build in prepare() is not correct or if really there is a bug in the program flow of makepkg that calls buildenv_distcc() too late.