fix(binary): support julia alpha/beta/rc versions in binary cataloger (#4867)#4885
Closed
tjhub1983 wants to merge 3 commits into
Closed
fix(binary): support julia alpha/beta/rc versions in binary cataloger (#4867)#4885tjhub1983 wants to merge 3 commits into
tjhub1983 wants to merge 3 commits into
Conversation
…anchore#4867) Signed-off-by: tjhub1983 <tjhub1983@users.noreply.github.com>
Author
|
Hi @anchore/syft-maintainers! This extends the julia-binary version matcher to support alpha/beta/rc pre-release versions (fixes #4867). Let me know if you have any questions. |
Contributor
|
Thank you for your PR. Could you please add tests to cover these cases ? |
- Added test case for julia 1.9.0-alpha1 - Verifies the -alphaN/-betaN/-rcN suffix pattern works - Added corresponding test snippet Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Fixes #4867.
Problem: The
julia-binaryclassifier pattern only matchesX.Y.Zversion format. Pre-release versions like1.9.0-alpha1,1.9.0-beta4,1.9.0-rc1are not matched because the pattern lacks-alpha,-beta,-rcsuffix support.Before:
syft -q julia:1.9.0-alpha1 | grep julia→ (no output, version not detected)After:
syft -q julia:1.9.0-alpha1 | grep julia→julia 1.9.0-alpha1Fix: Extended the version regex to
(?m)__init__\x00(?P<version>[0-9]+\.[0-9]+\.[0-9]+(-alpha[0-9]+|-beta[0-9]+|-rc[0-9]+)?)\x00verifyChanges
syft/pkg/cataloger/binary/classifiers.go: Added-alphaN,-betaN,-rcNsuffix support to julia version matcherTest
$ docker run -it --rm julia:1.9.0-alpha1 julia -v julia version 1.9.0-alpha1 $ syft -q julia:1.9.0-alpha1 | grep julia julia 1.9.0-alpha1 binary