Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 27432
Alias:
Product:
Component:
Status: CLOSED
Resolution: FIXED
Assigned To: Lisa Seelye (RETIRED) <lisa@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Markus Nigbur (RETIRED) <pYrania@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
distcc-config python rewrite text/plain Markus Nigbur (RETIRED) 2003-08-27 09:21 0000 3.49 KB Details
distcc-config python rewrite text/plain Markus Nigbur (RETIRED) 2003-08-29 20:38 0000 3.47 KB Details
distcc.patch Make /etc/distcc/hosts newline terminated. Enhanced Usage. patch Rob Davies 2003-09-11 06:21 0000 1.67 KB Details | Diff
distcc-config python rewrite application/octet-stream Markus Nigbur (RETIRED) 2003-09-19 17:02 0000 4.24 KB Details
distcc-config python rewrite application/octet-stream Markus Nigbur (RETIRED) 2003-10-06 04:36 0000 4.55 KB Details
distcc-config python rewrite text/plain Markus Nigbur (RETIRED) 2003-10-17 03:10 0000 4.58 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 27432 depends on: Show dependency tree
Bug 27432 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.




View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2003-08-27 09:20 0000
initial release :)

------- Comment #1 From Markus Nigbur (RETIRED) 2003-08-27 09:21:17 0000 -------
Created an attachment (id=16695) [details]
python rewrite

------- Comment #2 From Lisa Seelye (RETIRED) 2003-08-27 09:22:32 0000 -------
Hi yall, please test this. :)

------- Comment #3 From Disenchanted (RETIRED) 2003-08-29 10:21:30 0000 -------
distcc-config when invoked w/o options should list the available option as
--help does, as distcc-config w/o options has no use

------- Comment #4 From Markus Nigbur (RETIRED) 2003-08-29 20:38:14 0000 -------
Created an attachment (id=16792) [details]
python rewrite

thanks, included.

------- Comment #5 From Lisa Seelye (RETIRED) 2003-09-09 10:25:59 0000 -------
--get-hosts and --set-hosts should not print anything ("such and such is...").

DISTCC_DIR would be great if it could be a global constant so its a bit easier to change.  If DISTCC_DIR does not exist it must be created with 1777 perms, owned by root (in the functions --set-env and --install and whatever.)

The config needs a --set-env command:  --set-env FOO VALUE will update /etc/env.d/02_distcc to include FOO=VALUE.



It also needs a Gentoo header. :)

------- Comment #6 From Rob Davies 2003-09-11 06:21:47 0000 -------
Created an attachment (id=17490) [details]
Make /etc/distcc/hosts newline terminated. Enhanced Usage.  

The patch though small was tested with emerge.

------- Comment #7 From Rob Davies 2003-09-11 06:25:14 0000 -------
I've tried it out, and I found a few things, perhaps because I am using distcc 
for first time, so had no expectations about how it would work.  These are my 
impressions  :) 
 
The patch is to address points 1) & 4) only. 
 
By the way, it has set me up, which is the main thing, and though I've a few 
points, that's inevitable once I had to tinkering with the source.  Let me know 
if you'ld like further submissions, addressing issues I've pointed out (yes, 
even the dreaded documentation). 
 
 
1)  The --install option seems necessary, and it's not in Usage 
 
 
2)  Documentation Guide http://www.gentoo.org/doc/en/distcc.xml 
 
I found I needed to look at the script source to figure out how to use it. 
 
a) I set the hosts, got the print message and nothing happened.  Looks like 
--install is necessary.  There wasn't a file made if I --set-hosts.  The 
section on bootstrapping with distcc does have a mention of --install. 
 
b) Server side; the guide should explain that distccd needs to be set up, 
minimum reminder about /etc/{conf,init}.d/distc, and hint about adding distcdd 
to runlevel. 
 
c) Quote terminator missing? 
 
Code listing 2.3: Sample command to set the hosts 
 
# /usr/bin/distcc-config --set-hosts "192.168.0.1 192.168.0.2 192.168.0.3 
 
d) No mention of log file 
 
 
3)  Using the --set-verbose 1 option to see what going on I got : 
 
oak gentoo # python distcc-config.py --set-verbose 1 --install 
Traceback (most recent call last): 
  File "distcc-config.py", line 88, in ? 
    writeenv('DISTCC_VERBOSE',tmpcmdline[1]) 
  File "distcc-config.py", line 37, in writeenv 
    distcc_env    = open(envfile, 'r').readlines() 
IOError: [Errno 2] No such file or directory: '/etc/env.d/02distcc' 
oak gentoo # python distcc-config.py --install 
Creating /etc/env.d/02distcc ... 
 
Looks like account should be taken that /etc/env.d/02distcc may not exist. 
 
 
4) /etc/distcc/hosts 
 
It's entry is written without a \n line terminator, this confused my vi editor 
(nvi), unlike  nano it didn't display anything, which seems to add termination 
to last line if missing. 
 
 
5) On the interface design. 
 
I'm not sure why it's necesary to make options mutually exclusive.  For example 
it ought to be perfectly reasonable to : 
 
distcc-config --install --set-hosts "127.0.0.2/4 10.0.0.1/2 10.0.0.2/2" 
 
As it is, the user has to run distcc-config multiple times, and understand that 
it's actually creating various environment files.  If fact, why doesn't 
--set-hosts implicitly do a --install, if stuff is missing?  It's what the user 
wants to do!  Perhaps distcc-config --install host1 host2/2 .. hostN, then you 
can have a sensible default for : 
 
distcc-config 10.0.0.9/4 10.0.0.8/2 10.0.0.7/2 
 
Wouldn't that be the most common usage?  Most users won't change the log file, 
or verbosity, and not providing short flag alternatives adds error prone 
typing. 
 
 
Standard kind of pattern for option processing flags and values is : 
 
Initalise option map to set defaults. 
loop through command line switches 
    validate option 
    If flag option 
       set options{ current } on 
    else 
       get option value 
       set options{ current } to option value 
 
Do processing modified by flags, for example are we listing or setting things?  
In C and perl there's access to standard modules getopt_long for arg processing 
which does help a fair bit.  I've just checked Programming Python, doesn't talk 
about it, but presumably there's some binding to get access to getopt_long(3) 
in glibc. The getopt_long() function works like getopt() except that it also 
accepts long options, started out by two dashes. Long option names may be 
abbreviated if the abbreviation is unique or is an exact match for some defined 
option. A long option may take a parameter, of the form --arg=param or --arg 
param. 

------- Comment #8 From Markus Nigbur (RETIRED) 2003-09-19 17:02:21 0000 -------
Created an attachment (id=18006) [details]
python rewrite

Issues of comment #5 fixed.
Added the new line character and fixed the 'usage' to uppercase as in the patch
of comment #6.

------- Comment #9 From Markus Nigbur (RETIRED) 2003-09-19 17:05:17 0000 -------
--install runs once to setup the initial distcc environment. it's called from
the distcc ebuild. All problems are related to the fact, that it wasn't called,
because the current distcc-config script handles the installation in several
subroutines.

------- Comment #10 From Lisa Seelye (RETIRED) 2003-10-04 10:31:41 0000 -------
if the user is not root, --set-hosts should set ~/.distcc/hosts

further

for --get-hosts, if 
$DISTCC_HOSTS is not null, return that, else
~/.distcc/hosts is not empty, return contents, else
return contents of /etc/distcc/hosts

------- Comment #11 From Markus Nigbur (RETIRED) 2003-10-06 04:36:47 0000 -------
Created an attachment (id=18852) [details]
python rewrite

your wish is my command.

------- Comment #12 From Markus Nigbur (RETIRED) 2003-10-11 01:47:36 0000 -------
Reminder:
Restart daemon after upgrade.

------- Comment #13 From Lisa Seelye (RETIRED) 2003-10-16 18:12:35 0000 -------
Also, DISTCC_DIR should be removed from the /etc/env.d/02distcc file.


	distcc_env.write('DISTCC_DIR="/tmp"\n')
	
	createdistccdir('/tmp')

can be removed

I also got this Traceback error when using the distcc-config in atttachment
18852 : (Use an unmodified 2.11 ebuild with this distcc-config)

Traceback (most recent call last):
  File "/usr/bin/distcc-config", line 111, in ?
    open(FILE, 'w').write(cmdline + '\n')
TypeError: can only concatenate list (not "str") to list

Furthermore, with a modified ebuild to just run --install this is the output:

Traceback (most recent call last):
  File "/usr/bin/distcc-config", line 111, in ?
    open(FILE, 'w').write(cmdline + '\n')
TypeError: can only concatenate list (not "str") to list
 * Installing links to native compilers...
Creating /etc/env.d/02distcc ...
Creating /usr/lib/distcc/bin/gcc symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/cc symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/c++ symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/g++ symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/i586-pc-linux-gnu-gcc symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/i586-pc-linux-gnu-c++ symlink...
Already exists. Skipping...
Creating /usr/lib/distcc/bin/i586-pc-linux-gnu-g++ symlink...
Already exists. Skipping...
Configuring /usr/lib/distcc/bin/.keep...
Configuring /usr/lib/distcc/bin/gcc...
Configuring /usr/lib/distcc/bin/cc...
Configuring /usr/lib/distcc/bin/c++...
Configuring /usr/lib/distcc/bin/g++...
Configuring /usr/lib/distcc/bin/i686-pc-linux-gnu-gcc...
Configuring /usr/lib/distcc/bin/i686-pc-linux-gnu-c++...
Configuring /usr/lib/distcc/bin/i686-pc-linux-gnu-g++...
Configuring /usr/lib/distcc/bin/i586-pc-linux-gnu-gcc...
Configuring /usr/lib/distcc/bin/i586-pc-linux-gnu-c++...
Configuring /usr/lib/distcc/bin/i586-pc-linux-gnu-g++...
Configuring /var/run/distccd/.keep...

---

Can the output be silenced a bit? And what's it doing to /var/run/distccd/.keep?

------- Comment #14 From Lisa Seelye (RETIRED) 2003-10-16 23:02:28 0000 -------
Also, DISTCC_LOG should not be set to anything by default.

------- Comment #15 From Markus Nigbur (RETIRED) 2003-10-17 03:10:12 0000 -------
Created an attachment (id=19348) [details]
python rewrite

fixed everything and added restart of distccd after call of --install. :)

------- Comment #16 From Lisa Seelye (RETIRED) 2003-10-18 13:19:12 0000 -------
Committed in CVS as distcc-2.11.1-r1, its in package.mask, so you will have
to force it:

  emerge /usr/portage/sys-devel/distcc/distcc-2.11.1-r1.ebuild


------- Comment #17 From Joe Stroller 2003-10-18 15:09:39 0000 -------
Have been testing here for the last 36 hours or so with compiles of a couple
of small apps, then kdelibs & glibc on different machines. Seem to work fine.

------- Comment #18 From Lisa Seelye (RETIRED) 2003-11-12 12:33:35 0000 -------
Just a formal reminder to create /etc/distcc or ~/.distcc if they aren't
present.

------- Comment #19 From Lisa Seelye (RETIRED) 2003-11-12 12:34:06 0000 -------
reopened waiting a fix for comment 18 :-)

------- Comment #20 From ferret 2003-11-12 17:19:59 0000 -------
I'm having a problem with the distccd init script not creating a pid file. I
did:  emerge =distcc-2.11.2 /sbin/depscan.sh # told me to do so at the end of
emerge, for some reason nano -w /etc/make.conf # added -jX to MAKEOPTS, added
distcc to FEATURES /usr/sbin/distcc-config --set-hosts "xxx.xxx.xxx.xxx ..."
/etc/init.d/distccd start # appears to work but doesn't create pidfile
/etc/init.d/distccd stop # "succeeds" but doesn't stop processes
/etc/init.d/distccd start # fails  Manually creating the pidfile containing the
correct value and it all works...

------- Comment #21 From ferret 2003-11-12 17:24:23 0000 -------
argh, links -g has retarded key bindings of some sort. My carriage returns were
destroyed. :|

------- Comment #22 From Markus Nigbur (RETIRED) 2003-11-16 15:21:53 0000 -------
worked.

marked stable in x86

------- Comment #23 From Lisa Seelye (RETIRED) 2003-11-21 20:46:53 0000 -------
this is in as distcc-2.11.2-r1

thanks a lot Markus and testers.

------- Comment #24 From Maurice van der Pot 2003-12-09 14:41:27 0000 -------
I have some additional comments about distcc-config.
I'm only using distcc with portage.

After I've emerged distcc, if I do (as root) distcc-config --get-hosts or distcc-config --set-hosts "10.0.0.2", I get errors. The error for --get-hosts looks sorta like this:

Traceback (...): 
blahblah... 
print rstrip(open('/etc/distcc/hosts', 'r').read()) 
blahblah no such file or directory

The message I get with --set-hosts is similar (although I don't think I saw a filename in that error message).

At this time the /etc/distcc directory does not exist.
If I create this directory and try again, only --get-hosts still fails (because the hosts file doesn't exist).

Once I've --set-hosts, also --get-hosts succeeds.

I think the script needs some additional checks.

# $Header: /home/cvsroot/gentoo-x86/sys-devel/distcc/files/2.11.1p/distcc-config,v 1.3 2003/12/06 17:31:04 lisa Exp $

How to reproduce (probably):
1) remove or rename /etc/distcc
2) run distcc-config --get-hosts or distcc-config --set-hosts "10.0.0.2"
3) mkdir /etc/distcc
4) run distcc-config --get-hosts

------- Comment #25 From Lisa Seelye (RETIRED) 2003-12-09 14:49:05 0000 -------
Markus?

------- Comment #26 From Markus Nigbur (RETIRED) 2003-12-11 07:52:17 0000 -------
nice catch. fixed it in cvs.

------- Comment #27 From Lisa Seelye (RETIRED) 2003-12-18 14:24:54 0000 -------
Nother bug.

Running distcc-config --install with no distcc user in the /etc/passwd (such as during bootstrap) results in:

Creating /etc/env.d/02.distcc...
Traceback...
   File "/usr/bin/distcc-config", line 134, in ?
     foobar = getpwnam('distcc')
KeyError: getpwnam(): name not found

------- Comment #28 From Lisa Seelye (RETIRED) 2003-12-18 14:38:50 0000 -------
Another bug:

# distcc-config --set-hosts " .... "
Traceback...
  File /usr/bin/distcc-config, line 153, in ?
    createdistccidr(PATH)
  File /usr/bin/distcc-config, line 85, in createdistccdir
    os.chmod(dir, '1777')
TypeError: an integer is required

This is on a bootstrap, with a virgin make.conf aside from FEATURES, MAKEOPTS, and USE changes.

/etc/distcc/ exists.

after this dir is created /var/tmp/portage/.distcc does not.

------- Comment #29 From Markus Nigbur (RETIRED) 2003-12-19 03:49:02 0000 -------
lisa, what distcc-config cvs revision were you using at comment #28?
I just fixed this 7 days ago.

the one in comment #27.. well we should consider an additional flag for bootstrapping or something. isn't --install called while using the distcc ebuild from bootstrap?

i actually hadn't the time to test the script while bootstrapping.

.. i'll catch you on irc.

------- Comment #30 From Vaclav Slavik 2003-12-26 08:35:51 0000 -------
> lisa, what distcc-config cvs revision were you using at comment #28?
> I just fixed this 7 days ago.

But it is still in Portage tree fetched via rsync, today.

------- Comment #31 From Joshua Kinard 2003-12-27 15:18:19 0000 -------
Here's an obscure bug.

If /etc/distcc does not exist, then invoking:
distcc-config --set-hosts "hostname>/<num jobs>" will trigger a python traceback ONLY once.  Any further invocations works fine.

[root@minas-tirith distfiles]# distcc-config --set-hosts "isengard/4"
Traceback (most recent call last):
  File "/usr/bin/distcc-config", line 113, in ?
    createdistccdir(PATH)
  File "/usr/bin/distcc-config", line 85, in createdistccdir
    os.chmod(dir, '1777')
TypeError: an integer is required
[root@minas-tirith distfiles]# distcc-config --set-hosts "isengard/4"
[root@minas-tirith distfiles]#
[root@minas-tirith distfiles]# rm -Rf /etc/distcc
[root@minas-tirith distfiles]# distcc-config --set-hosts "isengard/4"
Traceback (most recent call last):
  File "/usr/bin/distcc-config", line 113, in ?
    createdistccdir(PATH)
  File "/usr/bin/distcc-config", line 85, in createdistccdir
    os.chmod(dir, '1777')
TypeError: an integer is required
[root@minas-tirith distfiles]#


Using a straight IP address instead of the histname during the first call doesn't trigger the bug either.

------- Comment #32 From Markus Nigbur (RETIRED) 2003-12-27 15:46:29 0000 -------
verfied fixed.

------- Comment #33 From Lisa Seelye (RETIRED) 2003-12-31 09:50:23 0000 -------
*** Bug 36504 has been marked as a duplicate of this bug. ***

------- Comment #34 From Markus Nigbur (RETIRED) 2004-01-11 07:59:48 0000 -------
all issues should be fixed.

------- Comment #35 From Lisa Seelye (RETIRED) 2004-01-11 14:26:36 0000 -------
All issues with the Python rewrite of distcc-config should be filed in a new
bug.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug