-
Notifications
You must be signed in to change notification settings - Fork 23
feat: support riscv64 architecture #215
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
Draft
pl4nty
wants to merge
3
commits into
siderolabs:main
Choose a base branch
from
pl4nty:feat/support-riscv64
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,18 +2,18 @@ | |
|
|
||
| # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
| # | ||
| # Generated on 2025-12-05T14:08:35Z by kres 571923f. | ||
| # Generated on 2025-12-31T05:18:26Z by kres 26be706. | ||
|
|
||
| ARG TOOLCHAIN=scratch | ||
|
|
||
| FROM ghcr.io/siderolabs/ca-certificates:v1.12.0 AS image-ca-certificates | ||
| FROM --platform=linux/amd64 ghcr.io/siderolabs/ca-certificates:v1.12.0 AS image-ca-certificates | ||
|
|
||
| FROM ghcr.io/siderolabs/fhs:v1.12.0 AS image-fhs | ||
| FROM --platform=linux/amd64 ghcr.io/siderolabs/fhs:v1.12.0 AS image-fhs | ||
|
|
||
| # runs markdownlint | ||
| FROM docker.io/oven/bun:1.3.1-alpine AS lint-markdown | ||
| FROM docker.io/oven/bun:1.3.4-alpine AS lint-markdown | ||
| WORKDIR /src | ||
| RUN bun i markdownlint-cli@0.46.0 [email protected] | ||
| RUN bun i markdownlint-cli@0.47.0 [email protected] | ||
| COPY .markdownlint.json . | ||
| COPY ./CHANGELOG.md ./CHANGELOG.md | ||
| COPY ./README.md ./README.md | ||
|
|
@@ -179,6 +179,18 @@ ARG SHA | |
| ARG TAG | ||
| RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=bldr/go/pkg GOARCH=arm64 GOOS=linux go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS} -X ${VERSION_PKG}.Name=bldr -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /bldr-linux-arm64 | ||
|
|
||
| # builds bldr-linux-riscv64 | ||
| FROM base AS bldr-linux-riscv64-build | ||
| COPY --from=generate / / | ||
| COPY --from=embed-generate / / | ||
| WORKDIR /src/cmd/bldr | ||
| ARG GO_BUILDFLAGS | ||
| ARG GO_LDFLAGS | ||
| ARG VERSION_PKG="internal/version" | ||
| ARG SHA | ||
| ARG TAG | ||
| RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=bldr/go/pkg GOARCH=riscv64 GOOS=linux go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS} -X ${VERSION_PKG}.Name=bldr -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /bldr-linux-riscv64 | ||
|
|
||
| FROM scratch AS bldr-darwin-amd64 | ||
| COPY --from=bldr-darwin-amd64-build /bldr-darwin-amd64 /bldr-darwin-amd64 | ||
|
|
||
|
|
@@ -191,13 +203,17 @@ COPY --from=bldr-linux-amd64-build /bldr-linux-amd64 /bldr-linux-amd64 | |
| FROM scratch AS bldr-linux-arm64 | ||
| COPY --from=bldr-linux-arm64-build /bldr-linux-arm64 /bldr-linux-arm64 | ||
|
|
||
| FROM scratch AS bldr-linux-riscv64 | ||
| COPY --from=bldr-linux-riscv64-build /bldr-linux-riscv64 /bldr-linux-riscv64 | ||
|
|
||
| FROM bldr-linux-${TARGETARCH} AS bldr | ||
|
|
||
| FROM scratch AS bldr-all | ||
| COPY --from=bldr-darwin-amd64 / / | ||
| COPY --from=bldr-darwin-arm64 / / | ||
| COPY --from=bldr-linux-amd64 / / | ||
| COPY --from=bldr-linux-arm64 / / | ||
| COPY --from=bldr-linux-riscv64 / / | ||
|
|
||
| FROM scratch AS image-bldr | ||
| ARG TARGETARCH | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
ca-certificatesandfhsappear to be circular dependencies, because they're built from pkgs using bldr. Instead of needing to bootstrap riscv64 builds inghcr.io/siderolabs, I've just pinned them tolinux/amd64because their contents is architecture-independent. I'm happy to PR this to kres if it's suitable.Alternatively, the images could be passed as Makefile variables and leave bootstrapping to the user.
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.
this file is auto-generated, so this change won't work anyways.
I don't know how riscv64 would be bootstrapped even as we don't have any hardware in any foreseeable future, nor that I'm convinced any risc is powerful enough to build Talos without cross-compiling
Uh oh!
There was an error while loading. Please reload this page.
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.
yeah, I left the PR as a draft because this change would need to happen in kres. it's mostly a workaround for the hardcoded
ghcr.io/siderolabs.everywhere else, I just set
USERNAMEandPLATFORMto pull/push with a different registry when building for riscv64. this approach worked for toolchain/tools/pkgs/talos on native hardware. it's very slow, but faster than qemu