rules_pkg icon indicating copy to clipboard operation
rules_pkg copied to clipboard

RPM source_date_epoch test should check rpmbuild version, not system rpm

Open nacl opened this issue 4 years ago • 3 comments

We have a skip in this test, but we dumbly check the system "rpm" binary than the rpmbuild binary used to build the RPM in the first place. We have skipping logic here:

https://github.com/bazelbuild/rules_pkg/blob/9748dfa1a9a884d4107e5980f4bb3fa330f18b15/pkg/tests/rpm/source_date_epoch/rpm_contents_vs_manifest_test.py#L57-L64

But it could not be working for numerous reasons. Investigate further.

Originally posted by @nacl in https://github.com/bazelbuild/rules_pkg/pull/443#discussion_r742274241

nacl avatar Nov 04 '21 13:11 nacl

See also https://github.com/bazelbuild/rules_pkg/pull/443#issuecomment-959905550

nacl avatar Nov 04 '21 13:11 nacl

So... I notice that the tests fail on my machine, but my rpmbuild version is 4.17.0 The suspicious thing is

rror: Unable to open sqlite database zzz/.rpmdb/rpmdb.sqlite: unable to open database file
error: cannot open Packages index using sqlite - Operation not permitted (1)
error: cannot open Packages database in /zzz/.rpmdb
Ferror: Unable to open sqlite database /zzz/.rpmdb/rpmdb.sqlite: unable to open database file

then

  self.assertEqual(actual_epoch, EXPECTED_EPOCH)
AssertionError: '1643058161' != '1616472000'
- 1643058161
+ 1616472000

So, I am not sure if there is more to it than that.

aiuto avatar Feb 01 '22 21:02 aiuto

Also, sending a PR to get rpmbuild version into the toolchain. if you want to go that route, we can make source date epoch support a condition, and use exec_compatible_with on the tests which would require it. Much like have_rpmbuild.

aiuto avatar Feb 01 '22 21:02 aiuto