FS#60973 - [qt5-base] Symbolic links should be relative, not absolute.

Attached to Project: Arch Linux
Opened by Stephan S (buzo) - Wednesday, 05 December 2018, 11:28 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 09 December 2018, 21:07 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Felix Yan (felixonmars)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Symbolic links should be relative, not absolute. So in PKGBUILD, substitute

ln -s /usr/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
with
ln -s $(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5

Thanks!

Additional info:
* package version: qt5-base 5.11.2-3
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 09 December 2018, 21:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  in svn
Comment by Eli Schwartz (eschwartz) - Wednesday, 05 December 2018, 14:02 GMT
Why?
Comment by Stephan S (buzo) - Wednesday, 05 December 2018, 14:19 GMT
Sorry, I thought that would be obvious. First, the symlink works then regardless of the mount point. An absolute link may point to some completely different location if / is mounted to e. g. /mnt/install_target.

Second, the kernel needs to do much less work for resolving the symlink. See https://en.wikipedia.org/wiki/Symbolic_link#Storage_of_symbolic_links : «… the operating system still needs to parse the path name in the link, which always requires reading additional inodes and generally requires reading other, and potentially many, directories, processing both the list of files and the inodes of each of them until it finds a match with the link's path components. Only when a link points to a file in the same directory do "fast symlinks" provide significantly better performance than other symlinks.»

And third, both the ln command and the «ls -l» output is shorter. :)
Comment by Doug Newgard (Scimmia) - Sunday, 09 December 2018, 19:06 GMT
The symlink "works", in that it's not broken but still doesn't actually work. Running these without using chroot or a container seems like a really bad idea.

Loading...