[distcc] re: distributed compiler cache
mbp at samba.org
Thu Sep 12 13:00:00 GMT 2002
On 12 Sep 2002, joerg.beyer at email.de wrote:
> MartinPool <mbp at samba.org> schrieb am 12.09.02 14:04:03:
> > On 12 Sep 2002, Joerg Beyer <j.beyer at web.de> wrote:
> > > is that enough? It at least leave a small window between open() and
> > > the ioctl() for a race condition. I dont what to be academic but...
> > I think the lock_fd will suffice to serialize access to the file.
> > Since they don't do anything between opening the file and locking it
> > I'm not sure the window matters. Can you step through the race you
> > think could cause a problem?
> ok, now I see: if one process has a stats file locked and another
> process will lock the same stats file, than the second process
> will silently fail, because the fcntl(fd, F_SETLKW, &fl) in
> util.c:lock_fd() will fail. Is this a problem? I am not sure.
It won't fail. It will pause until the lock can be taken.
> > > Martin, in your private mail from 8/31/2002 you indicated that
> > > using ccache by multiple users on the same machine at the same
> > > time with unhappy timing will lead to problems. Do you think it is
> > > okay to use ccache as describe by a group of developers?
> > I think what I said was that I didn't know if it was a supported
> > configuration. File permissions may or may not cause a problem. I
> > haven't really looked in detail.
> if the developers share a unix group (which seems resonable if they
> work on the same project), then you at least could build something:
> the don disk cache could use this group and ensure group read/write
> permissions - I have not checked this.
> ccache and/or distcc could have the group sticky bit set.
> > If ccache is called by distccd as I suggest, then everything will
> > happen in the same uid and it should be no different to a single user
> no - without chmod g+sx ccache and/or distcc each
> distcc and ccache process wil run with the uid of the calling
No, distccd always runs with whatever privileges its parent gave it.
It doesn't matter who the client runs as.
At work we have several build machines which are shared by my
colleague and I. They run as me, but they work for both of us. If
they ran ccache through distccd it would work just as well.
More information about the distcc