-
Notifications
You must be signed in to change notification settings - Fork 3.9k
onigumura: fix library installation #29397
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I figured out what went wrong. I pushed the commit almost completely without the commit description. It was heavily inspired by openwrt/openwrt@38b22b1 and #9233
You are right, my change is not sufficient and breaks the library, but here is what is going on. To understand this issue, we need to look at two use-cases. One with
ABI_VERSION, which I broke, and the other one withoutABI_VERSION, which was fixed.With ABI versioning:
Before:
Current master - basically broken:
After applying this fix (just adding *):
It looks like this:
Without ABI versioning:
Before:
After applying my commit:
To sum it up:
I am not entirely sure how this pattern originated in the packages feed. If I look at the main openwrt repository,
ABI_VERSIONis not typically used this way in thePackage/foo/installdefinitions. For instance, I checked the jansson package in the main repo, and it correctly ships the symlink when using ABI.TL,DR: If I am not mistaken, even packages with ABI_VERSION should preserve the correct symlink structure pointing to the actual shared object. Can we agree on this one? If yes, I will prepare a new PR to fix other packages, which I broke. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't say for other packages, but my installing of
libonig.so.5only is intentional. That's the only file the OS needs to load the library. The unversionedlibonig.sowould be used to link the binary when building a binary. It could arguably be used if one were to use an openwrt host for building binaries. However, our package system does not handle multiple packages owning the symlink well, so I never tried to head in that direction.Why do we need the
libonig.so.5.4.0file? To me it is a needless symlink that will mostly clutter /usr/lib.TLDR: I would leave the package as I'm doing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, and I see your point about saving an inode and keeping the package layout minimal. My concern is mainly consistency across OpenWrt and easier debugging in practice.
When I look at
/usr/libon a running router, the symlinked layout is what I see for the large majority of shared libraries, including core OpenWrt ones. From my point of view, the bigger problem is having several different packaging styles for essentially the same kind of library, because that makes the feed harder to maintain and makes it less obvious which approach is considered correct.In my view, it is more useful to know the exact library version that is present, not just the major version. Keeping only the major version visible does not seem like a good trade-off to me, especially when the symlink itself uses very little space. With ls -l, you can immediately see which exact library version is present. You can also inspect package contents through
apk info -L onigurumaoropkg files oniguruma, but that still does not make the full version visible in the same straightforward way if only the major-version name is kept. It becomes even more confusing when the package version does not directly match the library version, because then it is no longer obvious which exact library build is actually installed unless the full version is visible in/usr/lib.What I found is that The TLDP Program Library HOWTO explicitly describes the usual layout as SONAME -> Real Name, stating that a fully qualified soname is a symbolic link to the shared library’s real name, and that ldconfig creates sonames as symbolic links to the real names. The GNU Libtool manual’s Release numbers page also shows the same general idea of using a symlinked library name that points to the actual versioned file, although it is less explicit about SONAME terminology there. For that reason, I do not think omitting the library’s full release number is a good idea.
That being said, you are the maintainer of this package, so I will respect your decision here. I would just prefer that we keep one consistent shared-library layout across the feed, because mixing both approaches makes maintenance and debugging harder than necessary, and then we end up having to debate what is actually correct, why it should be done that way, and what the expected layout is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it looks like CI/CD agrees with me. :)
