fedora-ci / rpminspect-runner

Container image for the rpminspect pipeline
Apache License 2.0
3 stars 9 forks source link

Expose result.json and verbose.log as TMT artifacts #83

Closed martinpitt closed 1 year ago

martinpitt commented 2 years ago

TF stopped archiving the full built source tree [1] to save a lot of space. That caused result.json and verbose.log to not get save as artifacts any more. As these are are useful, put them into $TMT_TEST_DATA, which is the official directory for artifacts.

[1] https://gitlab.com/testing-farm/infrastructure/-/merge_requests/95


Plus a few more small cleanups. I broke this out of PR #80 as that is still being discussed; these commits here should be the simple bits.

martinpitt commented 2 years ago

I did the local test steps in docs/development.md. I built a local quay.io/fedoraci/rpminspect:devel.

rpminspect-fedora -T license gnome-chess-42.0-1.fc37

Running this works as expected. But running all inspections

rpminspect-fedora gnome-chess-42.0-1.fc37

crashes:

rpminspect: libannocheck_init error: version number too small
/usr/bin/rpminspect-fedora: line 3:    46 Segmentation fault      (core dumped) /usr/bin/rpminspect -c /usr/share/rpminspect/fedora.yaml $*

I already noticed that in PR #80 with the container refresh. @dcantrell , it looks like your COPR recently got a new version which causes this crash now. Can you please have a look?

martinpitt commented 2 years ago

Also happens with rpminspect directly, without the runner script wrapper:

# rpminspect -c /usr/share/rpminspect/fedora.yaml ./x86_64/gnome-chess-42.0-1.fc37.x86_64.rpm
rpminspect: libannocheck_init error: version number too small
Segmentation fault (core dumped)
martinpitt commented 2 years ago

@msrb: This is blocked in the sense of "we cannot refresh the container until the rpminspect crash is fixed". But I'd still appreciate an initial review, as this is fairly urgent -- people may want/need result.json from the artifact for some purposes.

martinpitt commented 1 year ago

I tested this today in current Fedora 37:

toolbox create -r 37
toolbox enter -r 37
sudo dnf copr enable -y dcantrell/rpminspect
sudo dnf install -y rpminspect

This installs the latest build 1.11-0.1.202211231559git683d045.fc37.

But this is now even worse than last week:

sudo dnf download gnome-chess
rpminspect -c /usr/share/rpminspect/fedora.yaml gnome-chess*.rpm
# crashes with: rpminspect: symbol lookup error: /lib64/librpminspect.so.0: undefined symbol: libannocheck_reinit

Unfortunately the previous build does not have any binaries any more, so I can't try with 20221116 that we currently run in production.

martinpitt commented 1 year ago

So I tested this the other way around, start from current production container with 20221116:

podman run -it --rm quay.io/fedoraci/rpminspect:d1eb67c bash
cd /tmp/
dnf download gnome-chess
rpminspect -c /usr/share/rpminspect/fedora.yaml gnome-chess*.rpm

This works. I tried to upgrade rpminspect to latest build alone, but it depends on newer annocheck:

# dnf update rpminspect
Last metadata expiration check: 0:00:38 ago on Mon Dec  5 13:34:36 2022.
Dependencies resolved.
============================================================================================================
 Package              Arch   Version              Repository                                           Size
============================================================================================================
Upgrading:
 librpminspect        x86_64 1.11-0.1.202211231559git683d045.fc37
                                                  copr:copr.fedorainfracloud.org:dcantrell:rpminspect 335 k
 rpminspect           x86_64 1.11-0.1.202211231559git683d045.fc37
                                                  copr:copr.fedorainfracloud.org:dcantrell:rpminspect 103 k
Installing dependencies:
 annobin-libannocheck x86_64 10.92-1.fc37         updates                                              81 k
 binutils-devel       x86_64 2.38-25.fc37         updates                                             4.3 M
 libpkgconf           x86_64 1.8.0-3.fc37         fedora                                               36 k
 pkgconf              x86_64 1.8.0-3.fc37         fedora                                               41 k
 pkgconf-m4           noarch 1.8.0-3.fc37         fedora                                               14 k
 pkgconf-pkg-config   x86_64 1.8.0-3.fc37         fedora                                               10 k
 zlib-devel           x86_64 1.2.12-5.fc37        fedora                                               44 k

Transaction Summary
============================================================================================================
Install  7 Packages
Upgrade  2 Packages

Curiously that also works. dnf update has 39 packages, and installing them all still works.

So I rebuilt the rpminspect-runner container, and it still crashes the same way:

# rpminspect-fedora gnome-chess-42.0-1.fc37
rpminspect: libannocheck_init error: version number too small
/usr/bin/rpminspect-fedora: line 3:   143 Segmentation fault      (core dumped) /usr/bin/rpminspect -c /usr/share/rpminspect/fedora.yaml $*

# rpminspect -c /usr/share/rpminspect/fedora.yaml /var/tmp/rpminspect/gnome-chess-42.0.8xHGAy/after/x86_64/gnome-chess-42.0-1.fc37.x86_64.rpm 
rpminspect: libannocheck_init error: version number too small
Segmentation fault (core dumped)

So in between the symbol lookup error and the crash I can't make this work.

martinpitt commented 1 year ago

Tracked in https://github.com/rpminspect/rpminspect/issues/965

martinpitt commented 1 year ago

Thanks @dcantrell for fixing this! I confirm that the latest copr build 1.11-0.1.202212121726git4ae835f works fine again. I rebuilt the rpminspect-runner container and ran all inspections on it:

podman build -t quay.io/fedoraci/rpminspect:devel .
podman run -ti --rm quay.io/fedoraci/rpminspect:devel /bin/bash

# and inside
rpm -q rpminspect
# rpminspect-1.11-0.1.202212121726git4ae835f.fc37.x86_64

rpminspect-fedora gnome-chess-43.0-1.fc37
# succeeds; lots of output, like
# 5) annocheck 'hardened' test passes for /usr/bin/gnome-chess on s390x 
# 
# Result: INFO
# Waiver Authorization: Not Waivable
# ...

@msrb , this is finally unblocked, and the cleanups here are quite urgent to restore the important artifacts after the recent TF changes. Can you please review this? (If you have doubts about the $PATH thing, I'm happy to drop the commit again, it's not super important)

msrb commented 1 year ago

Looks good, thanks! ;)