Bug 481307 - qpid-java source RPM build leaves things in BUILD directory
qpid-java source RPM build leaves things in BUILD directory
Status: NEW
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java (Show other bugs)
1.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: messaging-bugs
Jeff Needle
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-23 09:51 EST by Jeff Needle
Modified: 2018-02-06 11:39 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
SPEC file patch (2.97 KB, patch)
2009-03-27 09:23 EDT, Jan Sarenik
no flags Details | Diff
spec file diff (1.62 KB, patch)
2010-03-29 04:59 EDT, Jan Sarenik
no flags Details | Diff
tarballs fetching script diff (1.79 KB, patch)
2010-03-29 05:00 EDT, Jan Sarenik
no flags Details | Diff

  None (edit)
Description Jeff Needle 2009-01-23 09:51:30 EST
After building qpid-java-0.3.733043 from the source rpm, things are left in the BUILD directory, changing the behavior of the way subsequent SRPMs are rebuilt.

# ls -l /usr/src/redhat/BUILD
/usr/src/redhat/BUILD:
total 24
drwxr-xr-x  8 root root 4096 Jan  9 12:14 gentools
drwxr-xr-x 23 root root 4096 Jan 23 09:32 qpid-java-0.3.733043
drwxr-xr-x  2 root root 4096 Jan  9 12:14 specs

When qpidc is rebuilt after qpid-java, it fails to build:

Making all in src
make[1]: Entering directory `/usr/src/redhat/BUILD/qpidc-0.4.732838/src'
ruby -I ../rubygen ../rubygen/generate gen /usr/src/redhat/BUILD/qpidc-0.4.732838/./../specs/amqp.0-10-qpid-errata.xml ../xml/cluster.xml all ./rubygen.mk; touch rgen.timestamp
ruby: No such file or directory -- ../rubygen/generate (LoadError)
../managementgen/qmf-gen -m ./managementgen.mk -q -o gen/qmf ../../specs/management-schema.xml ./qpid/acl/management-schema.xml ./qpid/cluster/management-schema.xml; touch mgen.timestamp
Traceback (most recent call last):
  File "../managementgen/qmf-gen", line 80, in ?
    package = SchemaPackage(typefile, schemafile, opts)
  File "/usr/src/redhat/BUILD/qpidc-0.4.732838/managementgen/qmfgen/schema.py", line 1212, in __init__ 
    dom = parse (schemafile)
  File "/usr/lib64/python2.4/site-packages/_xmlplus/dom/minidom.py", line 1915, in parse 
    return expatbuilder.parse(file)
  File "/usr/lib64/python2.4/site-packages/_xmlplus/dom/expatbuilder.py", line 924, in parse
    fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: './qpid/acl/management-schema.xml'
../managementgen/qmf-gen -m ./managementgen.mk -q -o gen/qmf ../../specs/management-schema.xml ./qpid/acl/management-schema.xml ./qpid/cluster/management-schema.xml
Traceback (most recent call last):
  File "../managementgen/qmf-gen", line 80, in ?
    package = SchemaPackage(typefile, schemafile, opts)
  File "/usr/src/redhat/BUILD/qpidc-0.4.732838/managementgen/qmfgen/schema.py", line 1212, in __init__
    dom = parse (schemafile)
  File "/usr/lib64/python2.4/site-packages/_xmlplus/dom/minidom.py", line 1915, in parse
    return expatbuilder.parse(file)
  File "/usr/lib64/python2.4/site-packages/_xmlplus/dom/expatbuilder.py", line 924, in parse
    fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: './qpid/acl/management-schema.xml'
make[1]: *** [managementgen.mk] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/qpidc-0.4.732838/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.34828 (%build)

If built on its own, it succeeds.

This results in TPS' srpmtest to fail.  It also needs to be fixed because nothing should be leaving files in the top-level BUILD directory.
Comment 1 Justin Ross 2009-01-23 09:58:30 EST
I think there are two issues here.

1. It's bad form (and one that contributes to the trouble above) to have top-level source dirs without version info.  As it's configured right now, the java build system depends on the absence of that version info.

One course of action we can take is to (gulp) take the entire qpid distribution as the source tarball for the java project.  That would work.

We could also adjust how the java build system works, such that it looks up the specs and python code that it needs at installed locations.

2. The test that qpid/cpp is using to determine whether to generate code is possibly wrong.  It appears that if a spec file is present at all at ../specs/qpid.0-10....xml, it generates code.  This is not favorable when we build from our dist tarball.

It would be better if the qpid/cpp makefiles instead checked to see if the code was already generated, as it is in dist tarball's case.
Comment 2 Rajith Attapattu 2009-03-09 15:37:58 EDT
With Nunos help I have modified this behaviour.
Could Jeff/Justin please verify this?
Comment 3 Jeff Needle 2009-03-10 11:40:41 EDT
Sure - what build did this appear in?  Last set of TPS runs was still failing due to this, but when the new builds get added to the errata, TPS will be rerun and I'll check this.
Comment 5 Jan Sarenik 2009-03-23 09:03:43 EDT
rpm -Uvh qpid-java-0.5.751061-1.el5.src.rpm
cd /usr/src/redhat/SPECS/
rpmbuild -bb --clean qpid-java.spec
rpm -Uvh qpidc-0.5.752581-1.el5.src.rpm
rpmbuild -bb --clean qpidc.spec

Everything is erroneous the same way as described above
(even the qpidc build fails on the same error).

When I manually remove files from BUILD directory,
qpidc compiles cleanly.
Comment 6 Jan Sarenik 2009-03-27 09:23:16 EDT
Created attachment 337011 [details]
SPEC file patch

Please apply the patch in attachment to make qpid-java
build cleanly without leaving any files in /usr/src/redhat/BUILD

patch -N -i qpid-java.spec.diff
Comment 7 Jeff Needle 2009-03-30 15:21:08 EDT
Fix failed, moving back to ASSIGNED, changing target to 1.2.
Comment 11 Jan Sarenik 2010-03-29 04:59:47 EDT
Created attachment 403233 [details]
spec file diff
Comment 12 Jan Sarenik 2010-03-29 05:00:49 EDT
Created attachment 403234 [details]
tarballs fetching script diff

Rajith, please apply both patches to the tree under cvs.devel
Comment 13 Jan Sarenik 2010-03-29 05:05:13 EDT
The patched build process uses the same methodology as qpid-cpp-mrg
does.

Actually the build of qpid-cpp-mrg was not affected by qpid-java
(I tried the described problem on current packages), but it is
much cleaner to do it the patched way.
Comment 14 Rajith Attapattu 2010-06-15 20:21:23 EDT
Jan,

Can you try it on the latest packages?
Mikeb helped out in cleaning the spec files and I believe the problem is solved now.

Rajith
Comment 15 Jan Sarenik 2010-06-22 04:50:51 EDT
Sorry Rajith, but it is still far from cleaned up.

  # rpm -Uvh qpid-java-0.7.946106-4.el5.src.rpm
  # rpmbuild -bb /usr/src/redhat/SPECS/qpid-java.spec
  ...
  Wrote: /usr/src/redhat/RPMS/noarch/qpid-java-common-0.7.946106-4.el5_3.noarch.rpm
  Wrote: /usr/src/redhat/RPMS/noarch/qpid-java-client-0.7.946106-4.el5_3.noarch.rpm
  Wrote: /usr/src/redhat/RPMS/noarch/qpid-java-example-0.7.946106-4.el5_3.noarch.rpm
  Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.95116
  + umask 022
  + cd /usr/src/redhat/BUILD
  + cd qpid-java-0.7.946106
  + rm -rf /var/tmp/qpid-java-0.7.946106-4.el5_3-root-root
  + exit 0
  # ls /usr/src/redhat/BUILD/
  gentools/  python/  qpid-deps/  qpid-java-0.7.946106/  specs/

The last line is what can cause problems (and did in the past).
Everything should be inside the qpid-java-<version> directory
to keep things clean.

But if one builds always with clean /usr/src/redhat/BUILD
everything works fine.

Have a look at the patches I sent in comments #11 and #12.
Comment 16 Rajith Attapattu 2010-07-12 18:15:22 EDT
I finally understood what the problem is.
"Everything should be inside the qpid-java-<version> directory"

Ok I think it's best to tackle this after 1.3

Note You need to log in before you can comment on or make changes to this bug.