Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

dustymabe
Copy link
Member

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.

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
@dustymabe dustymabe force-pushed the dusty-riscv-support branch from afea0d8 to 2136693 Compare April 22, 2025 12:46
# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent tabs/spaces.

Copy link
Member Author

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 $@)
Copy link
Member

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)}"
Copy link
Member

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.

Copy link
Member Author

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} \
Copy link
Member

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.

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.

2 participants