Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3673 - apache fails to build properly when --buildpkg is used
Summary: apache fails to build properly when --buildpkg is used
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Daniel Robbins (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-12 16:42 UTC by Jon Nelson (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

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


Attachments
changes to apache-1.3.26-r2.ebuild (apache.diff,1.57 KB, patch)
2002-06-25 20:00 UTC, Jon Nelson (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Nelson (RETIRED) 2002-06-12 16:42:24 UTC
I was unable to build apache using --buildpkg such that it works.
g2boojum suggested I try it without --buildpkg.
That worked. (I had unmerge apache first)
I wanted to know the difference, so without unmerging apache first, I emerge
--buildpkg apache.

When it merged in, this is what I got:

--- /etc/apache/conf/apache.conf.default        Wed Jun 12 16:24:52 2002
+++ /etc/apache/conf/._cfg0000_apache.conf.default      Wed Jun 12 16:28:38 2002
@@ -202,86 +202,6 @@
 #
 # Example:
 # LoadModule foo_module libexec/mod_foo.so
-LoadModule mmap_static_module lib/apache/mod_mmap_static.so
-LoadModule vhost_alias_module lib/apache/mod_vhost_alias.so
-LoadModule env_module         lib/apache/mod_env.so
-LoadModule config_log_module  lib/apache/mod_log_config.so
-LoadModule agent_log_module   lib/apache/mod_log_agent.so
-LoadModule referer_log_module lib/apache/mod_log_referer.so
-LoadModule mime_magic_module  lib/apache/mod_mime_magic.so
-LoadModule mime_module        lib/apache/mod_mime.so
-LoadModule negotiation_module lib/apache/mod_negotiation.so
-LoadModule status_module      lib/apache/mod_status.so
-LoadModule info_module        lib/apache/mod_info.so
-LoadModule includes_module    lib/apache/mod_include.so
-LoadModule autoindex_module   lib/apache/mod_autoindex.so
-LoadModule dir_module         lib/apache/mod_dir.so
-LoadModule cgi_module         lib/apache/mod_cgi.so
-LoadModule asis_module        lib/apache/mod_asis.so
-LoadModule imap_module        lib/apache/mod_imap.so
-LoadModule action_module      lib/apache/mod_actions.so
...
and ServerAdmin was different


This is a very serious bug!
Apache *will not run* if built using --buildpkg.
Comment 1 Grant Goodyear (RETIRED) gentoo-dev 2002-06-12 16:48:39 UTC
jnelson tells me he used the freakily-fast version.  I verified the bug w/ the 
current version in Portage.  One can also obtain this bug by doing an

ebuild apache-1.3.24-r2.ebuild package
followed by
emerge --usepkg apache.

Comment 2 Jon Nelson (RETIRED) 2002-06-12 16:54:00 UTC
Confirmed that the "bad" file is in the tbz2 generated by --buildpkg.
Comment 3 Jon Nelson (RETIRED) 2002-06-12 17:08:13 UTC
using 
ebuild --debug apache-1.3.24-r2.ebuild compile
then
ebuild --debug apache-1.3.24-r2.ebuild install
then
diff /etc/apache/conf/apache.conf.default /var/tmp/portage/apachult
3.24-r2/image/etc/apache/conf/apache.conf.default
I get just *one* difference, the ServerAdmin line has jnelson@my_hostname
instead of root@..

Hmmm...

(I can only assume it's grabbing it from the environ, probably $USER, or perhaps
$LOGUSER, the only environment variables that have my name in it, despite my
being root)

Comment 4 Jon Nelson (RETIRED) 2002-06-12 17:14:29 UTC
I believe the step that builds apache.conf.default is in the Makefile for
apache, in the install-config target.

./src/helpers/install.sh -c -m 644 ./conf/httpd.conf-dist[*]
/var/tmp/portage/apache-1.3.24-r2/image//etc/apache/conf/apache.conf.default

When I am root via 'su -' (clears environment), then everything seems to work.

Hmmm.....

Comment 5 Jon Nelson (RETIRED) 2002-06-12 17:17:22 UTC
If I use emerge, I get the (bad) behavior.
If I use ebuild, after having become root via su (not su -), then 99% of the
problems are gone (apache appears to use either USER or LOGUSER from the
environ, which su doesn't reset, but su - (of course) does)
I suspect that 'su -' + ebuild (package) would result in a "good" tbz2.
Why is 'emerge' different than 'ebuild'?

Comment 6 Jon Nelson (RETIRED) 2002-06-12 17:20:37 UTC
./src/helpers/binbuild.sh:  USER=$1
./src/helpers/binbuild.sh:  USER="`src/helpers/buildinfo.sh -n %u@%h%d`"
./src/helpers/binbuild.sh:  echo "system and was built by \"$USER\"." && \
./src/helpers/buildinfo.sh:    username="$USER"


Aha!

We get closer.
Comment 7 Donny Davies (RETIRED) gentoo-dev 2002-06-20 12:35:54 UTC
Jon

the problem is that MY_BUILTINS is not defined inside src_compile.
this is because pkg_setup() is not getting run by emerge i suppose.

we had this problem before (bad apache .tbz'2) then drobbins ssh'd
to my dev box, we discovered pkg_setup() was not correctly done in
the portage code.  

this looks like the exact same bug.

it is causing other people to report related, but totally redundant and 
seemigly weird bugs.  

to 'quick fix' it, move the lines in pkg_setup() into src_compile
and do emerge --buildpkg now. (so basically relocate the pkg_setup() code into 
src_compile).  you'll see that it now works.

Comment 8 Jon Nelson (RETIRED) 2002-06-25 20:00:12 UTC
Created attachment 1805 [details, diff]
changes to apache-1.3.26-r2.ebuild

This allows apache to be built successfully with --buildpkg
Additionally, it makes the 'add apache uid/gid' stuff to postinst, instead of
the pkg_setup.	Obviously, pkg_setup won't work with --buildpkg, either.
Comment 9 Daniel Robbins (RETIRED) gentoo-dev 2002-06-27 23:47:06 UTC
This *should* be fixed in Portage 2.0.9.  Sent jnelson and woodchip a trivial
portage fix that should do the trick.
Comment 10 Daniel Robbins (RETIRED) gentoo-dev 2002-06-29 16:33:16 UTC
This should be fixed in Portage 2.0.9