Skip to content

abi-check: Only ignore text files

Mathieu Bridon requested to merge bochecha/abi-check-file-pie into 18.08

We obviously want to only check the ABI of shared libraries. To that end, we would check "is this a shared library" by looking at the MIME type of each file, and only keeping "application/x-sharedlib".

And everything went fine, until file 5.33 was released, which changed the returned MIME type for PIE executable.

That means ~98% of our shared libraries, which are PIE executables, now have the MIME type "application/x-pie-executable", and as such are completely ignored by the ABI checker.

As a result the ABI checker script will just always report ABI compatibility, unless an ABI break happens in the remaining 2% of libraries.

The only reason this didn't cause any issue for us yet is because we run our CI on Fedora 28, which reverts that change:

https://src.fedoraproject.org/rpms/file/blob/f28/f/file-5.33-pie-executable-revert.patch

Nevertheless, we have to fix this.

This commit completely changes the check upside down: instead of keeping only what we think is a shared library, let's only ignore what we know isn't one. Currently that means ignoring text files.

In the future, if files that aren't shared libraries also aren't text files, they will pass through this check and abidiff will just fail on them, causing a visible error, instead of silently ignoring the problem.

Merge request reports