rpmlint icon indicating copy to clipboard operation
rpmlint copied to clipboard

Error about hardlinking over partitions with 2.2.0

Open smooge opened this issue 3 years ago • 4 comments

I ran into a catch-22 issue with rpmlint-2.2.0 and hardlinking.

If in one case we hardlink between /usr/bin and /usr/lib64 we get errors like:

qt5-qtbase-devel.x86_64: E: hardlink-across-partition /usr/lib64/qt5/bin/uic /usr/bin/uic-qt5 Your package contains two files that are apparently hardlinked and that are likely on different partitions. Installation of such an RPM will fail due to RPM being unable to unpack the hardlink. Do not hardlink across the first two levels of a path, e.g. between /var/ftp and /var/www or /etc and /usr.

qt5-qtbase-devel.x86_64: W: cross-directory-hard-link
/usr/lib64/qt5/bin/uic /usr/bin/uic-qt5
File is hard linked across directories. This can cause problems in
installations where the directories are located on different devices.

but if you don't then you get an error about %fdupes needing to be used and the packages should be hardlinked across directories.

qt5-qtbase-examples.x86_64: E: files-duplicated-waste 168944
Your package contains duplicated files that are not hard- or symlinks. You
should use the %fdupes macro to link the files to one.
qt5-qtbase-examples.x86_64: W: files-duplicate
/usr/lib64/qt5/examples/widgets/itemviews/puzzle/example.jpg
/usr/lib64/qt5/examples/widgets/draganddrop/puzzle/example.jpg

It seems that this is a no-win situation.

smooge avatar Dec 11 '21 16:12 smooge

@Vogtinator @DimStar77 Can you please help me if the cross-directory-hard-link is a correct rpmlint error reported?

marxin avatar Dec 13 '21 09:12 marxin

At least post usr-merge it's not really possible to have /usr/lib64 and /usr/bin on different partitions.

In openSUSE packages, /usr/bin/uic-qt5 is a symlink so we avoided that issue by accident.

Vogtinator avatar Dec 13 '21 09:12 Vogtinator

I don't think /usr/bin being split onto a different partition than /usr/lib64 was ever considered a supported setup in any distro. So rpmlint seems to be slightly too eager here

DimStar77 avatar Dec 13 '21 09:12 DimStar77

I don't think /usr/bin being split onto a different partition than /usr/lib64 was ever considered a supported setup in any distro. So rpmlint seems to be slightly too eager here

I see, to be honest, the check only compares parent directory of 2 hardlinks:

https://github.com/rpm-software-management/rpmlint/blob/497dfb3f85b92b9b465089d24c951ac9e024b4ef/rpmlint/checks/FilesCheck.py#L584-L586

Theoretically, it can only report when top-most directories are different. One more note, openSUSE config has it disabled the check: https://github.com/rpm-software-management/rpmlint/blob/497dfb3f85b92b9b465089d24c951ac9e024b4ef/configs/openSUSE/opensuse.toml#L30

marxin avatar Dec 13 '21 10:12 marxin