[vector_graphics_compiler] Use Abi.current() for engine-artifact lookup on Linux ARM64#11781
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. |
|
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. |
There was a problem hiding this comment.
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.
0cb286c to
b6a9376
Compare
Thanks for the contribution! Where is this item reflected in the PR? |
|
@stuartmorgan-g |
Why specifically is extracting logic to make a fix testable too much? Is there something make it infeasible? |
|
@HiroyukiTamura you're going to have to rebase please |
|
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. |
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. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
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.
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. |
28bea25 to
fbed4da
Compare
…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.
1c8366d to
c2e5a54
Compare
|
I pushed fixes.
|
On Linux ARM64 hosts,
vector_graphics_compilerfails with:Flutter ships the engine binary at
.../engine/linux-arm64/libpath_ops.so, but_initialize_path_ops_io.dartand_initialize_tessellator_io.darthardcoded'linux-x64'on Linux and never looked at the arm64 directory.Both loaders now route through a new pure
engineArtifactSubpath(...)helperthat maps
Abi.current()to the engine-artifact subpath. The helper isunit-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
[shared_preferences]///).