-
Notifications
You must be signed in to change notification settings - Fork 13
fix apple silicon local scanner build #1038
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
Conversation
Images are ready for the commit at 0e66650. To use the images, use the tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the builder images for arm64 are not built automatically by CI. So far they were built and uploaded manually to sandbox
by @connorgorman.
I have a temporary workaround for this issue here #1040, if you'd still prefer to use the native builder image.
We will soon have to build arm64 images for Go v1.19. I have built them before btw, I just don't know how to upload them to sandbox.
Co-authored-by: Vlad Bologa <vbologa@redhat.com>
@@ -44,7 +45,7 @@ endif | |||
|
|||
LOCAL_VOLUME_ARGS := -v$(CURDIR):/src:delegated -v $(GOPATH):/go:delegated | |||
GOPATH_WD_OVERRIDES := -w /src -e GOPATH=/go | |||
IMAGE_BUILD_FLAGS := -e CGO_ENABLED=0,GOOS=linux,GOARCH=${GOARCH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you were wondering why this was never caught: Scanner was (and still is) traditionally built in a amd64 linux container, so GOOS and GOARCH were set correctly anyway. Also, I think CGO_ENABLED defaults to 0 anyway
Fixes build (
make image
) errors on Apple Silicon Macs.The hardcoded
BUILD_IMAGE
forarm64
inMakefile
has go version1.17.2
which fails to build the latest scanner binary (most errors related to introduction of generics). A newer version of theapollo-ci-scanner-build-X-arm64
image does not exist in thesandbox
repo - it's unclear how thesandbox
repo is updatedRemoving the hardcode and letting
make build
use theamd64
build image succeeds when combined with fixing a bug in theIMAGE_BUILD_FLAGS
environment flags. This is a temporary fix as it relies onqemu
emulation during build which has known issues:The locally built
scanner
andscanner-db
images are built for thearm64
architecture - as a result theqemu
known issues should have no/minimal impact onscanner
/scanner-db
at runtime.