You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Steve Cohen <sc...@javactivity.org> on 2005/02/11 03:46:33 UTC

Victory - built subversion from RH9 source rpm!

Those who have been following the saga of my attempt (did I hear someone 
say quixotic) to build Subversion from the Source RPMs will be happy to 
know that I have finally achieved this goal.

What I learned along the way may be of interest to those who are putting
together Subversion source rpms for Linux systems as well as to those 
who try to build from these RPMs.

Actually, I already had a version of SVN 1.1.3 running, built on my 
Redhat 9 system from David Summers binary RPMs.  Thanks, David.

But I wanted source so I could build JavaHL and put it into subeclipse. 
  I still haven't even gotten to that part yet, I spent the better part 
of a week getting the source RPM to build.  Which is the subject of this 
tale.

For those who haven't been following, the problems came during the
running of the tests that are included in the source rpm.  Yes, I know,
these can be turned off in the spec file, but maybe they're important? 
Someone turned them on for a reason.  What was the reason?  Who am I to 
take them out?  Anyway, that's the sort of guy I am.  I don't like 
taking the easy way out.

The tests that failed were always those following this line:
*** Running regression tests on RA_DAV (HTTP method) layer ***

as follows:

+ killall httpd
+ sleep 1
++ pwd
+ sed -e 's;@SVNDIR@;/usr/src/redhat/BUILD/subversion-1.1.3;'
++ pwd
+ /usr/sbin/httpd -f /usr/src/redhat/BUILD/subversion-1.1.3/httpd.conf
httpd: Could not determine the server's fully qualified domain name, 
using 127.0.0.1 for ServerName
+ sleep 1
+ make check BASE_URL=http://localhost:15835
Running all tests in config-test...success
...
Running all tests in getopt_tests.py...success
Running all tests in basic_tests.py...FAILURE
Running all tests in commit_tests.py...FAILURE
...
At least one test FAILED, checking
/usr/src/redhat/BUILD/subversion-1.1.3/tests.log

Looking at tests.log (thanks to Max Bowsher for pointing this haystack 
needle out) the failures appeared here:

svn: PROPFIND request failed on '/local_tmp/repos'
svn: PROPFIND of '/local_tmp/repos': could not connect to server 
(http://localhost:15835)

Could not connect to server.  That's interesting.  Hmm, why not?

# /sbin/service httpd status
httpd dead but subsys locked

httpd dead?

Well, it was running before.  Hmm, that's right, the script killed it. 
Then it wouldn't start a few lines later.  Why not?  A timing issue? 
Not likely, but then what?

I started looking at the apache logs in /var/log/httpd.  No clue there. 
  Why won't the damned thing start?

Something wrong with the config.  But the apache config syntax check 
command is passing the new config that is supplied in the source RPM.

Then I caught a lucky break!  (Days are going by between all these 
steps, by the way).  I got lucky when I accidentally
typed "tail error_log" from the /usr/src/redhat/BUILD directory instead
of "tail /var/log/httpd/error_log" and found where the real log messages
were going!

Aha!

[Thu Feb 10 20:56:21 2005] [alert] (2)No such file or directory: 
getpwuid: couldn't determine user name from uid 4294967295, you probably 
need to modify the User directive

 From there, a simple google quickly brought me to the nub of the issue: 
  The User and Group directives in the httpd.conf that comes in the 
source RPM were commented out - and apache can't start without them.

D'OH!!!!!!!!!!!!

Well, from here it was simple to hack up the spec file to pass the User 
and Group directives into the apache startup command:

%define apache_user apache
%define apache_group apache
...
/usr/sbin/httpd -C "User %{apache_user}" -C "Group %{apache_group}" -f 
`pwd`/httpd.conf

AND THE SRC RPM BUILD COMPLETES SUCCESSFULLY!  BREAK OUT THE CHAMPAGNE!!!

I realize that this may not be a universally applicable solution.  There 
may not even be one unless we want to insist on creating the "apache" 
user.  For one thing, the Apache documentation says that the User 
directive is only applicable when running as root - and I was building 
as root, against the advice of more experienced Linux administrative 
types.  How would you handle this if you were not root?  You'd have to 
modify the httpd.conf file.  But that comes from INSIDE the source rpm. 
  There may be a way around this that more experienced rpm builders know 
about, but I don't.  I suppose a python script could be written to take 
the user's real httpd.conf file and make a copy with the mods needed to 
run the tests.

It's understandable that the creators of the source rpm would comment 
these lines out, since different installers might have their Apache 
configured to run as different users.  But without these directives 
APACHE WON'T START!!!!!  And the tests will fail, and leave poor user 
scratching his head.

The source RPM should not turn tests on by default when they are 
absolutely going to fail!

===================================================================

And so we come to the real question for the Subversion test developers 
and Subversion packagers (source rpm builders)?

Should such tests be part of build scripts for the general public such 
as source rpms?  Or are these tests the province of the Subversion 
developers themselves?  When their source is released to the world 
should the users out there in the world be entitled to assume that unit 
tests have passed and that this version of subversion works in a 
properly configured environment?  Or should they run the tests to prove 
that their environment is good?  There is very little documented 
guidance on these questions, and people are getting discouraged, going 
wrong.  It's wrong to blame this one on Linux, or RedHat.  I was 
seriously thinking of upgrading my OS until I found the simple way out 
of this.

No, this is a self-inflicted wound by the Subversion development 
community.  If the Subversion community doesn't want its product to get 
the reputation of being "too hard" it ought to answer questions like these.

Are the tests testing subversion or subversion plus its environment?  Or 
either one?  It seems to me that this whole process would have been 
easier had there been more documentation of what these tests did and 
their proper configuration.  But to just plop them into a source rpm 
package without this information seems like the wrong way to go.

Open source development is difficult enough without all this easily 
avoided toe-stubbing.  Better documentation is needed.

Oh well.  Perhaps this tale of mine will help someone else out in the 
future.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

>  From there, a simple google quickly brought me to the nub of the issue:
> The User and Group directives in the httpd.conf that comes in the source
> RPM were commented out - and apache can't start without them.

I went back to see what was going on and found this file:

subversion/tests/clients/cmdline/davautocheck.sh

View-CVS link for same:

<http://svn.collab.net/viewcvs/svn/tags/1.1.3/subversion/tests/clients/
cmdline/davautocheck.sh?rev=12740&view=log>

This script runs Apache and then the tests. It appears to create the Apache 
config file, and I don't see how it can do so with commented-out User and 
Group directives. Does the spec file edit the Apache config after running 
this? I don't see anything in the Fedora 3 Updates spec file for 1.1.2 
(latest that I'm running) that does this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by David Summers <da...@summersoft.fay.ar.us>.
On Thu, 10 Feb 2005, Steve Cohen wrote:

> Those who have been following the saga of my attempt (did I hear someone say 
> quixotic) to build Subversion from the Source RPMs will be happy to know that 
> I have finally achieved this goal.
>
> What I learned along the way may be of interest to those who are putting
> together Subversion source rpms for Linux systems as well as to those who try 
> to build from these RPMs.
>
> Actually, I already had a version of SVN 1.1.3 running, built on my Redhat 9 
> system from David Summers binary RPMs.  Thanks, David.

I'm glad it was useful to you.

> But I wanted source so I could build JavaHL and put it into subeclipse.  I 
> still haven't even gotten to that part yet, I spent the better part of a week 
> getting the source RPM to build.  Which is the subject of this tale.

Sorry you had to pull your hair out, if you still run into problems, let 
me know.

> For those who haven't been following, the problems came during the
> running of the tests that are included in the source rpm.  Yes, I know,
> these can be turned off in the spec file, but maybe they're important? 
> Someone turned them on for a reason.  What was the reason?  Who am I to take 
> them out?  Anyway, that's the sort of guy I am.  I don't like taking the easy 
> way out.
>
> The tests that failed were always those following this line:
> *** Running regression tests on RA_DAV (HTTP method) layer ***
>
> as follows:
>
> + killall httpd
> + sleep 1
> ++ pwd
> + sed -e 's;@SVNDIR@;/usr/src/redhat/BUILD/subversion-1.1.3;'
> ++ pwd
> + /usr/sbin/httpd -f /usr/src/redhat/BUILD/subversion-1.1.3/httpd.conf
> httpd: Could not determine the server's fully qualified domain name, using 
> 127.0.0.1 for ServerName
> + sleep 1
> + make check BASE_URL=http://localhost:15835
> Running all tests in config-test...success
> ...
> Running all tests in getopt_tests.py...success
> Running all tests in basic_tests.py...FAILURE
> Running all tests in commit_tests.py...FAILURE
> ...
> At least one test FAILED, checking
> /usr/src/redhat/BUILD/subversion-1.1.3/tests.log
>
> Looking at tests.log (thanks to Max Bowsher for pointing this haystack needle 
> out) the failures appeared here:
>
> svn: PROPFIND request failed on '/local_tmp/repos'
> svn: PROPFIND of '/local_tmp/repos': could not connect to server 
> (http://localhost:15835)
>
> Could not connect to server.  That's interesting.  Hmm, why not?
>
> # /sbin/service httpd status
> httpd dead but subsys locked
>
> httpd dead?
>
> Well, it was running before.  Hmm, that's right, the script killed it. Then 
> it wouldn't start a few lines later.  Why not?  A timing issue? Not likely, 
> but then what?
>
> I started looking at the apache logs in /var/log/httpd.  No clue there.  Why 
> won't the damned thing start?
>
> Something wrong with the config.  But the apache config syntax check command 
> is passing the new config that is supplied in the source RPM.
>
> Then I caught a lucky break!  (Days are going by between all these steps, by 
> the way).  I got lucky when I accidentally
> typed "tail error_log" from the /usr/src/redhat/BUILD directory instead
> of "tail /var/log/httpd/error_log" and found where the real log messages
> were going!
>
> Aha!
>
> [Thu Feb 10 20:56:21 2005] [alert] (2)No such file or directory: getpwuid: 
> couldn't determine user name from uid 4294967295, you probably need to modify 
> the User directive
>
> From there, a simple google quickly brought me to the nub of the issue:  The 
> User and Group directives in the httpd.conf that comes in the source RPM were 
> commented out - and apache can't start without them.
>
> D'OH!!!!!!!!!!!!

Hmm, I've been building as non-root user for 3+ years with these RPMs and 
apache always starts for me......

> Well, from here it was simple to hack up the spec file to pass the User and 
> Group directives into the apache startup command:
>
> %define apache_user apache
> %define apache_group apache
> ...
> /usr/sbin/httpd -C "User %{apache_user}" -C "Group %{apache_group}" -f 
> `pwd`/httpd.conf
>
> AND THE SRC RPM BUILD COMPLETES SUCCESSFULLY!  BREAK OUT THE CHAMPAGNE!!!

Glad you got it figured out!

> I realize that this may not be a universally applicable solution.  There may 
> not even be one unless we want to insist on creating the "apache" user.  For 
> one thing, the Apache documentation says that the User directive is only 
> applicable when running as root - and I was building as root, against the 
> advice of more experienced Linux administrative types.  How would you handle 
> this if you were not root?  You'd have to modify the httpd.conf file.  But 
> that comes from INSIDE the source rpm.  There may be a way around this that 
> more experienced rpm builders know about, but I don't.  I suppose a python 
> script could be written to take the user's real httpd.conf file and make a 
> copy with the mods needed to run the tests.

As far as I know, "it just works (TM)" without being root.  I try very 
hard to make all my RPMs not require root to build.

Don't build my RPMs as root user, you may run into problems.    :-)

> It's understandable that the creators of the source rpm would comment these 
> lines out, since different installers might have their Apache configured to 
> run as different users.  But without these directives APACHE WON'T START!!!!! 
> And the tests will fail, and leave poor user scratching his head.

Hmm, are you sure?  I've never had problems running it this way.

> The source RPM should not turn tests on by default when they are absolutely 
> going to fail!

They've not failed for me.

> ===================================================================
>
> And so we come to the real question for the Subversion test developers and 
> Subversion packagers (source rpm builders)?
>
> Should such tests be part of build scripts for the general public such as 
> source rpms?  Or are these tests the province of the Subversion developers 
> themselves?  When their source is released to the world should the users out 
> there in the world be entitled to assume that unit tests have passed and that 
> this version of subversion works in a properly configured environment?  Or 
> should they run the tests to prove that their environment is good?  There is 
> very little documented guidance on these questions, and people are getting 
> discouraged, going wrong.  It's wrong to blame this one on Linux, or RedHat. 
> I was seriously thinking of upgrading my OS until I found the simple way out 
> of this.

I think of it as "the last line of defense".  I've had times when 
Subversion built and tested OK for everyone else except for me.  When I 
ran into test-suite failures, I checked with the developers and they found 
issues in the code that needed to be addressed.

Because of that I don't want to take them out, the RPM builds are not 
perfect but the built-in testing has saved us from a bad build for the
RedHat 7.3, 8.0, 9.0, RHEL3/WBEL3 packages in the past.

> No, this is a self-inflicted wound by the Subversion development community. 
> If the Subversion community doesn't want its product to get the reputation of 
> being "too hard" it ought to answer questions like these.
>
> Are the tests testing subversion or subversion plus its environment?  Or 
> either one?  It seems to me that this whole process would have been easier 
> had there been more documentation of what these tests did and their proper 
> configuration.  But to just plop them into a source rpm package without this 
> information seems like the wrong way to go.

My take is that the tests are testing everything that can be tested 
without actually installing and running the programs.

> Open source development is difficult enough without all this easily avoided 
> toe-stubbing.  Better documentation is needed.

Let me know how it can be better documented. (better yet, send a patch! 
:-)

I love making things better.

> Oh well.  Perhaps this tale of mine will help someone else out in the future.
>

Yes, I hope so.  Thanks for the tale.

--
David Wayne Summers          "Linux: Because reboots are for hardware upgrades!"
david@summersoft.fay.ar.us   PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint =  0B44 B118 85CC F4EC 7021  1ED4 1516 5B78 E320 2001

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by John Peacock <jp...@rowman.com>.
Bruce Elrick wrote:

> John Peacock wrote:
>> Except that under Solaris (I believe), root's UID is 1.
>>
> Naw, it's zero like everywhere else.
> 

Sorry, misremembering.  It was the root GUID which was 1 under Solaris. 
  Nevermind...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by John Peacock <jp...@rowman.com>.
Bruce Elrick wrote:

> John Peacock wrote:
>> Except that under Solaris (I believe), root's UID is 1.
>>
> Naw, it's zero like everywhere else.
> 

Sorry, misremembering.  It was the root GUID which was 1 under Solaris. 
  Nevermind...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Bruce Elrick <br...@elrick.ca>.
John Peacock wrote:

> Kenneth Porter wrote:
>
>> Perhaps one solution is to fail the build early if trying to build as 
>> root (ie. `id -u` evaluates to zero). 
>
>
> Except that under Solaris (I believe), root's UID is 1.
>
Naw, it's zero like everywhere else.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Bruce Elrick <br...@elrick.ca>.
John Peacock wrote:

> Kenneth Porter wrote:
>
>> Perhaps one solution is to fail the build early if trying to build as 
>> root (ie. `id -u` evaluates to zero). 
>
>
> Except that under Solaris (I believe), root's UID is 1.
>
Naw, it's zero like everywhere else.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by John Peacock <jp...@rowman.com>.
Kenneth Porter wrote:
> Perhaps one solution is to fail the build early if trying to build as 
> root (ie. `id -u` evaluates to zero). 

Except that under Solaris (I believe), root's UID is 1.

> BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
> since it's needed for the test phase. Are there any distros that ship an 
> httpd package that does NOT create the user apache? 

Yes, SuSE's Apache user is wwwrun and OS X uses www (if I remeber correctly). 
That's why you usually see a page of RPM's specific to each distro because they 
all do it just a little differently... :-(

John


-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by John Peacock <jp...@rowman.com>.
Kenneth Porter wrote:
> Perhaps one solution is to fail the build early if trying to build as 
> root (ie. `id -u` evaluates to zero). 

Except that under Solaris (I believe), root's UID is 1.

> BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
> since it's needed for the test phase. Are there any distros that ship an 
> httpd package that does NOT create the user apache? 

Yes, SuSE's Apache user is wwwrun and OS X uses www (if I remeber correctly). 
That's why you usually see a page of RPM's specific to each distro because they 
all do it just a little differently... :-(

John


-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by David Summers <da...@summersoft.fay.ar.us>.
On Thu, 10 Feb 2005, Kenneth Porter wrote:

> --On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
>
>> Well, I'm trying it your way now.  I'll let you know how it comes out.
>> I've been building SRPMS for years as root without ever knowing that this
>> was frowned upon.  In fact, I always assumed I HAD to be root to build
>> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
>> because you have to become root to INSTALL packages and I just assumed
>> that building them was the same.  I'm not one of those who is always
>> root.  Only rarely do I find it necessary to become root but I thought
>> this was one of those times.
>
> When I started building SRPMS back in Red Hat 5.2 days, I couldn't imagine 
> having to be root to do it, so I asked on the RPM mailing list and found the 
> black magic for doing it as a mortal. The only package forcing me to be root 
> to build it was the old 2.2 kernel, because the spec file insisted on 
> executing mknod to create some device nodes to package. But someone invented 
> the fakeroot package to get around even this limitation. And now RPM supports 
> creation of device nodes in the %files list, so that kludge is no longer 
> necessary.
>
> I tried to complain about the misleading nature of /usr/src/redhat but 
> couldn't make any traction:
>
> <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>
>

Yes, I agree.  First-time RPMers try to build a package and it tries by 
default to go to /usr/src/redhat which is owned by root, so their first 
attempt bombs out.  So then naturally (if they are not Unix experts) they 
then switch to root to "fix" that problem and build as root and it works 
(most of the time) and then they think that RPMs have to be built as root.
It doesn't help that a lot of packages and packaging instructions say

./configure
make
make install

as that helps sustain the impression.

Fortunately it is normally fairly easy to work around these issues since 
only the last "make install" normally needs to be done as root and for 
RPMers that is an "install" into the staging area anyway, and not the 
final destination.

It would be nice if more packages/packaging instructions would talk about 
that.

--
David Wayne Summers          "Linux: Because reboots are for hardware upgrades!"
david@summersoft.fay.ar.us   PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint =  0B44 B118 85CC F4EC 7021  1ED4 1516 5B78 E320 2001

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Friday, February 11, 2005 1:26 PM -0500 Christopher Ness 
<ch...@nesser.org> wrote:

> Perhaps it was caused by the switch from RH9 to the FC line (2.6 kernel,
> restructuring of the file system ie. /media, etc), but more likely by
> the discontinuation of support (new packages) for that version of the
> distribution.

RH9 got EOL'd so it won't get any further vendor support. Other than that, 
you can usually build Fedora packages on it. And volunteers are free to 
make those packages available to others. There just don't seem to be any 
such volunteers.

The problems in this thread would have been encountered on any OS, not just 
RH9.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Christopher Ness <ch...@nesser.org>.
On Fri, 2005-11-02 at 07:53 -0600, Steve Cohen wrote:
> Christopher Ness wrote:
> > I just saw red flags shooting up.  ;)  
> > 
> > I think redhat uses the "wheel" group as the admin group.  I wouldn't
> > want to elevate my daily account to be a group member of root.
> > 
> Further, but damn it all. I wanted this to be a discussion of how SVN 
> packages itself to the world, and it's turning into you're a moron 
> because you do this or that as root.

I don't think you are a moron.  I probably would have fumbled through
the power set of the same steps you took trying to solve this problem.

> Have the subversion devs set minimal platform guidelines and stuck to 
> them?  I should not have had to install Fedora packages over RH 9.0 just 
> to run subversion because that's what some developer has installed.  Or 
> if I should, the subversion team should announce that RH 9.0 is not 
> going to be supported.

The minimal platform guideline, as I understand it, is the source code.
Any packages, or binaries are a contribution from those outside
subversion and cannot be controlled any more than the Internet itself.

I agree you should not have had to do those things.  
That is the fault of RedHat (and other package creators), not
Subversion.  

Perhaps it was caused by the switch from RH9 to the FC line (2.6 kernel,
restructuring of the file system ie. /media, etc), but more likely by
the discontinuation of support (new packages) for that version of the
distribution.

Sorry, I didn't mean to inflame you, just trying to help.
Chris
-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
13:00:56 up 14:31, 3 users, load average: 0.08, 0.13, 0.09 
http://www.fsf.org/philosophy/no-word-attachments.html

Re: Victory - built subversion from RH9 source rpm!

Posted by Steve Cohen <sc...@javactivity.org>.
Christopher Ness wrote:
> On Fri, 2005-11-02 at 05:59 -0600, Steve Cohen wrote:
> 
>>That would be changing the ownership of /usr/src/redhat?  Actually, I 
>>didn't even have to do that.  I chmodded it to g+w and put myself into 
>>the root group.  That also did the job.
> 
> 
> I just saw red flags shooting up.  ;)  
> 
> I think redhat uses the "wheel" group as the admin group.  I wouldn't
> want to elevate my daily account to be a group member of root.
> 
> Cheers,
> Chris
Further, but damn it all. I wanted this to be a discussion of how SVN 
packages itself to the world, and it's turning into you're a moron 
because you do this or that as root.

Have the subversion devs set minimal platform guidelines and stuck to 
them?  I should not have had to install Fedora packages over RH 9.0 just 
to run subversion because that's what some developer has installed.  Or 
if I should, the subversion team should announce that RH 9.0 is not 
going to be supported.

I come from the java open source world and our team still enforces 
jdk1.2 compatibility.  Until last year it was 1.1.

That's part of what "ready for prime time" means to me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Christopher Ness <ch...@nesser.org>.
On Fri, 2005-11-02 at 05:59 -0600, Steve Cohen wrote:
> That would be changing the ownership of /usr/src/redhat?  Actually, I 
> didn't even have to do that.  I chmodded it to g+w and put myself into 
> the root group.  That also did the job.

I just saw red flags shooting up.  ;)  

I think redhat uses the "wheel" group as the admin group.  I wouldn't
want to elevate my daily account to be a group member of root.

Cheers,
Chris
-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
08:16:21 up 9:46, 1 user, load average: 0.08, 0.08, 0.05 
http://www.fsf.org/philosophy/no-word-attachments.html

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Friday, February 11, 2005 5:59 AM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> That would be changing the ownership of /usr/src/redhat?  Actually, I
> didn't even have to do that.  I chmodded it to g+w and put myself into
> the root group.  That also did the job.

If only one person does packaging on the box, give that person ownership of 
/usr/src/redhat.

But my preferred method is to create a private build tree under a new user 
who by convention I call "buildmeister". (This is the user mentioned in Red 
Hat tarballs.) You could also give yourself a build tree and other users 
could have their own private trees. They just need the proper directory 
hierarchy created and ~.rpmmacros needs to be created to tell rpmbuild 
where to find it.

Create and "become" the user:

useradd buildmeister
su -l buildmeister

Then create a build tree:

cd ~
mkdir BUILD Download RPMS SOURCES SPECS SRPMS

Use the Download directory to store all the SRPM's you download. (I have 
subdirectories under Download for each SRPM repository I collect them from, 
like Fedora, Apt, Dag, etc.)

Create ~buildmeister/.rpmmacros to tell rpmbuild about your new build tree:

echo "%_topdir /home/buildmeister" > ~/.rpmmacros

(You can add other macros here to override the definitions in 
/usr/lib/rpm/macros. I like to override %packager.)

Now you can build packages in your new tree and totally ignore 
/usr/src/redhat.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Friday, February 11, 2005 5:59 AM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> That would be changing the ownership of /usr/src/redhat?  Actually, I
> didn't even have to do that.  I chmodded it to g+w and put myself into
> the root group.  That also did the job.

If only one person does packaging on the box, give that person ownership of 
/usr/src/redhat.

But my preferred method is to create a private build tree under a new user 
who by convention I call "buildmeister". (This is the user mentioned in Red 
Hat tarballs.) You could also give yourself a build tree and other users 
could have their own private trees. They just need the proper directory 
hierarchy created and ~.rpmmacros needs to be created to tell rpmbuild 
where to find it.

Create and "become" the user:

useradd buildmeister
su -l buildmeister

Then create a build tree:

cd ~
mkdir BUILD Download RPMS SOURCES SPECS SRPMS

Use the Download directory to store all the SRPM's you download. (I have 
subdirectories under Download for each SRPM repository I collect them from, 
like Fedora, Apt, Dag, etc.)

Create ~buildmeister/.rpmmacros to tell rpmbuild about your new build tree:

echo "%_topdir /home/buildmeister" > ~/.rpmmacros

(You can add other macros here to override the definitions in 
/usr/lib/rpm/macros. I like to override %packager.)

Now you can build packages in your new tree and totally ignore 
/usr/src/redhat.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Steve Cohen <sc...@javactivity.org>.
Kenneth Porter wrote:
> --On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
> 
>> Well, I'm trying it your way now.  I'll let you know how it comes out.

It worked!

>> I've been building SRPMS for years as root without ever knowing that this
>> was frowned upon.  In fact, I always assumed I HAD to be root to build
>> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
>> because you have to become root to INSTALL packages and I just assumed
>> that building them was the same.  I'm not one of those who is always
>> root.  Only rarely do I find it necessary to become root but I thought
>> this was one of those times.
> 
> 
> When I started building SRPMS back in Red Hat 5.2 days, I couldn't 
> imagine having to be root to do it, so I asked on the RPM mailing list 
> and found the black magic for doing it as a mortal. 

That would be changing the ownership of /usr/src/redhat?  Actually, I 
didn't even have to do that.  I chmodded it to g+w and put myself into 
the root group.  That also did the job.

> 
> I tried to complain about the misleading nature of /usr/src/redhat but 
> couldn't make any traction:
> 
> <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>
> 
--Agreed. The fact that /usr/lib/rpm/macros points at /usr/src/redhat
--and that directory is owned by root establishes a defacto policy of
--encouraging users to package as root.

I knew there was some reason I assumed this.  And yours was a relatively 
recent discussion!

Anyway, thanks.

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by David Summers <da...@summersoft.fay.ar.us>.
On Thu, 10 Feb 2005, Kenneth Porter wrote:

> --On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
>
>> Well, I'm trying it your way now.  I'll let you know how it comes out.
>> I've been building SRPMS for years as root without ever knowing that this
>> was frowned upon.  In fact, I always assumed I HAD to be root to build
>> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
>> because you have to become root to INSTALL packages and I just assumed
>> that building them was the same.  I'm not one of those who is always
>> root.  Only rarely do I find it necessary to become root but I thought
>> this was one of those times.
>
> When I started building SRPMS back in Red Hat 5.2 days, I couldn't imagine 
> having to be root to do it, so I asked on the RPM mailing list and found the 
> black magic for doing it as a mortal. The only package forcing me to be root 
> to build it was the old 2.2 kernel, because the spec file insisted on 
> executing mknod to create some device nodes to package. But someone invented 
> the fakeroot package to get around even this limitation. And now RPM supports 
> creation of device nodes in the %files list, so that kludge is no longer 
> necessary.
>
> I tried to complain about the misleading nature of /usr/src/redhat but 
> couldn't make any traction:
>
> <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>
>

Yes, I agree.  First-time RPMers try to build a package and it tries by 
default to go to /usr/src/redhat which is owned by root, so their first 
attempt bombs out.  So then naturally (if they are not Unix experts) they 
then switch to root to "fix" that problem and build as root and it works 
(most of the time) and then they think that RPMs have to be built as root.
It doesn't help that a lot of packages and packaging instructions say

./configure
make
make install

as that helps sustain the impression.

Fortunately it is normally fairly easy to work around these issues since 
only the last "make install" normally needs to be done as root and for 
RPMers that is an "install" into the staging area anyway, and not the 
final destination.

It would be nice if more packages/packaging instructions would talk about 
that.

--
David Wayne Summers          "Linux: Because reboots are for hardware upgrades!"
david@summersoft.fay.ar.us   PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint =  0B44 B118 85CC F4EC 7021  1ED4 1516 5B78 E320 2001

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Steve Cohen <sc...@javactivity.org>.
Kenneth Porter wrote:
> --On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
> 
>> Well, I'm trying it your way now.  I'll let you know how it comes out.

It worked!

>> I've been building SRPMS for years as root without ever knowing that this
>> was frowned upon.  In fact, I always assumed I HAD to be root to build
>> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
>> because you have to become root to INSTALL packages and I just assumed
>> that building them was the same.  I'm not one of those who is always
>> root.  Only rarely do I find it necessary to become root but I thought
>> this was one of those times.
> 
> 
> When I started building SRPMS back in Red Hat 5.2 days, I couldn't 
> imagine having to be root to do it, so I asked on the RPM mailing list 
> and found the black magic for doing it as a mortal. 

That would be changing the ownership of /usr/src/redhat?  Actually, I 
didn't even have to do that.  I chmodded it to g+w and put myself into 
the root group.  That also did the job.

> 
> I tried to complain about the misleading nature of /usr/src/redhat but 
> couldn't make any traction:
> 
> <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>
> 
--Agreed. The fact that /usr/lib/rpm/macros points at /usr/src/redhat
--and that directory is owned by root establishes a defacto policy of
--encouraging users to package as root.

I knew there was some reason I assumed this.  And yours was a relatively 
recent discussion!

Anyway, thanks.

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> Well, I'm trying it your way now.  I'll let you know how it comes out.
> I've been building SRPMS for years as root without ever knowing that this
> was frowned upon.  In fact, I always assumed I HAD to be root to build
> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
> because you have to become root to INSTALL packages and I just assumed
> that building them was the same.  I'm not one of those who is always
> root.  Only rarely do I find it necessary to become root but I thought
> this was one of those times.

When I started building SRPMS back in Red Hat 5.2 days, I couldn't imagine 
having to be root to do it, so I asked on the RPM mailing list and found 
the black magic for doing it as a mortal. The only package forcing me to be 
root to build it was the old 2.2 kernel, because the spec file insisted on 
executing mknod to create some device nodes to package. But someone 
invented the fakeroot package to get around even this limitation. And now 
RPM supports creation of device nodes in the %files list, so that kludge is 
no longer necessary.

I tried to complain about the misleading nature of /usr/src/redhat but 
couldn't make any traction:

<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 11:22 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> Well, I'm trying it your way now.  I'll let you know how it comes out.
> I've been building SRPMS for years as root without ever knowing that this
> was frowned upon.  In fact, I always assumed I HAD to be root to build
> RPMs, if I even thought about it. Not sure where I got that idea.   Maybe
> because you have to become root to INSTALL packages and I just assumed
> that building them was the same.  I'm not one of those who is always
> root.  Only rarely do I find it necessary to become root but I thought
> this was one of those times.

When I started building SRPMS back in Red Hat 5.2 days, I couldn't imagine 
having to be root to do it, so I asked on the RPM mailing list and found 
the black magic for doing it as a mortal. The only package forcing me to be 
root to build it was the old 2.2 kernel, because the spec file insisted on 
executing mknod to create some device nodes to package. But someone 
invented the fakeroot package to get around even this limitation. And now 
RPM supports creation of device nodes in the %files list, so that kludge is 
no longer necessary.

I tried to complain about the misleading nature of /usr/src/redhat but 
couldn't make any traction:

<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143746>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Steve Cohen <sc...@javactivity.org>.
Kenneth Porter wrote:
> --On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
> 
>> For one thing, the Apache documentation says that the User directive is
>> only applicable when running as root - and I was building as root,
>> against the advice of more experienced Linux administrative types.  How
>> would you handle this if you were not root?  You'd have to modify the
>> httpd.conf file.
> 
> 
> First, glad you got it working.
> 
> This is really the heart of the problem, though. You were building as 
> root, and the SRPM was *designed* to be built as a mortal. As a mortal, 
> one would not have User/Group directives in the file in the first place. 
> They're only needed when running as root, and since you're not supposed 
> to build as root, you shouldn't need them.
> 
> Perhaps one solution is to fail the build early if trying to build as 
> root (ie. `id -u` evaluates to zero). This would at least document the 
> assumption made by the test.
> 
> BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
> since it's needed for the test phase. Are there any distros that ship an 
> httpd package that does NOT create the user apache? Given that 
> assumption, and if the devs desire to add root-building capability to 
> the package, it should be reasonable to ship a second Apache config file 
> with User/Group directives set appropriately and use it if one is 
> building as root.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 
> 

Kenneth -

Well, I'm trying it your way now.  I'll let you know how it comes out. 
I've been building SRPMS for years as root without ever knowing that 
this was frowned upon.  In fact, I always assumed I HAD to be root to 
build RPMs, if I even thought about it. Not sure where I got that idea. 
  Maybe because you have to become root to INSTALL packages and I just 
assumed that building them was the same.  I'm not one of those who is 
always root.  Only rarely do I find it necessary to become root but I 
thought this was one of those times.

Of course not many SRPMS require Apache as part of their build PROCESS 
(as opposed to a mere prerequisite).  And I hadn't understood the 
intracicies of running apache as root vs. nonroot.  Your suggestions 
made no sense to me when you first made them, but they all make perfect 
sense now.  I'm not any kind of sys admin.  The only user of my linux 
system is me.  Live and learn.  That's why I enjoy spending so much time 
on this crap.

By the way httpd IS required in this SRPM:
BuildPreReq: httpd >= %{apache_version}

I think your idea of breaking the build (with appropriate error message 
though !) if root runs it is a good one.  Would have saved me hours of 
fun.  Anyway, thanks for your advice even if I didn't take it until it 
was too late.  Actually, it's never too late, is it?

Steve





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Steve Cohen <sc...@javactivity.org>.
Kenneth Porter wrote:
> --On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
> <sc...@javactivity.org> wrote:
> 
>> For one thing, the Apache documentation says that the User directive is
>> only applicable when running as root - and I was building as root,
>> against the advice of more experienced Linux administrative types.  How
>> would you handle this if you were not root?  You'd have to modify the
>> httpd.conf file.
> 
> 
> First, glad you got it working.
> 
> This is really the heart of the problem, though. You were building as 
> root, and the SRPM was *designed* to be built as a mortal. As a mortal, 
> one would not have User/Group directives in the file in the first place. 
> They're only needed when running as root, and since you're not supposed 
> to build as root, you shouldn't need them.
> 
> Perhaps one solution is to fail the build early if trying to build as 
> root (ie. `id -u` evaluates to zero). This would at least document the 
> assumption made by the test.
> 
> BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
> since it's needed for the test phase. Are there any distros that ship an 
> httpd package that does NOT create the user apache? Given that 
> assumption, and if the devs desire to add root-building capability to 
> the package, it should be reasonable to ship a second Apache config file 
> with User/Group directives set appropriately and use it if one is 
> building as root.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 
> 

Kenneth -

Well, I'm trying it your way now.  I'll let you know how it comes out. 
I've been building SRPMS for years as root without ever knowing that 
this was frowned upon.  In fact, I always assumed I HAD to be root to 
build RPMs, if I even thought about it. Not sure where I got that idea. 
  Maybe because you have to become root to INSTALL packages and I just 
assumed that building them was the same.  I'm not one of those who is 
always root.  Only rarely do I find it necessary to become root but I 
thought this was one of those times.

Of course not many SRPMS require Apache as part of their build PROCESS 
(as opposed to a mere prerequisite).  And I hadn't understood the 
intracicies of running apache as root vs. nonroot.  Your suggestions 
made no sense to me when you first made them, but they all make perfect 
sense now.  I'm not any kind of sys admin.  The only user of my linux 
system is me.  Live and learn.  That's why I enjoy spending so much time 
on this crap.

By the way httpd IS required in this SRPM:
BuildPreReq: httpd >= %{apache_version}

I think your idea of breaking the build (with appropriate error message 
though !) if root runs it is a good one.  Would have saved me hours of 
fun.  Anyway, thanks for your advice even if I didn't take it until it 
was too late.  Actually, it's never too late, is it?

Steve





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> For one thing, the Apache documentation says that the User directive is
> only applicable when running as root - and I was building as root,
> against the advice of more experienced Linux administrative types.  How
> would you handle this if you were not root?  You'd have to modify the
> httpd.conf file.

First, glad you got it working.

This is really the heart of the problem, though. You were building as root, 
and the SRPM was *designed* to be built as a mortal. As a mortal, one would 
not have User/Group directives in the file in the first place. They're only 
needed when running as root, and since you're not supposed to build as 
root, you shouldn't need them.

Perhaps one solution is to fail the build early if trying to build as root 
(ie. `id -u` evaluates to zero). This would at least document the 
assumption made by the test.

BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
since it's needed for the test phase. Are there any distros that ship an 
httpd package that does NOT create the user apache? Given that assumption, 
and if the devs desire to add root-building capability to the package, it 
should be reasonable to ship a second Apache config file with User/Group 
directives set appropriately and use it if one is building as root.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

> For one thing, the Apache documentation says that the User directive is
> only applicable when running as root - and I was building as root,
> against the advice of more experienced Linux administrative types.  How
> would you handle this if you were not root?  You'd have to modify the
> httpd.conf file.

First, glad you got it working.

This is really the heart of the problem, though. You were building as root, 
and the SRPM was *designed* to be built as a mortal. As a mortal, one would 
not have User/Group directives in the file in the first place. They're only 
needed when running as root, and since you're not supposed to build as 
root, you shouldn't need them.

Perhaps one solution is to fail the build early if trying to build as root 
(ie. `id -u` evaluates to zero). This would at least document the 
assumption made by the test.

BTW, is Apache (package httpd) a BuildPrereq in that SRPM? It should be, 
since it's needed for the test phase. Are there any distros that ship an 
httpd package that does NOT create the user apache? Given that assumption, 
and if the devs desire to add root-building capability to the package, it 
should be reasonable to ship a second Apache config file with User/Group 
directives set appropriately and use it if one is building as root.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Thursday, February 10, 2005 9:46 PM -0600 Steve Cohen 
<sc...@javactivity.org> wrote:

>  From there, a simple google quickly brought me to the nub of the issue:
> The User and Group directives in the httpd.conf that comes in the source
> RPM were commented out - and apache can't start without them.

I went back to see what was going on and found this file:

subversion/tests/clients/cmdline/davautocheck.sh

View-CVS link for same:

<http://svn.collab.net/viewcvs/svn/tags/1.1.3/subversion/tests/clients/
cmdline/davautocheck.sh?rev=12740&view=log>

This script runs Apache and then the tests. It appears to create the Apache 
config file, and I don't see how it can do so with commented-out User and 
Group directives. Does the spec file edit the Apache config after running 
this? I don't see anything in the Fedora 3 Updates spec file for 1.1.2 
(latest that I'm running) that does this.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Victory - built subversion from RH9 source rpm!

Posted by David Summers <da...@summersoft.fay.ar.us>.
On Thu, 10 Feb 2005, Steve Cohen wrote:

> Those who have been following the saga of my attempt (did I hear someone say 
> quixotic) to build Subversion from the Source RPMs will be happy to know that 
> I have finally achieved this goal.
>
> What I learned along the way may be of interest to those who are putting
> together Subversion source rpms for Linux systems as well as to those who try 
> to build from these RPMs.
>
> Actually, I already had a version of SVN 1.1.3 running, built on my Redhat 9 
> system from David Summers binary RPMs.  Thanks, David.

I'm glad it was useful to you.

> But I wanted source so I could build JavaHL and put it into subeclipse.  I 
> still haven't even gotten to that part yet, I spent the better part of a week 
> getting the source RPM to build.  Which is the subject of this tale.

Sorry you had to pull your hair out, if you still run into problems, let 
me know.

> For those who haven't been following, the problems came during the
> running of the tests that are included in the source rpm.  Yes, I know,
> these can be turned off in the spec file, but maybe they're important? 
> Someone turned them on for a reason.  What was the reason?  Who am I to take 
> them out?  Anyway, that's the sort of guy I am.  I don't like taking the easy 
> way out.
>
> The tests that failed were always those following this line:
> *** Running regression tests on RA_DAV (HTTP method) layer ***
>
> as follows:
>
> + killall httpd
> + sleep 1
> ++ pwd
> + sed -e 's;@SVNDIR@;/usr/src/redhat/BUILD/subversion-1.1.3;'
> ++ pwd
> + /usr/sbin/httpd -f /usr/src/redhat/BUILD/subversion-1.1.3/httpd.conf
> httpd: Could not determine the server's fully qualified domain name, using 
> 127.0.0.1 for ServerName
> + sleep 1
> + make check BASE_URL=http://localhost:15835
> Running all tests in config-test...success
> ...
> Running all tests in getopt_tests.py...success
> Running all tests in basic_tests.py...FAILURE
> Running all tests in commit_tests.py...FAILURE
> ...
> At least one test FAILED, checking
> /usr/src/redhat/BUILD/subversion-1.1.3/tests.log
>
> Looking at tests.log (thanks to Max Bowsher for pointing this haystack needle 
> out) the failures appeared here:
>
> svn: PROPFIND request failed on '/local_tmp/repos'
> svn: PROPFIND of '/local_tmp/repos': could not connect to server 
> (http://localhost:15835)
>
> Could not connect to server.  That's interesting.  Hmm, why not?
>
> # /sbin/service httpd status
> httpd dead but subsys locked
>
> httpd dead?
>
> Well, it was running before.  Hmm, that's right, the script killed it. Then 
> it wouldn't start a few lines later.  Why not?  A timing issue? Not likely, 
> but then what?
>
> I started looking at the apache logs in /var/log/httpd.  No clue there.  Why 
> won't the damned thing start?
>
> Something wrong with the config.  But the apache config syntax check command 
> is passing the new config that is supplied in the source RPM.
>
> Then I caught a lucky break!  (Days are going by between all these steps, by 
> the way).  I got lucky when I accidentally
> typed "tail error_log" from the /usr/src/redhat/BUILD directory instead
> of "tail /var/log/httpd/error_log" and found where the real log messages
> were going!
>
> Aha!
>
> [Thu Feb 10 20:56:21 2005] [alert] (2)No such file or directory: getpwuid: 
> couldn't determine user name from uid 4294967295, you probably need to modify 
> the User directive
>
> From there, a simple google quickly brought me to the nub of the issue:  The 
> User and Group directives in the httpd.conf that comes in the source RPM were 
> commented out - and apache can't start without them.
>
> D'OH!!!!!!!!!!!!

Hmm, I've been building as non-root user for 3+ years with these RPMs and 
apache always starts for me......

> Well, from here it was simple to hack up the spec file to pass the User and 
> Group directives into the apache startup command:
>
> %define apache_user apache
> %define apache_group apache
> ...
> /usr/sbin/httpd -C "User %{apache_user}" -C "Group %{apache_group}" -f 
> `pwd`/httpd.conf
>
> AND THE SRC RPM BUILD COMPLETES SUCCESSFULLY!  BREAK OUT THE CHAMPAGNE!!!

Glad you got it figured out!

> I realize that this may not be a universally applicable solution.  There may 
> not even be one unless we want to insist on creating the "apache" user.  For 
> one thing, the Apache documentation says that the User directive is only 
> applicable when running as root - and I was building as root, against the 
> advice of more experienced Linux administrative types.  How would you handle 
> this if you were not root?  You'd have to modify the httpd.conf file.  But 
> that comes from INSIDE the source rpm.  There may be a way around this that 
> more experienced rpm builders know about, but I don't.  I suppose a python 
> script could be written to take the user's real httpd.conf file and make a 
> copy with the mods needed to run the tests.

As far as I know, "it just works (TM)" without being root.  I try very 
hard to make all my RPMs not require root to build.

Don't build my RPMs as root user, you may run into problems.    :-)

> It's understandable that the creators of the source rpm would comment these 
> lines out, since different installers might have their Apache configured to 
> run as different users.  But without these directives APACHE WON'T START!!!!! 
> And the tests will fail, and leave poor user scratching his head.

Hmm, are you sure?  I've never had problems running it this way.

> The source RPM should not turn tests on by default when they are absolutely 
> going to fail!

They've not failed for me.

> ===================================================================
>
> And so we come to the real question for the Subversion test developers and 
> Subversion packagers (source rpm builders)?
>
> Should such tests be part of build scripts for the general public such as 
> source rpms?  Or are these tests the province of the Subversion developers 
> themselves?  When their source is released to the world should the users out 
> there in the world be entitled to assume that unit tests have passed and that 
> this version of subversion works in a properly configured environment?  Or 
> should they run the tests to prove that their environment is good?  There is 
> very little documented guidance on these questions, and people are getting 
> discouraged, going wrong.  It's wrong to blame this one on Linux, or RedHat. 
> I was seriously thinking of upgrading my OS until I found the simple way out 
> of this.

I think of it as "the last line of defense".  I've had times when 
Subversion built and tested OK for everyone else except for me.  When I 
ran into test-suite failures, I checked with the developers and they found 
issues in the code that needed to be addressed.

Because of that I don't want to take them out, the RPM builds are not 
perfect but the built-in testing has saved us from a bad build for the
RedHat 7.3, 8.0, 9.0, RHEL3/WBEL3 packages in the past.

> No, this is a self-inflicted wound by the Subversion development community. 
> If the Subversion community doesn't want its product to get the reputation of 
> being "too hard" it ought to answer questions like these.
>
> Are the tests testing subversion or subversion plus its environment?  Or 
> either one?  It seems to me that this whole process would have been easier 
> had there been more documentation of what these tests did and their proper 
> configuration.  But to just plop them into a source rpm package without this 
> information seems like the wrong way to go.

My take is that the tests are testing everything that can be tested 
without actually installing and running the programs.

> Open source development is difficult enough without all this easily avoided 
> toe-stubbing.  Better documentation is needed.

Let me know how it can be better documented. (better yet, send a patch! 
:-)

I love making things better.

> Oh well.  Perhaps this tale of mine will help someone else out in the future.
>

Yes, I hope so.  Thanks for the tale.

--
David Wayne Summers          "Linux: Because reboots are for hardware upgrades!"
david@summersoft.fay.ar.us   PGP Key: http://summersoft.fay.ar.us/~david/pgp.txt
PGP Key fingerprint =  0B44 B118 85CC F4EC 7021  1ED4 1516 5B78 E320 2001

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org