rules_pkg icon indicating copy to clipboard operation
rules_pkg copied to clipboard

pkg_rpm with prebuild binary is not working

Open rapatchi opened this issue 1 year ago • 6 comments

I was trying out the example mentioned in https://github.com/bazelbuild/rules_pkg/tree/main/examples/prebuilt_rpmbuild to use prebuilt rpmbuild binary for creating an rpm package.

I am getting the below error:

INFO: From MakeRpm test-rpm-all.rpm:
Error calling rpmbuild:
Executing(%build): /bin/sh -e /tmp/tmpunk6msq6/TMP/rpm-tmp.Dvj25Y
+ umask 022
+ cd /tmp/tmpunk6msq6/BUILD
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%install): /bin/sh -e /tmp/tmpunk6msq6/TMP/rpm-tmp.q63uwP
+ umask 022
+ cd /tmp/tmpunk6msq6/BUILD
+ /bin/rm -rf /tmp/tmpunk6msq6/BUILDROOT
+ /bin/mkdir -p /tmp/tmpunk6msq6
+ /bin/mkdir /tmp/tmpunk6msq6/BUILDROOT
+ cp WORKSPACE BUILD readme.md test_rpm.spec /tmp/tmpunk6msq6/BUILDROOT/
Processing files: example-1-0.x86_64
error: No file attributes configured
Provides: example = 1-0 example(x86-64) = 1-0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1

RPM build errors:
    No file attributes configured

No RPM file created.
ERROR: /usr/local/google/home/rapatchi/rules_pkg/examples/prebuilt_rpmbuild/BUILD:18:8: output 'test-rpm-all.rpm' was not created
ERROR: /usr/local/google/home/rapatchi/rules_pkg/examples/prebuilt_rpmbuild/BUILD:18:8: MakeRpm test-rpm-all.rpm failed: not all outputs were created or valid
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.226s, Critical Path: 0.20s
INFO: 8 processes: 7 internal, 1 linux-sandbox.
ERROR: Build did NOT complete successfully

rpmbuild binary version:

rapatchi@rapatchi:~/rules_pkg/examples/prebuilt_rpmbuild/local$ ./rpmbuild_binary --version
RPM version 4.18.0

rapatchi avatar Dec 21 '23 08:12 rapatchi

It works for me. Did you follow the instructions in the readme and manually copy a version of rpmbuild into the example?

aiuto avatar Dec 22 '23 04:12 aiuto

It did not work for me. Is the binary version which you are using is same as mine ?. And also if rpmbuild is installed can you uninstall it ?. What i observed is that if the rpmbuild is installed on the system it's not reporting the error.

rapatchi avatar Dec 26 '23 12:12 rapatchi

By design, it is not the same. The whole point of the exercise is to copy a working rpmbuild from your.machine someplace to your source tree and run it from there. Tte idea is that you can check it in rather than replying on it being in your system image. We can't distribute rpmbuild with rules_pkg because that would add in their license.

On Tue, Dec 26, 2023, 7:06 AM rapatchi @.***> wrote:

It did not work for me. Is the binary version which you are using is same as mine ?.

— Reply to this email directly, view it on GitHub https://github.com/bazelbuild/rules_pkg/issues/798#issuecomment-1869494773, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXHHHEB3MYGDT2YBNZYKNLYLK4UNAVCNFSM6AAAAABA6AMQTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGQ4TINZXGM . You are receiving this because you commented.Message ID: @.***>

aiuto avatar Dec 27 '23 20:12 aiuto

I did check it. And the error mentioned in the description is what I am getting. Hence I was asking you for which version is working for you locally.

My hunch is the we are using different versions of rpmbuild and in the version which I have installed is expecting rpmlib as well.

rapatchi avatar Jan 19 '24 00:01 rapatchi

Just tried it again on my personal machine. Works fine.

$ rpmbuild --version
RPM version 4.16.1.2

Perhaps there was some change between rpmbuild versions that breaks pkg_rpm, but I have not heard about it from other sources.

aiuto avatar Feb 08 '24 19:02 aiuto

My hunch is the we are using different versions of rpmbuild and in the version which I have installed is expecting rpmlib as well.

What OS + version are you doing this on?

kellyma2 avatar Apr 17 '24 05:04 kellyma2