Adds script to run malioc locally#185371
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request introduces a Dart script, malioc_download_and_diff.dart, which automates the process of downloading Mali Offline Compiler tools, executing GN and Ninja builds, and comparing shader performance statistics against a golden file. The review feedback identifies a bug where calling exit() in helper functions prevents the execution of the finally block responsible for cleaning up temporary directories. Additionally, the feedback suggests replacing a hardcoded fallback version string with an error and using platform-agnostic logic to identify the malioc executable.
| Future<String> getArmToolsVersion(Directory flutterDir) async { | ||
| final jsonFile = File('${flutterDir.path}/ci/builders/linux_unopt.json'); | ||
| if (!await jsonFile.exists()) { | ||
| return 'last_updated:2023-02-03T15:32:01-0800'; |
There was a problem hiding this comment.
The hardcoded version string 'last_updated:2023-02-03T15:32:01-0800' is used as a fallback if the configuration file is missing or the dependency is not found. This is fragile and likely to become stale. It would be better to throw an error to notify the user that the required version information could not be found in the expected configuration file.
| Future<String> findMalioc(Directory armToolsDir) async { | ||
| if (await armToolsDir.exists()) { | ||
| await for (final entity in armToolsDir.list(recursive: true)) { | ||
| if (entity is File && entity.path.endsWith('/malioc')) { |
There was a problem hiding this comment.
The check entity.path.endsWith('/malioc') is platform-specific and may fail on Windows. To improve portability, consider checking the file name using entity.uri.pathSegments.last or using Platform.pathSeparator.
| if (entity is File && entity.path.endsWith('/malioc')) { | |
| if (entity is File && entity.uri.pathSegments.last == 'malioc') { |
| bool update = false; | ||
| String? maliocPath; | ||
|
|
||
| for (int i = 0; i < arguments.length; i++) { |
There was a problem hiding this comment.
That would add a dependency which complicates this usage. Right now it's just a script.
There was a problem hiding this comment.
I see lots of uses of this for other scripts: https://github.com/search?q=repo%3Aflutter%2Fflutter+argparser&type=code. I think ArgParse is something that only makes sense when used in a script, so that's kind of exactly what it's for.
I think it makes the parsing look much more readable, but I'll leave it up to you.
There was a problem hiding this comment.
When I say "script" i mean a dart file you can execute. Those other things are dart projects with their own pubspec's. It complicates the setup a bit.
There was a problem hiding this comment.
I think running this script would use the pubspec.yaml in flutter/engine/src/flutter, which already specifies an args dependency:
flutter/engine/src/flutter/pubspec.yaml
Line 127 in 2000a5a
So I think it would just work. I tested it out by putting a simple dart script in this directory that calls import 'package:args/args.dart';, and it seems to work.
| } | ||
|
|
||
| print('Downloading malioc tools to ${armToolsDir.path}...'); | ||
| final cipdProcess = await Process.start('cipd', [ |
There was a problem hiding this comment.
This downloads 850MB. Do we really want to make the default way to run this tool be to download this and then immediately delete it after? Maybe we should be more forceful about making the user provide a directory, and automatically download it there if it doesn't exist.
There was a problem hiding this comment.
This duplicates how it is run on ci, someone can bypass it with --malioc-path. It seems like there are tradeoffs however we cut it. Maybe just keeping it in alignment with ci is the good default.
There was a problem hiding this comment.
I think running on CI from a blank state is quite a different scenario than a developer running it in their environment. But not a big deal. SGTM.
| bool update = false; | ||
| String? maliocPath; | ||
|
|
||
| for (int i = 0; i < arguments.length; i++) { |
There was a problem hiding this comment.
I see lots of uses of this for other scripts: https://github.com/search?q=repo%3Aflutter%2Fflutter+argparser&type=code. I think ArgParse is something that only makes sense when used in a script, so that's kind of exactly what it's for.
I think it makes the parsing look much more readable, but I'll leave it up to you.
| } | ||
|
|
||
| print('Downloading malioc tools to ${armToolsDir.path}...'); | ||
| final cipdProcess = await Process.start('cipd', [ |
There was a problem hiding this comment.
I think running on CI from a blank state is quite a different scenario than a developer running it in their environment. But not a big deal. SGTM.
Roll Flutter from 5e4f16931847 to aeb96234de86 (42 revisions) flutter/flutter@5e4f169...aeb9623 2026-04-24 [email protected] Fix leak on error case (flutter/flutter#185516) 2026-04-24 [email protected] Roll Skia from 04c6c369cfd0 to 1c9b0b9141e9 (2 revisions) (flutter/flutter#185529) 2026-04-24 [email protected] Roll Dart SDK from f386b11262f6 to c26627715892 (1 revision) (flutter/flutter#185526) 2026-04-24 [email protected] Roll Skia from 290a056fcd0e to 04c6c369cfd0 (2 revisions) (flutter/flutter#185525) 2026-04-24 [email protected] [ios] Extract SplashScreenManager from FlutterViewController (flutter/flutter#185405) 2026-04-24 [email protected] Roll Fuchsia Linux SDK from j3UCWZhWx7zSl9Asy... to 9fPnyEo9PaNdXtasl... (flutter/flutter#185523) 2026-04-24 [email protected] Roll Skia from 4c8bedd3c932 to 290a056fcd0e (1 revision) (flutter/flutter#185518) 2026-04-24 [email protected] Roll Dart SDK from 70665fc3fd2e to f386b11262f6 (2 revisions) (flutter/flutter#185512) 2026-04-24 [email protected] Handle hairline strokes in UberSDF (flutter/flutter#184895) 2026-04-24 [email protected] Roll Skia from ea20c73ac72c to 4c8bedd3c932 (3 revisions) (flutter/flutter#185509) 2026-04-24 [email protected] Use relative path for reloadedSourcesUri and reloaded modules (flutter/flutter#184598) 2026-04-24 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (#185431)" (flutter/flutter#185513) 2026-04-24 [email protected] Roll Skia from e8d00d634c22 to ea20c73ac72c (8 revisions) (flutter/flutter#185500) 2026-04-23 [email protected] Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (flutter/flutter#185431) 2026-04-23 [email protected] update team-text-input pr triage link to filter out "waiting for response" label (flutter/flutter#185499) 2026-04-23 [email protected] Check for overflow when computing the pixel buffer size for an animated PNG frame (flutter/flutter#185442) 2026-04-23 [email protected] Impeller: Recreate Vulkan transients on surface size change (flutter/flutter#185122) 2026-04-23 [email protected] Updating the windowing API for sized to content regular and dialog windows + removing the decorated flag (flutter/flutter#184977) 2026-04-23 [email protected] Roll Dart SDK from 634991935e9a to 70665fc3fd2e (2 revisions) (flutter/flutter#185488) 2026-04-23 [email protected] Updating ios triage link (flutter/flutter#185437) 2026-04-23 [email protected] Revert "Preprovision Android NDK for flavored builds and reuse matchi… (flutter/flutter#185439) 2026-04-23 [email protected] fix(web): Fix LateInitializationError in CkSurface and SkwasmSurface (flutter/flutter#185116) 2026-04-23 [email protected] [web] Implement stepped image downscaling for CanvasKit and Skwasm (flutter/flutter#184741) 2026-04-23 [email protected] Made wide_gamut_macos only run on arm64 machines (flutter/flutter#185486) 2026-04-23 [email protected] [ios] Update documentation for FlutterAppDelegate.pluginRegistrant (flutter/flutter#185201) 2026-04-23 [email protected] Roll Dart SDK from bdf48933f3cf to 634991935e9a (1 revision) (flutter/flutter#185462) 2026-04-23 [email protected] Roll Skia from 5fe6162546b1 to e8d00d634c22 (3 revisions) (flutter/flutter#185459) 2026-04-23 [email protected] Roll Skia from 0049c5d91b08 to 5fe6162546b1 (1 revision) (flutter/flutter#185455) 2026-04-23 [email protected] Roll Dart SDK from 9648f446f131 to bdf48933f3cf (19 revisions) (flutter/flutter#185451) 2026-04-23 [email protected] Roll Skia from 11640d1cbc5c to 0049c5d91b08 (11 revisions) (flutter/flutter#185453) 2026-04-23 [email protected] Add disposal guidance to CurvedAnimation and CurveTween docs (flutter/flutter#184569) 2026-04-23 [email protected] Add `clipBehavior` parameter to `AnimatedCrossFade` (flutter/flutter#184545) 2026-04-23 [email protected] [fuchsia] Ask for only VMEX, not ambient-replace-as-executable. (flutter/flutter#185099) 2026-04-23 [email protected] Unify SemanticUpdateBuilder API for web and non-web (flutter/flutter#185433) 2026-04-22 [email protected] Fix ImageInfo.isCloneOf tests by moving async work to setUp (flutter/flutter#185254) 2026-04-22 [email protected] Roll Fuchsia Linux SDK from UdpQnaP5eSaDZd3-i... to j3UCWZhWx7zSl9Asy... (flutter/flutter#185438) 2026-04-22 [email protected] Adds script to run malioc locally (flutter/flutter#185371) 2026-04-22 [email protected] Add await mechanism to setClipboard in android_semantics_integration test (flutter/flutter#185428) 2026-04-22 [email protected] Add ability to pass flags to `et run` (flutter/flutter#185109) 2026-04-22 [email protected] Add more guidelines for code review bot (flutter/flutter#185367) 2026-04-22 [email protected] Roll pub packages (flutter/flutter#185274) 2026-04-22 [email protected] Fix incorrect scale parameter reference in Image constructor docs (flutter/flutter#185403) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages ...
…r#11576) Roll Flutter from 5e4f16931847 to aeb96234de86 (42 revisions) flutter/flutter@5e4f169...aeb9623 2026-04-24 [email protected] Fix leak on error case (flutter/flutter#185516) 2026-04-24 [email protected] Roll Skia from 04c6c369cfd0 to 1c9b0b9141e9 (2 revisions) (flutter/flutter#185529) 2026-04-24 [email protected] Roll Dart SDK from f386b11262f6 to c26627715892 (1 revision) (flutter/flutter#185526) 2026-04-24 [email protected] Roll Skia from 290a056fcd0e to 04c6c369cfd0 (2 revisions) (flutter/flutter#185525) 2026-04-24 [email protected] [ios] Extract SplashScreenManager from FlutterViewController (flutter/flutter#185405) 2026-04-24 [email protected] Roll Fuchsia Linux SDK from j3UCWZhWx7zSl9Asy... to 9fPnyEo9PaNdXtasl... (flutter/flutter#185523) 2026-04-24 [email protected] Roll Skia from 4c8bedd3c932 to 290a056fcd0e (1 revision) (flutter/flutter#185518) 2026-04-24 [email protected] Roll Dart SDK from 70665fc3fd2e to f386b11262f6 (2 revisions) (flutter/flutter#185512) 2026-04-24 [email protected] Handle hairline strokes in UberSDF (flutter/flutter#184895) 2026-04-24 [email protected] Roll Skia from ea20c73ac72c to 4c8bedd3c932 (3 revisions) (flutter/flutter#185509) 2026-04-24 [email protected] Use relative path for reloadedSourcesUri and reloaded modules (flutter/flutter#184598) 2026-04-24 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (#185431)" (flutter/flutter#185513) 2026-04-24 [email protected] Roll Skia from e8d00d634c22 to ea20c73ac72c (8 revisions) (flutter/flutter#185500) 2026-04-23 [email protected] Run all flutter/flutter macOS tests using Xcode 26 and iOS 26 simulator (flutter/flutter#185431) 2026-04-23 [email protected] update team-text-input pr triage link to filter out "waiting for response" label (flutter/flutter#185499) 2026-04-23 [email protected] Check for overflow when computing the pixel buffer size for an animated PNG frame (flutter/flutter#185442) 2026-04-23 [email protected] Impeller: Recreate Vulkan transients on surface size change (flutter/flutter#185122) 2026-04-23 [email protected] Updating the windowing API for sized to content regular and dialog windows + removing the decorated flag (flutter/flutter#184977) 2026-04-23 [email protected] Roll Dart SDK from 634991935e9a to 70665fc3fd2e (2 revisions) (flutter/flutter#185488) 2026-04-23 [email protected] Updating ios triage link (flutter/flutter#185437) 2026-04-23 [email protected] Revert "Preprovision Android NDK for flavored builds and reuse matchi… (flutter/flutter#185439) 2026-04-23 [email protected] fix(web): Fix LateInitializationError in CkSurface and SkwasmSurface (flutter/flutter#185116) 2026-04-23 [email protected] [web] Implement stepped image downscaling for CanvasKit and Skwasm (flutter/flutter#184741) 2026-04-23 [email protected] Made wide_gamut_macos only run on arm64 machines (flutter/flutter#185486) 2026-04-23 [email protected] [ios] Update documentation for FlutterAppDelegate.pluginRegistrant (flutter/flutter#185201) 2026-04-23 [email protected] Roll Dart SDK from bdf48933f3cf to 634991935e9a (1 revision) (flutter/flutter#185462) 2026-04-23 [email protected] Roll Skia from 5fe6162546b1 to e8d00d634c22 (3 revisions) (flutter/flutter#185459) 2026-04-23 [email protected] Roll Skia from 0049c5d91b08 to 5fe6162546b1 (1 revision) (flutter/flutter#185455) 2026-04-23 [email protected] Roll Dart SDK from 9648f446f131 to bdf48933f3cf (19 revisions) (flutter/flutter#185451) 2026-04-23 [email protected] Roll Skia from 11640d1cbc5c to 0049c5d91b08 (11 revisions) (flutter/flutter#185453) 2026-04-23 [email protected] Add disposal guidance to CurvedAnimation and CurveTween docs (flutter/flutter#184569) 2026-04-23 [email protected] Add `clipBehavior` parameter to `AnimatedCrossFade` (flutter/flutter#184545) 2026-04-23 [email protected] [fuchsia] Ask for only VMEX, not ambient-replace-as-executable. (flutter/flutter#185099) 2026-04-23 [email protected] Unify SemanticUpdateBuilder API for web and non-web (flutter/flutter#185433) 2026-04-22 [email protected] Fix ImageInfo.isCloneOf tests by moving async work to setUp (flutter/flutter#185254) 2026-04-22 [email protected] Roll Fuchsia Linux SDK from UdpQnaP5eSaDZd3-i... to j3UCWZhWx7zSl9Asy... (flutter/flutter#185438) 2026-04-22 [email protected] Adds script to run malioc locally (flutter/flutter#185371) 2026-04-22 [email protected] Add await mechanism to setClipboard in android_semantics_integration test (flutter/flutter#185428) 2026-04-22 [email protected] Add ability to pass flags to `et run` (flutter/flutter#185109) 2026-04-22 [email protected] Add more guidelines for code review bot (flutter/flutter#185367) 2026-04-22 [email protected] Roll pub packages (flutter/flutter#185274) 2026-04-22 [email protected] Fix incorrect scale parameter reference in Image constructor docs (flutter/flutter#185403) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages ...
adds script to help running malioc locally
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.