Skip to content
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

Unable to build binary on ppc64le architecture #1097

Closed
mayurwaghmode opened this issue Jul 12, 2022 · 4 comments · Fixed by #1098
Closed

Unable to build binary on ppc64le architecture #1097

mayurwaghmode opened this issue Jul 12, 2022 · 4 comments · Fixed by #1098
Labels
bug Something isn't working

Comments

@mayurwaghmode
Copy link
Contributor

mayurwaghmode commented Jul 12, 2022

What happened: Getting failure while building the syft binary on/for ppc64le architecture

[root@tonearms1 syft]# env GOOS=linux GOARCH=ppc64le go build -o syft-ppc64le ./cmd/syft/
package github.com/anchore/syft/cmd/syft
        imports github.com/anchore/syft/cmd/syft/cli
        imports github.com/anchore/syft/cmd/syft/cli/attest
        imports github.com/anchore/syft/cmd/syft/cli/eventloop
        imports github.com/anchore/syft/internal/config
        imports github.com/anchore/syft/syft/pkg/cataloger
        imports github.com/anchore/syft/syft/pkg/cataloger/rpmdb
        imports github.com/knqyf263/go-rpmdb/pkg
        imports github.com/knqyf263/go-rpmdb/pkg/sqlite3
        imports modernc.org/sqlite
        imports modernc.org/libc
        imports modernc.org/libc/errno: build constraints exclude all Go files in /root/go/pkg/mod/modernc.org/libc@v1.14.1/errno
package github.com/anchore/syft/cmd/syft
        imports github.com/anchore/syft/cmd/syft/cli
        imports github.com/anchore/syft/cmd/syft/cli/attest
        imports github.com/anchore/syft/cmd/syft/cli/eventloop
        imports github.com/anchore/syft/internal/config
        imports github.com/anchore/syft/syft/pkg/cataloger
        imports github.com/anchore/syft/syft/pkg/cataloger/rpmdb
        imports github.com/knqyf263/go-rpmdb/pkg
        imports github.com/knqyf263/go-rpmdb/pkg/sqlite3
        imports modernc.org/sqlite
        imports modernc.org/libc
        imports modernc.org/libc/fcntl: build constraints exclude all Go files in /root/go/pkg/mod/modernc.org/libc@v1.14.1/fcntl
package github.com/anchore/syft/cmd/syft
        imports github.com/anchore/syft/cmd/syft/cli
        imports github.com/anchore/syft/cmd/syft/cli/attest
        imports github.com/anchore/syft/cmd/syft/cli/eventloop
        imports github.com/anchore/syft/internal/config
        imports github.com/anchore/syft/syft/pkg/cataloger
        imports github.com/anchore/syft/syft/pkg/cataloger/rpmdb
        imports github.com/knqyf263/go-rpmdb/pkg
        imports github.com/knqyf263/go-rpmdb/pkg/sqlite3
        imports modernc.org/sqlite
        imports modernc.org/libc
        imports modernc.org/libc/fts: build constraints exclude all Go files in /root/go/pkg/mod/modernc.org/libc@v1.14.1/fts
package github.com/anchore/syft/cmd/syft
        imports github.com/anchore/syft/cmd/syft/cli
        imports github.com/anchore/syft/cmd/syft/cli/attest
        imports github.com/anchore/syft/cmd/syft/cli/eventloop
        imports github.com/anchore/syft/internal/config
        imports github.com/anchore/syft/syft/pkg/cataloger
        imports github.com/anchore/syft/syft/pkg/cataloger/rpmdb
        imports github.com/knqyf263/go-rpmdb/pkg
        imports github.com/knqyf263/go-rpmdb/pkg/sqlite3
        imports modernc.org/sqlite
        imports modernc.org/libc
        imports modernc.org/libc/grp: build constraints exclude all Go files in /root/go/pkg/mod/modernc.org/libc@v1.14.1/grp

What you expected to happen: ppc64le architecture-specific binary should get build

How to reproduce it (as minimally and precisely as possible):

env GOOS=linux GOARCH=ppc64le go build -o syft-ppc64le ./cmd/syft/

Anything else we need to know?:

[root@tonearms1 syft]# arch
ppc64le
[root@tonearms1 syft]#

Environment:

  • Output of syft version:
  • OS (e.g: cat /etc/os-release or similar):
cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
@mayurwaghmode mayurwaghmode added the bug Something isn't working label Jul 12, 2022
@mayurwaghmode
Copy link
Contributor Author

Here are the complete error logs- https://github.com/anchore/syft/files/9091683/failure-on-power.txt

@spiffcs
Copy link
Contributor

spiffcs commented Jul 12, 2022

Looks like the code was generated and added for the ppc64le architecture 2 months ago:
https://gitlab.com/cznic/libc/-/blob/master/errno/capi_linux_ppc64le.go

Tag 1.14.1 was released 5 months ago. I'm guessing we need to bump the version of this library to resolve this.

Let me see if there are any compatibility issues with moving this up to a newer version and where it lives in the syft dependency graph.

Thanks for filing the bug @mayurwaghmode!

@mayurwaghmode
Copy link
Contributor Author

Thanks, @spiffcs for looking into this :)

@spiffcs
Copy link
Contributor

spiffcs commented Jul 12, 2022

@mayurwaghmode feel free to use the branch I pushed for testing purposes:

I'll get someone to approve it and we'll get this resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants