Files
greptimedb/docker/dev-builder
Lei, HUANG 7fa6f5f98e feat: add riscv64 cross-build support (#8820)
* feat: add riscv64 cross-build support

Add the missing build infrastructure for riscv64gc-unknown-linux-gnu.
The codebase itself already compiles cleanly for riscv64 (verified with
`cargo check --workspace --target riscv64gc-unknown-linux-gnu`): all
architecture-sensitive dependencies support it (tikv-jemalloc-sys,
aws-lc-sys, ring, pprof, simd-json).

- .cargo/config.toml: set riscv64-linux-gnu-gcc as the linker for the
  riscv64gc-unknown-linux-gnu target
- rust.yml: add a check-riscv64 CI job that cross-checks the whole
  workspace to prevent regressions from future dependency changes
- docker/dev-builder/riscv64/Dockerfile: new cross dev-builder image
  with gcc/g++-riscv64-linux-gnu and the riscv64 rust target
- Makefile: add dev-builder-riscv64 and build-riscv64-bin targets

Verified end-to-end: the produced riscv64 binary starts in standalone
mode under qemu and serves SQL (create/insert/select) over HTTP.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* ci: build riscv64 artifacts in the release workflow

- release.yml: add build-linux-riscv64-artifacts job that cross-compiles
  greptime for riscv64gc-unknown-linux-gnu on the amd64 runner with the
  dev-builder-riscv64 image, and uploads greptime-linux-riscv64-*
  artifacts. The job is wired into the needs of publish-github-release,
  release-cn-artifacts and stop-linux-amd64-runner. Integration tests
  are skipped since the cross-compiled binary cannot run on the host.
- release-dev-builder-images.yaml + build-dev-builder-images action:
  build and push the dev-builder-riscv64 image to DockerHub, and sync
  it to ECR and ACR via skopeo like the other dev-builder images.
- Makefile: DEV_BUILDER_RISCV64_IMAGE_TAG now defaults to
  DEV_BUILDER_IMAGE_TAG so the existing tag-bump automation keeps the
  riscv64 image tag in sync.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: forward cargo extension in riscv64 build

Pass CARGO_EXTENSION through build-riscv64-bin just like the existing
build-by-dev-builder target, so wrappers such as sccache are preserved
inside the cross-build container.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* ci: check riscv64 release feature graph

Check all workspace targets with the servers/dashboard feature enabled so
the riscv64 CI job covers the same optional dependency graph used by the
release artifact build.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: gate riscv64 latest tags to main pushes

Manual dev-builder workflow dispatches now publish only their immutable
version tag. Update DockerHub and ECR latest tags only for the workflow's
main-branch push event, preventing feature-branch builds from replacing
the shared latest image.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* docs: include riscv64 in release input description

Update the build_linux_artifacts workflow input description to reflect
that it now triggers amd64, arm64, and riscv64 artifact builds.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

* fix: fall back when riscv64 builder is unpublished

Before building a release artifact, pull the pinned RISC-V dev-builder
from ECR. If the image has not been published yet, build the same tag
locally from the current Dockerfile so releases remain unblocked during
the builder-tag update window.

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>

---------

Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
2026-08-10 08:11:21 +00:00
..
2026-04-01 01:59:37 +00:00