rules_pkg
rules_pkg copied to clipboard
pkg_rpm with prebuild binary is not working
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
It works for me. Did you follow the instructions in the readme and manually copy a version of rpmbuild into the example?
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.
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: @.***>
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.
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.
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?