Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29171 - Patch for portage.py to extend distcc support
Summary: Patch for portage.py to extend distcc support
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High major
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 28411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-19 23:24 UTC by Lisa Seelye (RETIRED)
Modified: 2011-10-30 22:20 UTC (History)
1 user (show)

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


Attachments
Patch for Portage.py (distcc_dir.patch,1.41 KB, patch)
2003-09-19 23:25 UTC, Lisa Seelye (RETIRED)
Details | Diff
Patch for portage.py (DISTCC_DIR.patch,1.10 KB, patch)
2003-09-20 03:26 UTC, Markus Nigbur (RETIRED)
Details | Diff
Patch for portage.py (DISTCC_DIR.patch,1.19 KB, patch)
2003-09-20 21:56 UTC, Markus Nigbur (RETIRED)
Details | Diff
Fixed, as per Martin's suggested 02755 mode. (portage.py.patch,1.20 KB, patch)
2003-09-22 13:58 UTC, Lisa Seelye (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lisa Seelye (RETIRED) gentoo-dev 2003-09-19 23:24:37 UTC
Markus wrote a patch for portage (based on 2.0.49-r4) to extend Portage's 
functionality for distcc.

My plans for distcc are to further integrate Portage and Distcc so the user 
doesn't have to do any extra setup, aside from setting the hosts.

To wit, the patch necessitates changes to /etc/make.globals to add:

# Define DISTCC_DIR - a place to place distcc state files
# /var/tmp/portage/.distcc is ideal default
DISTCC_DIR="${PORTAGE_TMPDIR}/portage/.distcc"

And the patch is applied to portage.py.

This is marked as "major" since I'm waiting on this to be put into ~x86 to 
release distcc 2.10.1 (and soon to be 2.10.2) and a bump is made to 2.10-r3 to 
stable.

I'm CCing Markus since he wrote the patch. =)
Comment 1 Lisa Seelye (RETIRED) gentoo-dev 2003-09-19 23:25:11 UTC
Created attachment 18012 [details, diff]
Patch for Portage.py
Comment 2 Markus Nigbur (RETIRED) gentoo-dev 2003-09-20 03:26:55 UTC
Created attachment 18018 [details, diff]
Patch for portage.py

cleaned it up a bit.
Comment 3 Marius Mauch (RETIRED) gentoo-dev 2003-09-20 04:13:42 UTC
*** Bug 28411 has been marked as a duplicate of this bug. ***
Comment 4 Martin Pool 2003-09-20 16:30:54 UTC
Why do you make the directory setuid???
Comment 5 Lisa Seelye (RETIRED) gentoo-dev 2003-09-20 17:20:05 UTC
It shouldn't be.  Markus, can you fix it, make it 0644?
Comment 6 Markus Nigbur (RETIRED) gentoo-dev 2003-09-20 21:56:36 UTC
Created attachment 18061 [details, diff]
Patch for portage.py

Don't ask my what i were thinking about.
Comment 7 Lisa Seelye (RETIRED) gentoo-dev 2003-09-20 22:29:05 UTC
BTW, Something in Portage is invoking gcc first and putting a file in /var/tmp/portage/.distcc/lock.  This is causing problems with distcc (permission denied), since the lock file is created by root.
Comment 8 Martin Pool 2003-09-21 17:44:24 UTC
The directories should have mode 0755, or perhaps 02755.  Directories with mode 0644 are not executable and therefore nobody can access files which are inside them.

Just to recap:

setgid on a directory means newly created children have the same gid as the directory, not the parent that created them.

setuid on a directory makes people scratch their heads. :-)

read bit on a directory gives permission to list it.

execute bit gives permission to open files in the directory.

Lisa's assessment that somebody is creating a lock file in there by running as a different user is probably correct.  That's probably a bad thing for portage to do, and I think you should investigate it.  However, distcc should perhaps try to be more forgiving of different users sharing a directory.  I will think about what can be done there.
Comment 9 Lisa Seelye (RETIRED) gentoo-dev 2003-09-22 13:58:11 UTC
Created attachment 18148 [details, diff]
Fixed, as per Martin's suggested 02755 mode.

This patch along with the patch in bug 29313, and adding 

  DISTCC_DIR="${PORTAGE_TMPDIR}"/portage/.distcc

to /etc/make.globals will integrate distcc with Portage.  The user will just
have to emerge distcc, put distcc in FEATURES and set hosts.  No more funky
DISTCC_HOSTS setting in env files or make.conf.
Comment 10 Nicholas Jones (RETIRED) gentoo-dev 2003-09-23 10:31:19 UTC
Default is handled in ebuild.sh.
make.conf is for user changes.