mirror of
https://github.com/anchore/syft.git
synced 2026-11-26 13:44:11 +01:00
* fix(binary): name ppc64 snippets in the snippet tool getPlatformElf had no case for EM_PPC64, so write-snippet put ppc64le snippets in a linux-unknown-... directory. Map EM_PPC64 to ppc64le, or to ppc64 for big-endian files, so the julia ppc64le snippets in the next commit get the right platform name. Refs #5061 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: 26wv <202799601+26wv@users.noreply.github.com> * fix(binary): detect julia on linux/arm64, ppc64le and 1.9.0 betas The julia classifier found no package in the official julia images for linux/arm64 and linux/ppc64le, or for 1.9.0-beta2/beta3. In libjulia-internal.so the version string sits between other read-only strings. On arm64 and ppc64le those strings are separated by runs of NULs rather than a single NUL (e.g. `1.11.6\0\0branch\0\0` on ppc64le), and in 1.9.0-beta2/beta3 the version comes right before `__init__`. The julia patterns expected single NULs and fixed neighbours, so none matched. Replace the first two patterns with one that anchors only on the token after the version (`branch`, `verify_methods` or `__init__`) and accepts one or more NULs before it. Its major version is a single digit because on ppc64le 1.9.0-beta3 a run of ASCII '0's precedes the version, which a `[0-9]+` major would swallow. Let the 1.9.0-alpha1 and 1.8.5 patterns accept NUL runs after the version. On arm64 the 1.9.0-alpha1 version is not next to a NUL-delimited `verify_methods` and another string sits before `BigInt`, so that pattern now anchors on the NUL before the version and allows one string before `BigInt`. In the older julia classifier, which finds libjulia.so through the julia executable, let the `julia version` pattern accept NUL runs too and add the same BigInt pattern, so 1.0-1.5 are detected on arm64 and ppc64le. That classifier only runs against full binaries, so these cases were checked by scanning the official images rather than with new test cases. Add config.yaml entries (per-platform digests) and tool-generated snippets for 1.12.4 arm64, 1.11.6 ppc64le, 1.10.4 arm64, 1.9.0-beta2/beta3 amd64, 1.9.0-beta3 ppc64le, 1.8.5 arm64 and 1.9.0-alpha1 arm64, plus test cases for them and for the existing 1.13.0-beta3 amd64 snippet, which only the removed `branch` pattern matched. Fixes #5061 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: 26wv <202799601+26wv@users.noreply.github.com>