fix(libc): 'gnu' should never mean 'none' on 'linux' #11
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.
Problem
bat
has packages that are explicitly marked asgnu
, but are being erroneously detected aslibc:none
, the same as themusl
packages.History
Unexpectedly,
gnu
is a very ambiguous term. It's usually only used to identifywindows
packages as non-msvc
(libc:none
), or some specific build ofarm
(e.g.el
,hf
).Linux is implicitly
gnu
if not explicitlymusl
(Alpine) orbionic
(Android).However, many modern tools don't use
gnu
(i.e. Go, Zig), so when not specified Linux is implicitlynone
.HOWEVER, when Linux specifies
gnu
, it's explicitlylibc:gnu
, notlibc:none
.Solution
Since this would currently be the only member of a 3rd tier terms list, it's instead added as a special case for identifying the architecture of a package.
Other considerations
This is tricky no matter which way we slice it because some
musl
packages rely onmusl
'slibc++
(such as node.js), so we can't just mark allmusl
packages aslibc:musl
and havelibc:musl
preferred overlibc:none
orlibc:gnu
automatically.Likewise, explicit
gnu
packages almost always linking against othergnu
packages (at leastlibc
) and almost never work onmusl
.There's also the possibility to detect that if one package is marked as
musl
and another is not marked asgnu
that we could cross-compare packages to mark it asgnu
. However, I think that's too complex - that type of tagging should just be handled in the installer's releases.js itself.