-
Notifications
You must be signed in to change notification settings - Fork 117
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
Melange SCA for shared library dependencies should be versioned #1621
Comments
Landing #1622 first may make implementing this request easier. |
I realized there is bit of a problem with this solution (I think) in the event that there are 2 packages that provide so:libfoo.so.1 that we probably at least need to think through. if you build apk-tools witih zlib-ng-dev in it's environment, then it would get a dep on so:libz.so.1>=2.2.2 (zlib-ng's current version) but zlib is only going to provide so:libz.so.1 at 1.3.1 . That would mean zlib is insufficient simply because it's software version is lower than zlib-ng. That seems fine in this example, but zlib decided to start versioning with '2024.1' and still providing libz.so.1 then it would flip. |
@smoser if there is more than one provider of shared library, even today we must specify explicit dep on the runtime package name. Like for example today we compile against udev, but use eudev at runtime which is wrong and almost works This is sort of why dpkg provides shlib deps and resolves sonames to real package names at build time; rather than having virtual dependencies on Generating better version deps will help for the majority cases of a single provider of the runtime library. It is true that for multiple providers neither status quo, nor this proposal addresses resolution and we need something else (manual deps, or deps resolved to package name). |
Above show that libcrypo3 / libssl3 v3.3 are backwards compatible with openssl binaries versioned v3.3; v3.2; v3.1; v3.0.
However libcrypto3 / libssl3 v3.3 are not forwards compatible with openssl binary versioned v3.4.
Same is true for many other applications such as python wolfi-dev/os#33218 and really any other users of openssl.
Same is true for major upgrades of glibc; when applications start to use newer versioned glibc abis.
It would help a lot if libcrypto3 package had
provides = so:libcrypto.so.3=3.3.1-r4
, and for each ofopenssl~3.N
packages haddepends = so:libcrypto.so.3>=3.N
as thenopenssl~3.4
would have not been a valid candidate to apk add, unless `libcrypto3 was upgraded from 3.3. to at least 3.4.Other distributions resolve this by either not changing API/ABI ever (i.e. a given release of ubuntu/debian/rhel/fedora do not upgrade openssl, not an option for a rolling distribution like Wolfi) or by using symbol level versioning.
Symbol level versioning relies on a library package maintainer to maintain a full list of symbols; and when they were introduced; such that package build process can generate accurate versioned dependencies. OpenSSL symbols are well maintained https://salsa.debian.org/debian/openssl/-/blob/debian/unstable/debian/libssl3t64.symbols?ref_type=heads however other libraries can be more complicated. See forexample https://sources.debian.org/src/zlib/1%3A1.3.dfsg%2Breally1.3.1-1/debian/zlib-core.symbols/ where lots of symbols have matching versioned symbol as the minimum package versioned; many which do not have version assigned to a symbol; or where there is drift of what a given symbols is declared as versus what the minimum required version is. This is highly accurate and flexible, but requires by-hand analysis and maintainance.
A pragmatic middle ground could be to update all the
so:
provides to be versioned; and ensure all depends onso:
to be in the from>=${{the provider package full version}}
. meaning such that packages likeopenssl
andpython-3.12-base
gaindepend = so:libcrypto.so.3>=3.4.0-r2
anddepend = so:libcrypto.so.3>=3.3.1-r2
and so on, depending on which version of libcrypto3 package was present in the build environment.This is not unique to openssl; as the same is true for glibc, libgcc, and all other libraries with a history of multi-year stable ABI, backwards compatible, but not forwards compatible.
The text was updated successfully, but these errors were encountered: