ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1210

Can't build ZooKeeper RPM with RPM >= 4.6.0 (i.e. on RHEL 6 and Fedora >= 10)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.3.6, 3.4.4
    • Component/s: build
    • Labels:
    • Environment:

      Tested to fail on both Centos 6.0 and Fedora 14

    • Hadoop Flags:
      Reviewed
    • Release Note:
      Fix buildroot misplacement on systems with RPM>=4.6. Earlier RPM versions support --buildroot commandline flag, so this doesn't break anything on older systems.
    • Tags:
      rpm ant

      Description

      I was trying to build the zookeeper RPM (basically, `ant rpm -Dskip.contrib=1`), using build scripts that were recently merged from the work on the ZOOKEEPER-999 issue.

      The final stage, i.e. running rpmbuild failed. From what I understand it mixed BUILD and BUILDROOT subdirectories in /tmp/zookeeper_package_build_tkadlubo/, leaving BUILDROOT empty, and placing everything in BUILD.

      The full build log is at http://pastebin.com/0ZvUAKJt (Caution: I cut out long file listings from running tar -xvvf).

      1. rpm_buildroot_on_RHEL6.patch
        2 kB
        Tadeusz Andrzej Kadłubowski
      2. rpm_buildroot_on_RHEL6.patch
        2 kB
        Tadeusz Andrzej Kadłubowski
      3. rpm_buildroot_on_RHEL6.patch
        2 kB
        Tadeusz Andrzej Kadłubowski

        Activity

        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1600 (See https://builds.apache.org/job/ZooKeeper-trunk/1600/)
        ZOOKEEPER-1210. Can't build ZooKeeper RPM with RPM >= 4.6.0 (i.e. on RHEL 6 and Fedora >= 10) (Tadeusz Andrzej Kadłubowski via phunt) (Revision 1355649)

        Result = SUCCESS
        phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1355649
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/build.xml
        • /zookeeper/trunk/src/contrib/zkpython/build.xml
        • /zookeeper/trunk/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec
        • /zookeeper/trunk/src/packages/rpm/spec/zookeeper.spec
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1600 (See https://builds.apache.org/job/ZooKeeper-trunk/1600/ ) ZOOKEEPER-1210 . Can't build ZooKeeper RPM with RPM >= 4.6.0 (i.e. on RHEL 6 and Fedora >= 10) (Tadeusz Andrzej Kadłubowski via phunt) (Revision 1355649) Result = SUCCESS phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1355649 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/build.xml /zookeeper/trunk/src/contrib/zkpython/build.xml /zookeeper/trunk/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec /zookeeper/trunk/src/packages/rpm/spec/zookeeper.spec
        Hide
        Patrick Hunt added a comment -

        Thanks Tadeusz!

        Show
        Patrick Hunt added a comment - Thanks Tadeusz!
        Hide
        Jason Brooks added a comment -

        Scratch that, I think I'm hung up on something different.

        Show
        Jason Brooks added a comment - Scratch that, I think I'm hung up on something different.
        Hide
        Jason Brooks added a comment -

        I've just run into this same issue, attempting to build zookeeper-3.4.3 for Fedora 17.

        Show
        Jason Brooks added a comment - I've just run into this same issue, attempting to build zookeeper-3.4.3 for Fedora 17.
        Hide
        Tadeusz Andrzej Kadłubowski added a comment -

        The same patch, with license grant checked.

        Show
        Tadeusz Andrzej Kadłubowski added a comment - The same patch, with license grant checked.
        Hide
        Patrick Hunt added a comment -

        Tadeusz - you need to grant license explicitly to ASF each time you upload a patch - this last time you selected "no". See "manage attachments" under the attachments section (popup menu).

        Show
        Patrick Hunt added a comment - Tadeusz - you need to grant license explicitly to ASF each time you upload a patch - this last time you selected "no". See "manage attachments" under the attachments section (popup menu).
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12498121/rpm_buildroot_on_RHEL6.patch
        against trunk revision 1179371.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12498121/rpm_buildroot_on_RHEL6.patch against trunk revision 1179371. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/609//console This message is automatically generated.
        Hide
        Tadeusz Andrzej Kadłubowski added a comment -

        Generated with git diff --no-prefix.

        Show
        Tadeusz Andrzej Kadłubowski added a comment - Generated with git diff --no-prefix.
        Hide
        Mahadev konar added a comment -

        Tadeusz,
        You might want to use --no-prefix for generating the patch.

        Show
        Mahadev konar added a comment - Tadeusz, You might want to use --no-prefix for generating the patch.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12498120/rpm_buildroot_on_RHEL6.patch
        against trunk revision 1179371.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/608//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12498120/rpm_buildroot_on_RHEL6.patch against trunk revision 1179371. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/608//console This message is automatically generated.
        Hide
        Tadeusz Andrzej Kadłubowski added a comment -

        The following patch fixes rpm buildroot misplacement on systems with rpm >= 4.6. Earlier rpm versions support --buildroot commandline flag, so this patch doesn't break building on older systems.

        diff --git a/build.xml b/build.xml
        index 8448aa6..fa3f6d8 100644
        — a/build.xml
        +++ b/build.xml
        @@ -1020,7 +1020,7 @@
        </replacetokens>
        </filterchain>
        </copy>

        • <rpm specFile="zookeeper.spec" command="-ba" topDir="$ {package.buildroot}" cleanBuildDir="true" failOnError="true"
          + <rpm specFile="zookeeper.spec" command="-ba --buildroot=${package.buildroot}

          /BUILD" topDir="$

          {package.buildroot}" cleanBuildDir="true" failOnError="true"
          />
          <copy todir="${build.dir}/" flatten="true">
          <fileset dir="${package.buildroot}

          /RPMS">
          diff --git a/src/contrib/zkpython/build.xml b/src/contrib/zkpython/build.xml
          index 7ceeda9..d8254d1 100644

            • a/src/contrib/zkpython/build.xml
              +++ b/src/contrib/zkpython/build.xml
              @@ -141,7 +141,7 @@
              </filterchain>
              </copy>
        • <rpm specFile="$ {name}.spec" command="-ba" topDir="${package.buildroot}" cleanBuildDir="true" failOnError="true" />
          + <rpm specFile="${name}

          .spec" command="-ba --buildroot=$

          {package.buildroot}/BUILD" topDir="${package.buildroot}

          " cleanBuildDir="true" failOnError="true" />
          <copy todir="$

          {build.dir}

          /" flatten="true">
          <fileset dir="$

          {package.buildroot}

          /RPMS">
          <include name="*/.rpm" />
          diff --git a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec b/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec
          index 2c640b0..d1f9814 100644

            • a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec
              +++ b/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec
              @@ -52,7 +52,6 @@ Version: % {version}
              Release: %{release}
              Source0: %{_python_lib}
              Prefix: %{_prefix}
              -Buildroot: %{_build_dir}
              Requires: zookeeper-lib == %{version}

              AutoReqProv: no
              Provides: zkpython
              diff --git a/src/packages/rpm/spec/zookeeper.spec b/src/packages/rpm/spec/zookeeper.spec
              index fa1333c..8e195c7 100644

            • a/src/packages/rpm/spec/zookeeper.spec
              +++ b/src/packages/rpm/spec/zookeeper.spec
              @@ -70,7 +70,6 @@ Prefix: %{_conf_dir}
              Prefix: %{_log_dir}
              Prefix: %{_pid_dir}
              Prefix: %{_var_dir}
              -Buildroot: %{_build_dir}
              Requires: sh-utils, textutils, /usr/sbin/useradd, /usr/sbin/usermod, /sbin/chkconfig, /sbin/service, jdk >= 1.6
              AutoReqProv: no
              Provides: zookeeper
        Show
        Tadeusz Andrzej Kadłubowski added a comment - The following patch fixes rpm buildroot misplacement on systems with rpm >= 4.6. Earlier rpm versions support --buildroot commandline flag, so this patch doesn't break building on older systems. diff --git a/build.xml b/build.xml index 8448aa6..fa3f6d8 100644 — a/build.xml +++ b/build.xml @@ -1020,7 +1020,7 @@ </replacetokens> </filterchain> </copy> <rpm specFile="zookeeper.spec" command="-ba" topDir="$ {package.buildroot}" cleanBuildDir="true" failOnError="true" + <rpm specFile="zookeeper.spec" command="-ba --buildroot=${package.buildroot} /BUILD" topDir="$ {package.buildroot}" cleanBuildDir="true" failOnError="true" /> <copy todir="${build.dir}/" flatten="true"> <fileset dir="${package.buildroot} /RPMS"> diff --git a/src/contrib/zkpython/build.xml b/src/contrib/zkpython/build.xml index 7ceeda9..d8254d1 100644 a/src/contrib/zkpython/build.xml +++ b/src/contrib/zkpython/build.xml @@ -141,7 +141,7 @@ </filterchain> </copy> <rpm specFile="$ {name}.spec" command="-ba" topDir="${package.buildroot}" cleanBuildDir="true" failOnError="true" /> + <rpm specFile="${name} .spec" command="-ba --buildroot=$ {package.buildroot}/BUILD" topDir="${package.buildroot} " cleanBuildDir="true" failOnError="true" /> <copy todir="$ {build.dir} /" flatten="true"> <fileset dir="$ {package.buildroot} /RPMS"> <include name="* / .rpm" /> diff --git a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec b/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec index 2c640b0..d1f9814 100644 a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec +++ b/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec @@ -52,7 +52,6 @@ Version: % {version} Release: %{release} Source0: %{_python_lib} Prefix: %{_prefix} -Buildroot: %{_build_dir} Requires: zookeeper-lib == %{version} AutoReqProv: no Provides: zkpython diff --git a/src/packages/rpm/spec/zookeeper.spec b/src/packages/rpm/spec/zookeeper.spec index fa1333c..8e195c7 100644 a/src/packages/rpm/spec/zookeeper.spec +++ b/src/packages/rpm/spec/zookeeper.spec @@ -70,7 +70,6 @@ Prefix: %{_conf_dir} Prefix: %{_log_dir} Prefix: %{_pid_dir} Prefix: %{_var_dir} -Buildroot: %{_build_dir} Requires: sh-utils, textutils, /usr/sbin/useradd, /usr/sbin/usermod, /sbin/chkconfig, /sbin/service, jdk >= 1.6 AutoReqProv: no Provides: zookeeper
        Hide
        Tadeusz Andrzej Kadłubowski added a comment -

        I created this patch at work. My employer (Wirtualna Polska S.A.) is OK with me submitting patches upstream.

        Show
        Tadeusz Andrzej Kadłubowski added a comment - I created this patch at work. My employer (Wirtualna Polska S.A.) is OK with me submitting patches upstream.
        Hide
        Mahadev konar added a comment -

        Tadeusz,
        Mind uploading a patch?

        Show
        Mahadev konar added a comment - Tadeusz, Mind uploading a patch?
        Hide
        Tadeusz Andrzej Kadłubowski added a comment -

        I debugged this issue somewhat.

        The support for the Buildroot directive in the RPM spec files got removed in rpm 4.6.0 (AFAICT).

        The spec files created in the ZOOKEEPER-999 issue define Buildroot: %{_build_dir}, which is silently ignored on systems that use rpm >= 4.6. These include Fedora >= 10 and RHEL >=6.0

        One solution for this issue might be to pass "--buildroot=$

        {package.buildroot}

        /BUILD" to the "rpm" ant task. "--buildroot" option is supported by both old and new rpmbuild versions.

        Show
        Tadeusz Andrzej Kadłubowski added a comment - I debugged this issue somewhat. The support for the Buildroot directive in the RPM spec files got removed in rpm 4.6.0 (AFAICT). The spec files created in the ZOOKEEPER-999 issue define Buildroot: %{_build_dir}, which is silently ignored on systems that use rpm >= 4.6. These include Fedora >= 10 and RHEL >=6.0 One solution for this issue might be to pass "--buildroot=$ {package.buildroot} /BUILD" to the "rpm" ant task. "--buildroot" option is supported by both old and new rpmbuild versions.

          People

          • Assignee:
            Tadeusz Andrzej Kadłubowski
            Reporter:
            Tadeusz Andrzej Kadłubowski
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development