Skip to content

fix(binary): support s390x go binary versions 1.8.x and 1.9.x#4900

Open
tjhub1983 wants to merge 2 commits into
anchore:mainfrom
tjhub1983:fix/go-s390x-v2
Open

fix(binary): support s390x go binary versions 1.8.x and 1.9.x#4900
tjhub1983 wants to merge 2 commits into
anchore:mainfrom
tjhub1983:fix/go-s390x-v2

Conversation

@tjhub1983
Copy link
Copy Markdown

Summary

Fixes #4866.

Problem: The go-binary classifier fails to detect version for go 1.8.x and 1.9.x on s390x architecture. The go1.8.7 version string is stored as a null-terminated string �go1.8.7� in s390x binaries, which the existing patterns don't match.

Before: syft --platform linux/s390x golang:1.8.7 shows go 1.1 (wrong version)
After: syft --platform linux/s390x golang:1.8.7 shows go@1.8.7

Fix: Added a third SupportingEvidenceMatcher with pattern �go(?P<version>[0-9]+\.[0-9]+\.[0-9]+) that specifically targets the null-terminated s390x version string format.

Changes

  • syft/pkg/cataloger/binary/classifiers.go: Added s390x-specific null-terminated version matcher for go binary
  • syft/pkg/cataloger/binary/classifier_cataloger_test.go: Added test case for s390x go binary
  • syft/pkg/cataloger/binary/testdata/classifiers/snippets/go-version-hint/1.8.7/s390x/go: Added test fixture

Test

```bash
$ syft -q --platform linux/s390x golang:1.8.7 | grep "go "
go 1.8.7 binary
```


This PR is a recreation of #4884 with proper DCO sign-off on all commits.

tjhub1983 added 2 commits May 9, 2026 06:10
Fixes anchore#4866

Signed-off-by: tjhub1983 <tjhub1983@users.noreply.github.com>
@kzantow
Copy link
Copy Markdown
Contributor

kzantow commented May 21, 2026

This does not have proper DCO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support go binary old s390 image

2 participants