Skip to content

Conversation

@vhaudiquet
Copy link
Contributor

@vhaudiquet vhaudiquet commented Nov 18, 2025

This adds support for buildind desktop linux applications for riscv64 on the flutter tool, as well as basic riscv64 support for the tool.

This is a first move towards fixing #99963. Along with #178712 that allows building an engine for riscv64, this PR allows me to build and run the flutter 'hello world' app on RISC-V hardware:

Screenshot from 2025-11-18 08-58-03

This allows someone who built a flutter engine and exposed it on a webserver to run commands like:

export FLUTTER_STORAGE_BASE_URL=http://your-server-url
flutter
flutter doctor
cd example/hello_world && flutter build linux

This means that even if Google does not want to support Flutter on RISC-V officially (hosting the artifacts), community-managed servers could host the RISC-V flutter engines/artifacts. It also means that internally, companies using Flutter on RISC-V would just have to build their engine and setup such a server, and it allows them to use the upstream Flutter tool.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@vhaudiquet vhaudiquet requested review from a team and jtmcdole as code owners November 18, 2025 09:25
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-android Owned by Android platform team labels Nov 18, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the riscv64 architecture for desktop Linux applications in the Flutter tool. The changes are consistent across multiple files, adding the new architecture to enums, switch statements, and build configurations. My review focuses on improving code readability in one of the new logic blocks. Overall, the changes look good and are a solid step towards supporting Flutter on RISC-V.

@vhaudiquet vhaudiquet force-pushed the riscv64-tool branch 3 times, most recently from 8851c72 to 16fd221 Compare November 19, 2025 17:29
@vhaudiquet
Copy link
Contributor Author

vhaudiquet commented Nov 19, 2025

I think my last modification fixed all the tests (formatting, and changing a test case expected output to include riscv64).

The last failing "Windows tool_tests_commands" test might be an infra issue, as it seems to have timed out waiting for a prompt... I'm not sure that it is related to my PR. It seems I can't trigger a retry myself.

@jtmcdole what do you think?

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Approved but I would want someone from the engine team to take a look before this lands.

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Not sure where you are on the process of landing this feature but I would have expected to see a test that built for risc-v as part of this pr to ensure we dont regress on the ability to build.

@vhaudiquet
Copy link
Contributor Author

Thank you! About the testing part, I wasn't sure that the testing infrastructure had riscv64 support; and I would rather have untested RISC-V support than no RISC-V support at all.

If you confirm that I could write automatic tests that would run on riscv64, or enable riscv64 for existing tests, I can try!

@reidbaker
Copy link
Contributor

At the minimum I would expect that you could author a test that attempted to build the risc-v code. That code would be required before we can publish an RISC-V engine binary.

@vhaudiquet
Copy link
Contributor Author

vhaudiquet commented Nov 25, 2025

I tried to understand the test infrastructure and add a test that is basically a copy of the one present on arm64, adapted for riscv64. Is that what you had in mind?

Edit: Again, the failed CI check seems to be a timeout unrelated to the test I added, on preview_detector_workspace_test.dart: PreviewDetector

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Thank you for adding a build test. This should still be approved by someone on the engine team but I no longer see any issues.

@reidbaker reidbaker requested a review from gaaclarke November 25, 2025 16:20
@reidbaker reidbaker changed the title [ Tool ] Add support riscv64 architecture [ Tool ] Add support for linux riscv64 architecture Nov 25, 2025
Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

LGTM. @reidbaker the tests here assert that the tool will attempt to build riscv64 but we don't actually buildit as part of CI right? We should consider adding that as a follow up.

@reidbaker
Copy link
Contributor

LGTM. @reidbaker the tests here assert that the tool will attempt to build riscv64 but we don't actually buildit as part of CI right? We should consider adding that as a follow up.

Correct, I am viewing this feature as in progress and this test makes sure we dont accidentally break support but it will require building the engine manually. I actually think if this pr added ci support for publishing risc-v we might not take it without leads approval.

@reidbaker reidbaker requested a review from filiph November 25, 2025 17:06
@vhaudiquet
Copy link
Contributor Author

vhaudiquet commented Nov 25, 2025

I also submitted #178712 to allow building the engine (either locally or in CI). I started a discussion there, that is still ongoing it seems.

Having official tool support could still be useful even if you don't plan/want to build the engine on CI, as it would allow third-party actors to use the official tool with their third-party built engine using export FLUTTER_STORAGE_BASE_URL as described; this is why I submitted two different PRs.

@filiph
Copy link
Contributor

filiph commented Nov 25, 2025

Was I added in error, @reidbaker? I don't have much experience with this part of the codebase.

@reidbaker
Copy link
Contributor

Was I added in error, @reidbaker? I don't have much experience with this part of the codebase.

Yes sorry! Removed.

@reidbaker reidbaker removed the request for review from filiph November 25, 2025 17:14
@loic-sharma
Copy link
Member

loic-sharma commented Nov 25, 2025

cc @robert-ancell as this change adds riscv64 support to Flutter Linux.
cc @dcharkes as this lightly touches native assets.

@loic-sharma
Copy link
Member

Drive by comment: When we added Windows Arm64 artifacts we broke flutter precache --all --force on Windows (see #164431).

If you haven't already, please check that this command still works on Linux hosts.

@loic-sharma loic-sharma requested a review from bkonyi November 25, 2025 17:36
@vhaudiquet
Copy link
Contributor Author

vhaudiquet commented Dec 2, 2025

I pushed an update. This makes the linux-riscv64 target available to the tool behind a feature flag, except on a riscv64 host. I feel like it makes sense to keep it on a riscv64 host, as anyway otherwise you can't cross-compile from riscv64.

However, maybe that was not the right place in the code? Disabling it at the argument-parsing level can make sure that users will not even see the feature, but maybe this is not what we want.

Please review and tell me, I can change that, this is just a first draft for the feature. Thank you!

EDIT: It seems that this broke multiple tests. Fixing....

CHANGES from 9bb6271 (before feature flag)

@vhaudiquet vhaudiquet force-pushed the riscv64-tool branch 3 times, most recently from 0e13adc to 38460c1 Compare December 2, 2025 17:47
This adds support for buildind desktop linux applications for riscv64 on the flutter tool, as well as basic riscv64 support for the tool.
@vhaudiquet
Copy link
Contributor Author

The google testing is the only one failing now. Is that a real fail, or a temporary/infra thing?

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm

A Googler will need to follow step 5 of https://github.com/flutter/flutter/blob/master/docs/contributing/Feature-flags.md. @bkonyi would you be able to help out with that 2 line change?

@jtmcdole
Copy link
Member

jtmcdole commented Jan 8, 2026

The google testing is the only one failing now. Is that a real fail, or a temporary/infra thing?

This is a real failure from a custom implementation of the tool. Let me take a quick look.

@jtmcdole
Copy link
Member

jtmcdole commented Jan 8, 2026

This PR is 700+ commits behind master; updating to pick up changes.

@jtmcdole
Copy link
Member

jtmcdole commented Jan 9, 2026

Applying another fix internally

@jtmcdole jtmcdole added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Jan 9, 2026
Merged via the queue into flutter:master with commit a3c12e6 Jan 9, 2026
148 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 10, 2026
In #178711, `packages/flutter_tools/lib/src/flutter_cache.dart` was
updated to add 'riscv' downloading in the `FlutterRunnerDebugSymbols`.
This class is not well named and is responsible for downloading "the
debug symbols for flutter runner for Fuchsia development."

We do not produce fuchsia riscv.

Fixes #180775
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 10, 2026
Roll Flutter from 01d37bc to 73769a2 (65 revisions)

flutter/flutter@01d37bc...73769a2

2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from 5e855c2bb3ef to 87fbfd5381b6 (1 revision) (flutter/flutter#180800)
2026-01-10 engine-flutter-autoroll@skia.org Roll Skia from b2b109f0e980 to f39cc645b1dd (2 revisions) (flutter/flutter#180796)
2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from b7963905e6a2 to 5e855c2bb3ef (2 revisions) (flutter/flutter#180794)
2026-01-10 ahmedsameha1@gmail.com Make sure that a CupertinoTabScaffold doesn't crash in 0x0 environment (flutter/flutter#179824)
2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from d25ad331b7ea to b7963905e6a2 (2 revisions) (flutter/flutter#180783)
2026-01-10 ahmedsameha1@gmail.com Make sure that a Container doesn't crash in 0x0 environment (flutter/flutter#180350)
2026-01-10 ahmedsameha1@gmail.com Make sure that an Expansible doesn't crash in 0x0 environment (flutter/flutter#180478)
2026-01-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Enabled some disabled impeller fragment shader dart tests (#180759)" (flutter/flutter#180785)
2026-01-09 dkwingsmt@users.noreply.github.com Merge `widget_tester_leaks_free_test.dart` into `widget_tester_test.dart` (flutter/flutter#180600)
2026-01-09 codefu@google.com fix: there are no riscv fuchsia artifacts (flutter/flutter#180779)
2026-01-09 engine-flutter-autoroll@skia.org Roll Skia from 7386219151e6 to b2b109f0e980 (1 revision) (flutter/flutter#180771)
2026-01-09 chinmaygarde@google.com Re-prioritize pipeline compile jobs and perform them eagerly instead of waiting. (flutter/flutter#180022)
2026-01-09 30870216+gaaclarke@users.noreply.github.com Enabled some disabled impeller fragment shader dart tests (flutter/flutter#180759)
2026-01-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rxeg-6UB678HKJ4UQ... to 83Favz_zzMzdVuOHg... (flutter/flutter#180765)
2026-01-09 jhy03261997@gmail.com [A11y ] Add `clearSemantics`in table (flutter/flutter#180665)
2026-01-09 chinmaygarde@google.com Update CODEOWNERS to remove chinmaygarde. (flutter/flutter#180703)
2026-01-09 vhaudiquet343@hotmail.fr [ Tool ] Add support for linux riscv64 architecture (flutter/flutter#178711)
2026-01-09 engine-flutter-autoroll@skia.org Roll Skia from e9b3264ade0c to 7386219151e6 (12 revisions) (flutter/flutter#180754)
2026-01-09 engine-flutter-autoroll@skia.org Roll Dart SDK from fe2ba2c5dd50 to d25ad331b7ea (10 revisions) (flutter/flutter#180741)
2026-01-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Unpin google_mobile_ads (#180573)" (flutter/flutter#180761)
2026-01-09 koichi20021217@gmail.com Fix typo in dropdown_menu.dart (flutter/flutter#180172)
2026-01-09 engine-flutter-autoroll@skia.org Roll Packages from 039a026 to 51fe1d9 (1 revision) (flutter/flutter#180742)
2026-01-09 goderbauer@google.com Unpin google_mobile_ads (flutter/flutter#180573)
2026-01-09 evanwall@buffalo.edu Update flutter changelog for 3.38.6 (flutter/flutter#180708)
2026-01-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix iOS xattr removal to clear all extended attributes (#180355)" (flutter/flutter#180709)
2026-01-08 ahmedsameha1@gmail.com Make sure that an EditableText doesn't crash in 0x0 environment (flutter/flutter#180457)
2026-01-08 matt.kosarek@canonical.com Implementation of tooltip windows for win32 (flutter/flutter#179147)
2026-01-08 mdebbar@google.com [web] Don't serve files outside of project (flutter/flutter#180699)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 837be28dd218 to e9b3264ade0c (1 revision) (flutter/flutter#180702)
2026-01-08 sokolovskyi.konstantin@gmail.com Add new motion accessibility features to iOS. (flutter/flutter#178102)
2026-01-08 104009581+Saqib198@users.noreply.github.com Fix iOS xattr removal to clear all extended attributes (flutter/flutter#180355)
2026-01-08 bkonyi@google.com [ Widget Preview ] Move widget_preview_scaffold tests to `dev/integration_tests/widget_preview_scaffold` (flutter/flutter#180658)
2026-01-08 30870216+gaaclarke@users.noreply.github.com De-interleaves engine dart test output (flutter/flutter#180651)
2026-01-08 zhongliu88889@gmail.com [web] Fix SemanticsService.announce not working inside dialogs (flutter/flutter#179958)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 42233226ac56 to 837be28dd218 (2 revisions) (flutter/flutter#180693)
2026-01-08 iinozemtsev@google.com Roll Dart SDK to 3.11.0-296.2.beta (flutter/flutter#180685)
2026-01-08 116356835+AbdeMohlbi@users.noreply.github.com Improve code quality in `AndroidTouchProcessorTest.java` (flutter/flutter#180583)
2026-01-08 1961493+harryterkelsen@users.noreply.github.com Revert "Reverts "[reland] Unify canvas creation and Surface code in S…kwasm and CanvasKit (#179473)" (#180152)" (flutter/flutter#180610)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from a0c407bce408 to 42233226ac56 (4 revisions) (flutter/flutter#180688)
2026-01-08 bkonyi@google.com [ Tool ] Fix flake in overall_experience_test.dart (flutter/flutter#180655)
2026-01-08 engine-flutter-autoroll@skia.org Roll Packages from 9705815 to 039a026 (6 revisions) (flutter/flutter#180684)
2026-01-08 104147021+MohammedTarigg@users.noreply.github.com flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (flutter/flutter#177888)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 58837e160874 to a0c407bce408 (2 revisions) (flutter/flutter#180679)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 1e3266fdba86 to 58837e160874 (1 revision) (flutter/flutter#180677)
2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 3c47ea10638f to 1e3266fdba86 (4 revisions) (flutter/flutter#180675)
2026-01-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from dTvN_JVSCfGFRasvH... to rxeg-6UB678HKJ4UQ... (flutter/flutter#180673)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants