Skip to content

[vector_graphics_compiler] Use Abi.current() for engine-artifact lookup on Linux ARM64#11781

Open
HiroyukiTamura wants to merge 4 commits into
flutter:mainfrom
HiroyukiTamura:feature/linux-arm64-engine-artifact-lookup
Open

[vector_graphics_compiler] Use Abi.current() for engine-artifact lookup on Linux ARM64#11781
HiroyukiTamura wants to merge 4 commits into
flutter:mainfrom
HiroyukiTamura:feature/linux-arm64-engine-artifact-lookup

Conversation

@HiroyukiTamura
Copy link
Copy Markdown

@HiroyukiTamura HiroyukiTamura commented May 25, 2026

On Linux ARM64 hosts, vector_graphics_compiler fails with:

Could not locate libpathops at <flutter>/bin/cache/artifacts/engine/linux-x64/libpath_ops.so

Flutter ships the engine binary at .../engine/linux-arm64/libpath_ops.so, but
_initialize_path_ops_io.dart and _initialize_tessellator_io.dart hardcoded
'linux-x64' on Linux and never looked at the arm64 directory.

Both loaders now route through a new pure engineArtifactSubpath(...) helper
that maps Abi.current() to the engine-artifact subpath. The helper is
unit-tested across every supported Abi, the linux-arm64 fix, and the
unsupported-host branch. Behavior on windows-x64, darwin, and linux-x64 hosts
is unchanged. Bumps the package to 1.2.6.

Fixes flutter/flutter#158865.

Pre-Review Checklist

@flutter-dashboard
Copy link
Copy Markdown

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.

@github-actions github-actions Bot added p: vector_graphics triage-engine Should be looked at in engine triage labels May 25, 2026
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown

@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 linux-arm64 hosts in the vector graphics compiler. It dynamically determines the platform directory for pathops and the tessellator loader using Abi.current() instead of hardcoding linux-x64. Additionally, the package version is bumped to 1.2.4 in pubspec.yaml and documented in CHANGELOG.md. There are no review comments to address.

@HiroyukiTamura HiroyukiTamura force-pushed the feature/linux-arm64-engine-artifact-lookup branch 2 times, most recently from 0cb286c to b6a9376 Compare May 25, 2026 19:37
@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

[x] I added new tests to check the change I am making, or I have commented below to indicate which test exemption this PR falls under.

Thanks for the contribution! Where is this item reflected in the PR?

@HiroyukiTamura
Copy link
Copy Markdown
Author

@stuartmorgan-g
Hi, sorry I had to write test exemption. I updated PR description.
It require extracting platform mapping logic for the testing, but I felt like too much for this one line changing.

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

It require extracting platform mapping logic for the testing, but I felt like too much for this one line changing.

Why specifically is extracting logic to make a fix testable too much? Is there something make it infeasible?

Copy link
Copy Markdown
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, thanks

@gaaclarke
Copy link
Copy Markdown
Member

@HiroyukiTamura you're going to have to rebase please

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

We can resolve the changelog/pubspec conflicts as part of landing (it's trivial in the web UI, as long as the branch isn't locked).

But before we can do that the testing question needs to be resolved.

@gaaclarke
Copy link
Copy Markdown
Member

But before we can do that the testing question needs to be resolved.

That's probably not @HiroyukiTamura's responsibility though, right? We'd need linux arm bots which I know is something the infra team is investigating for flutter. I'm not sure what the situation is for packages.

Copy link
Copy Markdown
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Marking as change requested to reflect my comments above.

On Linux ARM64 hosts, asset bundling fails with `Could not locate
libpathops at .../engine/linux-x64/libpath_ops.so`. Flutter ships the
engine binary at `.../engine/linux-arm64/...`, but
_initialize_path_ops_io.dart and _initialize_tessellator_io.dart
hardcode `'linux-x64'` on Linux.

Switch the Linux branch to pick `'linux-arm64'` when
Abi.current() == Abi.linuxArm64, otherwise keep `'linux-x64'`.
Behavior on existing hosts is unchanged.

Fixes flutter/flutter#158865.
@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

We'd need linux arm bots

We would need Linux arm bots for an end-to-end test, but not for a unit test. See my comment above where I responded to the PR author's argument that refactoring to make this unit testable was "too much" for this change.

@HiroyukiTamura HiroyukiTamura force-pushed the feature/linux-arm64-engine-artifact-lookup branch from 28bea25 to fbed4da Compare June 2, 2026 19:04
…tests

Moves engine-artifact directory/file selection out of the per-loader
if/else blocks into a pure engineArtifactSubpath(...) helper keyed on
Abi. Unit tests cover every supported host ABI, the linux-arm64 fix,
and the unsupported-host branch.

Hosts that Flutter does not ship engine artifacts for (linuxIA32,
linuxArm, linuxRiscv32, linuxRiscv64, windowsIA32) now report "not
supported" instead of producing a non-loadable linux-x64/windows-x64
path. windowsArm64 still falls back to windows-x64 to match the
original x64-emulation behavior.
The "not supported on" message in the path_ops and tessellator loaders
used Platform.localeName (e.g. "en_US"), which identifies the user's
locale rather than the host. Switch to Abi.current() so the printed
value (e.g. "Abi.linuxRiscv64") actually identifies the unsupported
host.
@HiroyukiTamura HiroyukiTamura force-pushed the feature/linux-arm64-engine-artifact-lookup branch from 1c8366d to c2e5a54 Compare June 2, 2026 20:08
@HiroyukiTamura
Copy link
Copy Markdown
Author

HiroyukiTamura commented Jun 2, 2026

I pushed fixes.

  • I extracted the platform mapper logic and added unit tests.
    Also I narrowed the unsupported branch: ABIs that Flutter doesn't ships engine artifacts for (linuxIA32/Arm/Riscv*, windowsIA32).
  • The unsupported-host print was using Platform.localeName (which prints "en_US" etc.). I switched it to Abi.current()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: vector_graphics triage-engine Should be looked at in engine triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[vector_graphics] Support libpathops on Linux arm.

3 participants