-
Notifications
You must be signed in to change notification settings - Fork 174
Add support for riscv #4079
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
base: main
Are you sure you want to change the base?
Add support for riscv #4079
Conversation
006d5ba
to
afea0d8
Compare
The reason we build kolet for other architectures is so that we can mix architectures with test initiators and test runners. i.e. i.e. x86_64 kola running in the pipeline testing against an aarch64 EC2 instance. This use case isn't too common so let's just not build kolet for all the different architectures on every architecture. We'll special case for x86_64 here and let it build for them all, but for the rest we just build for the architecture that the container build is for.
This is initial support for being able to build against a riscv64 architecture target. xref: coreos/fedora-coreos-tracker#1931
This fails with a symbol error. Error reported upstream in golang/go#72840
afea0d8
to
2136693
Compare
# This is mainly so we can initiate tests against a remote that is | ||
# a different architecture. i.e. x86_64 kola testing against an | ||
# aarch64 EC2 instance. | ||
KOLET_ARCHES=aarch64 ppc64le s390x x86_64 |
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.
Inconsistent tabs/spaces.
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.
will fix
@@ -73,7 +79,7 @@ mantle: $(MANTLE_BINARIES) kolet | |||
|
|||
.PHONY: $(MANTLE_BINARIES) kolet | |||
$(MANTLE_BINARIES) kolet: | |||
mantle/build cmd/$(basename $@) | |||
KOLET_ARCHES="$(KOLET_ARCHES)" mantle/build cmd/$(basename $@) |
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.
Hmm weird, that shouldn't be necessary. It should just get passed through.
@@ -11,7 +11,8 @@ if [[ $# -eq 0 ]]; then | |||
fi | |||
|
|||
declare -A BASEARCH_TO_GOARCH=([s390x]=s390x [x86_64]=amd64 [aarch64]=arm64 [ppc64le]=ppc64le) | |||
KOLET_ARCHES="${KOLET_ARCHES:-s390x x86_64 aarch64 ppc64le}" | |||
ARCH=$(arch) | |||
KOLET_ARCHES="${KOLET_ARCHES:-$(ARCH)}" |
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.
Invalid syntax I think? Also feels like we can just keep that as one line.
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.
Will fix in next upload. Not sure what you mean by keep it as one line.
I use the $ARCH
var later in the script.
local cgo_override="${CGO_ENABLED:-}" | ||
[ "${ARCH}" == "riscv64" ] && cgo_override=0 | ||
|
||
CGO_ENABLED=${cgo_override} \ |
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.
It's not clear from quickly looking at the golang docs what CGO_ENABLED= go build ...
will do. I think it'd be easier to review if we just only set the env on riscv64.
This is initial support for being able to build against a riscv64
architecture target.
xref: coreos/fedora-coreos-tracker#1931
There is also a commit in here for limiting the number of architectures we
build
kolet
for by default. See the commit message for more details.