Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error about hardlinking over partitions with 2.2.0 #771

Open
smooge opened this issue Dec 11, 2021 · 4 comments
Open

Error about hardlinking over partitions with 2.2.0 #771

smooge opened this issue Dec 11, 2021 · 4 comments

Comments

@smooge
Copy link

smooge commented Dec 11, 2021

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.

@marxin
Copy link
Contributor

marxin commented Dec 13, 2021

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

@Vogtinator
Copy link

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.

@DimStar77
Copy link
Contributor

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

@marxin
Copy link
Contributor

marxin commented Dec 13, 2021

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:

for hardlink in hardlinks.get((rdev, inode), ()):
if Path(hardlink).parent != Path(f).parent:
self.output.add_info('W', pkg, 'cross-directory-hard-link', f, hardlink)

Theoretically, it can only report when top-most directories are different. One more note, openSUSE config has it disabled the check:

'.*cross-directory-hard-link.*',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants