fvm icon indicating copy to clipboard operation
fvm copied to clipboard

[BUG] RISC-V: Download the right dart SDK (and engine ?) for real RISC-V support

Open vhaudiquet opened this issue 1 month ago • 1 comments

Before creating a bug report please make check the following

  • [x] You have read our FAQ

Describe the bug On RISC-V, fvm downloads arm64 version of the dart SDK. This will not work...

To Reproduce Steps to reproduce the behavior:

  1. Create a RISC-V VM (documentation is available, e.g. here for Ubuntu)
  2. Install unzip apt update && apt install -y unzip (cf. #968)
  3. Download fvm latest release and extract:
curl -L -O https://github.com/leoafarias/fvm/releases/download/4.0.1/fvm-4.0.1-linux-riscv64.tar.gz
tar xzf fvm-4.0.1-linux-riscv64.tar.gz
cd fvm
  1. Create .fvmrc file: echo '{ "flutter": "3.35.3" }' > .fvmrc
  2. Use ./fvm install

Expected behavior fvm downloads riscv64 binaries, and not arm64 ones.

Logs

ubuntu@ubuntu:~/fvm/test$ ../fvm install
✓ Flutter SDK: SDK Version : 3.35.3 is already installed.
Setting up Flutter SDK: 3.35.3

Downloading Linux arm64 Dart SDK from Flutter engine ddf47dd3ff96dbde6d9c614db0d7f019d7c7a2b7...

...

Building flutter tool...
/home/ubuntu/fvm/versions/3.35.3/bin/internal/shared.sh: line 23: /home/ubuntu/fvm/versions/3.35.3/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
...

Desktop (please complete the following information):

  • OS: Ubuntu 26.04 Resolute Raccoon (Development Preview)
  • FVM Version: 4.0.1

Additional context

Alright, this is not easy. I think that there is no Flutter engine built by google for riscv64, and I've heard that the Google Flutter team doesn't want to build an engine for riscv64.

Maybe that will make you want to drop risc-v support ?

The dart SDK builds binaries for riscv64, so a first step would be to download dart SDK binaries directly from upstream dart and not the flutter engine. But then we still miss the Flutter engine.

Another way is to use the patches mentioned in the articles linked in https://github.com/flutter/flutter/issues/99963. However I'm not sure if you want to do that, and there is still no flutter engine available in binary form.

Another way would be to use a flutter engine from another place than google, that would be maintained by the community or another organization. I plan to investigate building a flutter engine for riscv64, trying to automate that build, and we will see how that goes. I will communicate more when concrete plans are in place.

I'm not sure what you think as a maintainer of fvm, whether that seems like a total waste of your time for 0.1% of users or if you are willing to introduce special cases and dedicate a bit of time for that. But I think that if you want to support RISC-V, it might be more complex than initially thought.

vhaudiquet avatar Nov 12 '25 16:11 vhaudiquet

After learning a bit more about Flutter, it seems that the flutter tool itself downloads the SDK (and is wrong about the architecture), so this bug is not on fvm at all it seems.

If you want to implement workarounds on fvm for RISC-V, feel free to leave this open. If you are open to contributions that implement workarounds for RISC-V, I could try to give it a shot.

Otherwise, feel free to close this as wontfix.

Thanks!

vhaudiquet avatar Nov 13 '25 11:11 vhaudiquet