Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 68716 - the distcc ebuild should add PATH and ROOTPATH to 02distcc
Summary: the distcc ebuild should add PATH and ROOTPATH to 02distcc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Markus Nigbur (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 70427
  Show dependency tree
 
Reported: 2004-10-24 09:46 UTC by rojaro
Modified: 2005-06-26 10:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rojaro 2004-10-24 09:46:01 UTC
The distcc ebuild should add PATH and ROOTPATH variables to 02distcc e.g.:

PATH="/usr/lib/distcc/bin"
ROOTPATH="/usr/lib/distcc/bin"

this enables the use of distcc with automake so you dont have to set it up manually.

Reproducible: Always
Steps to Reproduce:
Comment 1 rojaro 2004-10-24 13:34:17 UTC
Sidenote: If ccache creates a file 01ccache and puts in the same variables with the ccache paths, then even ccache will be used automatically.
Comment 2 Lisa Seelye (RETIRED) gentoo-dev 2004-10-25 15:22:11 UTC
Enlighten me a bit,

What is this for? How does automake use ROOTPATH?
Comment 3 rojaro 2004-10-25 16:37:31 UTC
This is actually not limited to automake but works with pretty much anything that just calls 'gcc' (and c++, cc, g++ etc.) to do the compilation. But this is a really simple and clean method to make distcc work with almost everything that uses gcc.

The PATH environment for the root user is in part defined by ROOTPATH and for the normal user by the PATH variable. env-update parses all the files within /etc/env.d and compiles the /etc/profile.env file in the order the files are numbered. So it parses /etc/env.d/02distcc before /etc/env.d/05gcc and therefore puts the real gcc path after the distcc path in the /etc/profile.env file. This one gets parsed by /etc/profile and depending on wether the user is 'root' or not, it uses either the PATH or the ROOTPATH variable to create the users final PATH environment variable. 

As noted in my comment after the feature request, i added the PATH and ROOTPATH variables (containing "/usr/lib/ccache/bin") for ccache by manually creating a file /etc/env.d/01ccache. So the final PATH variable for my root account on my machines looks like this:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/lib/ccache/bin:/usr/lib/distcc/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3

As expected, the gcc compiler is the last in the list. So if some "script" (or user or whatever) calls gcc, ccache gets executed first, which then executes distcc, which finally runs gcc as needed. This pretty much totally simplifies the whole installation process of distcc to just emerging it and it will work with everything that just calls 'gcc' (and also works transparently with ccache).
Comment 4 Lisa Seelye (RETIRED) gentoo-dev 2004-12-14 14:32:59 UTC
Markus? can you slide this in with the proposed rewrite in bug 70427? Thanks!
Comment 5 Markus Nigbur (RETIRED) gentoo-dev 2005-06-26 10:01:23 UTC
Fixed with version 1.3