Repository navigation
install_helper: make the mount.sshfs link without ln --relative - #412
Open
gowtham0992 wants to merge 2 commits into
Open
gowtham0992 wants to merge 2 commits into
gowtham0992 wants to merge 2 commits into
Conversation
--relative is a GNU coreutils option. BusyBox's ln does not have it, so "meson install" fails on systems that use BusyBox as their ln (QNX's self-hosted distribution is one). Compute the relative path in plain sh instead. For the six prefix/sbindir/bindir layouts tried, including the default, sbindir equal to bindir and an absolute sbindir, the links are the same as GNU ln --relative makes.
gowtham0992
added a commit
to gowtham0992/qfuse
that referenced
this pull request
Nov 29, 2026
Use cd -P and pwd -P on the two directories (both exist by then) before working out the relative path, so "." and ".." in sbindir or bindir and a symlinked sbindir give the same link as GNU ln --relative, and a relative prefix cannot make the loop run forever. Checked against ln --relative on Debian for ten layouts, including ./sbin, sbin/../sbin, bin/../sbin with ./bin, and sbin as a symlink to another directory; and with BusyBox's ln.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
utils/install_helper.shusesln --relative, which is GNU coreutils only. With BusyBox'sln,meson installfails (BusyBox prints its usage and exits 1). I ran into it packaging SSHFS for QNX, whose self-hosted distribution uses BusyBox.This computes the relative path in plain sh and passes it to a plain
ln -s. I compared it with the current script under GNU coreutils'lnon Debian for six prefix/sbindir/bindir layouts:/usr sbin bin,/usr bin bin,/usr local/sbin local/bin,/opt/sshfs sbin bin,/usr /sbin binand/ sbin usr/bin. The links are identical in all six. With BusyBox'slnthe current script fails and this one makes../bin/sshfs. shellcheck is clean.Update: the second commit makes the relative path match
ln --relativein two more cases. It now creates the directories first and resolves them withcd -Pandpwd -P, as GNUlncanonicalises them, so.and..segments and a symlinked sbindir give the same link. Compared again under GNU coreutils for ten layouts: the six above, plus/usr ./sbin bin,/usr sbin/../sbin bin,/usr bin/../sbin ./bin, and/usr sbin binwith sbindir a symlink to another directory. The links are identical in all ten, and the script works with BusyBox'sln.