Skip to content

Request for RISC-V Architecture Support #6047

@hawkli-1994

Description

@hawkli-1994

Description:
I'm attempting to cross-compile JuiceFS for RISC-V (riscv64) architecture but encountering build failures due to incompatible dependencies. The following packages appear to have build constraints excluding RISC-V:

  1. github.com/erikdubbelboer/gspt
  2. github.com/hungys/go-lz4
  3. github.com/DataDog/zstd

Error message:

build constraints exclude all Go files in ...

Reproduction Steps:

  1. Set up Go cross-compilation environment for riscv64
  2. Run:
    CGO_ENABLED=0 GOARCH=riscv64 go build -v -tags nosqlite \
      -ldflags="-s -w -X github.com/juicedata/juicefs/pkg/version.revision=... \
      -X github.com/juicedata/juicefs/pkg/version.revisionDate=..." \
      -o juicefs.riscv .

Expected Behavior:
Successful compilation for riscv64 architecture

Actual Behavior:
Build fails due to unsupported architecture in dependencies

Suggested Solutions:

  1. Evaluate alternative packages that support RISC-V:

    • Replace go-lz4 with github.com/pierrec/lz4
    • Replace DataDog/zstd with github.com/klauspost/compress/zstd
  2. Add riscv64 to build constraints for critical dependencies

  3. Consider maintaining a riscv64 compatible build tag

Additional Context:
RISC-V is gaining significant adoption in edge computing and embedded systems where JuiceFS could provide valuable distributed storage capabilities. Official support would enable JuiceFS deployment in these growing ecosystems.

Environment:

  • Go version: [1.23]
  • OS: [Ubuntu]
  • Architecture: riscv64 (cross-compiling from [x86_64])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions