Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # version: v6.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
- name: Unshallow
run: |
git fetch --prune --unshallow
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # version: v6.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
- name: Unshallow
run: |
git fetch --prune --unshallow
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # version: v6.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
- name: Unshallow
run: |
git fetch --prune --unshallow
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
done
continue-on-error: true
- name: checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # version: v6.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
- name: Unshallow
run: |
git fetch --prune --unshallow
Expand All @@ -255,7 +255,7 @@ jobs:
run: |
make unit-tests-race
- name: coverage
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # version: v5.5.1
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # version: v5.5.2
with:
files: _out/coverage-unit-tests.txt
flags: unit-tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.

"on":
schedule:
Expand All @@ -14,7 +14,7 @@ jobs:
- ubuntu-latest
steps:
- name: Lock old issues
uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # version: v5.0.1
uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # version: v6.0.0
with:
issue-inactive-days: "60"
log-output: "true"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.

"on":
schedule:
Expand All @@ -15,7 +15,7 @@ jobs:
- ubuntu-latest
steps:
- name: Close stale issues and PRs
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # version: v10.1.0
uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # version: v10.1.1
with:
close-issue-message: This issue was closed because it has been stalled for 7 days with no activity.
days-before-issue-close: "5"
Expand Down
3 changes: 3 additions & 0 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
linux-arm64:
GOOS: linux
GOARCH: arm64
linux-riscv64:
GOOS: linux
GOARCH: riscv64
darwin-amd64:
GOOS: darwin
GOARCH: amd64
Expand Down
26 changes: 21 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +9 to +11
Copy link
Author

@pl4nty pl4nty Dec 31, 2025

Choose a reason for hiding this comment

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

ca-certificates and fhs appear to be circular dependencies, because they're built from pkgs using bldr. Instead of needing to bootstrap riscv64 builds in ghcr.io/siderolabs, I've just pinned them to linux/amd64 because 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.

Copy link
Member

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

Copy link
Author

@pl4nty pl4nty Jan 10, 2026

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 USERNAME and PLATFORM to 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


# 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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
# 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.

# common variables

SHA := $(shell git describe --match=none --always --abbrev=8 --dirty)
TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*)
TAG_SUFFIX ?=
ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined')
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ARTIFACTS := _out
IMAGE_TAG ?= $(TAG)
IMAGE_TAG ?= $(TAG)$(TAG_SUFFIX)
OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
WITH_DEBUG ?= false
WITH_RACE ?= false
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.36.10
PROTOBUF_GO_VERSION ?= 1.36.11
GRPC_GO_VERSION ?= 1.6.0
GRPC_GATEWAY_VERSION ?= 2.27.3
VTPROTOBUF_VERSION ?= 0.6.0
GOIMPORTS_VERSION ?= 0.39.0
GOIMPORTS_VERSION ?= 0.40.0
GOMOCK_VERSION ?= 0.6.0
DEEPCOPY_VERSION ?= v0.5.8
GOLANGCILINT_VERSION ?= v2.6.2
GOLANGCILINT_VERSION ?= v2.7.2
GOFUMPT_VERSION ?= v0.9.2
GO_VERSION ?= 1.25.4
GO_VERSION ?= 1.25.5
GO_BUILDFLAGS ?=
GO_BUILDTAGS ?= ,
GO_LDFLAGS ?=
CGO_ENABLED ?= 0
GOTOOLCHAIN ?= local
GOEXPERIMENT ?=
GO_BUILDFLAGS += -tags $(GO_BUILDTAGS)
TESTPKGS ?= ./...
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest
Expand Down Expand Up @@ -135,7 +138,7 @@ GO_LDFLAGS += -linkmode=external -extldflags '-static'
endif

ifneq (, $(filter $(WITH_DEBUG), t true TRUE y yes 1))
GO_BUILDFLAGS += -tags sidero.debug
GO_BUILDTAGS := $(GO_BUILDTAGS)sidero.debug,
else
GO_LDFLAGS += -s
endif
Expand Down Expand Up @@ -230,8 +233,15 @@ $(ARTIFACTS)/bldr-linux-arm64:
.PHONY: bldr-linux-arm64
bldr-linux-arm64: $(ARTIFACTS)/bldr-linux-arm64 ## Builds executable for bldr-linux-arm64.

.PHONY: $(ARTIFACTS)/bldr-linux-riscv64
$(ARTIFACTS)/bldr-linux-riscv64:
@$(MAKE) local-bldr-linux-riscv64 DEST=$(ARTIFACTS)

.PHONY: bldr-linux-riscv64
bldr-linux-riscv64: $(ARTIFACTS)/bldr-linux-riscv64 ## Builds executable for bldr-linux-riscv64.

.PHONY: bldr
bldr: bldr-darwin-amd64 bldr-darwin-arm64 bldr-linux-amd64 bldr-linux-arm64 ## Builds executables for bldr.
bldr: bldr-darwin-amd64 bldr-darwin-arm64 bldr-linux-amd64 bldr-linux-arm64 bldr-linux-riscv64 ## Builds executables for bldr.

.PHONY: lint-markdown
lint-markdown: ## Runs markdownlint.
Expand Down
11 changes: 11 additions & 0 deletions internal/pkg/environment/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ var (
LLBPlatform: llb.LinuxArmhf,
PlatformSpec: platforms.MustParse("linux/arm7"),
}

LinuxRiscv64 = Platform{
ID: "linux/riscv64",
Arch: "riscv64",
Target: "riscv64-talos-linux-musl",
Build: "riscv64-linux-musl",
Host: "riscv64-linux-musl",
LLBPlatform: llb.Platform(specs.Platform{OS: "linux", Architecture: "riscv64"}),
PlatformSpec: platforms.MustParse("linux/riscv64"),
}
)

// Platforms is mapping of platform ID to Platform.
Expand All @@ -104,6 +114,7 @@ func init() {
LinuxAmd64,
LinuxArm64,
LinuxArmv7,
LinuxRiscv64,
} {
Platforms[platform.ID] = platform
}
Expand Down