RHSecurityCompliance / contest

Content Testing for ComplianceAsCode/content
Other
4 stars 7 forks source link

Search for extracted rpm src dir instead of hardcoded path #266

Closed mildas closed 2 weeks ago

mildas commented 2 weeks ago

In Fedora 41<=, RPM 4.20 introduced Guaranteed per-build directory causing rpmbuild process extract the sources to BUILD/foo-<version>-build/foo-<version>/ instead of BUILD/foo-<version>/. https://artifacts.dev.testing-farm.io/d009d9a8-6ded-4578-b2f8-31163d6ada1d/

The simplest and obvious solution to me (keeping it compatible with old RPM versions) is just to search for the directory. Hardcoding is not the right way. Citing one of comments from rpm Github issues:

Rpm never gave any promises about the directory outside itself, but when a thing stays the same for 20+ years people start assuming it, fact of life.

So far only Fedora41<= is affected and blocks rpmbuild test introduction to content upstream CI (only Fedora jobs). I know Contest doesn't support Fedora, but wouldn't hold my breath they don't introduce it to RHEL10 Beta as well.

Being tested in https://github.com/ComplianceAsCode/content/pull/12176

comps commented 2 weeks ago

Sure, LGTM.

Maybe some short comment explaining why we do it like that would be useful in the code.

mildas commented 2 weeks ago

@comps comment added