Skip to content

Commit 0cb286c

Browse files
hiroyukitamuraclaude
andcommitted
[vector_graphics_compiler] Use Abi.current() for engine-artifact lookup
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. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 69cf959 commit 0cb286c

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/vector_graphics_compiler/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
## NEXT
1+
## 1.2.4
22

33
* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
4+
* Fixes `linux-arm64` host support by selecting the Flutter engine
5+
artifact directory from `Abi.current()` instead of a hardcoded
6+
`linux-x64`. The same fix applies to the tessellator loader.
7+
Resolves flutter/flutter#158865.
48

59
## 1.2.3
610

packages/vector_graphics_compiler/lib/src/_initialize_path_ops_io.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
// ignore_for_file: avoid_print
66

7+
import 'dart:ffi' show Abi;
78
import 'dart:io';
9+
810
import 'svg/path_ops.dart';
911

1012
/// Look up the location of the pathops from flutter's artifact cache.
@@ -28,7 +30,7 @@ bool initializePathOpsFromFlutterCache() {
2830
platform = 'darwin-x64';
2931
executable = 'libpath_ops.dylib';
3032
} else if (Platform.isLinux) {
31-
platform = 'linux-x64';
33+
platform = Abi.current() == Abi.linuxArm64 ? 'linux-arm64' : 'linux-x64';
3234
executable = 'libpath_ops.so';
3335
} else {
3436
print('path_ops not supported on ${Platform.localeName}');

packages/vector_graphics_compiler/lib/src/_initialize_tessellator_io.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
// ignore_for_file: avoid_print
66

7+
import 'dart:ffi' show Abi;
78
import 'dart:io';
9+
810
import 'svg/tessellator.dart';
911

1012
/// Look up the location of the tessellator from flutter's artifact cache.
@@ -28,7 +30,7 @@ bool initializeTessellatorFromFlutterCache() {
2830
platform = 'darwin-x64';
2931
executable = 'libtessellator.dylib';
3032
} else if (Platform.isLinux) {
31-
platform = 'linux-x64';
33+
platform = Abi.current() == Abi.linuxArm64 ? 'linux-arm64' : 'linux-x64';
3234
executable = 'libtessellator.so';
3335
} else {
3436
print('Tesselation not supported on ${Platform.localeName}');

packages/vector_graphics_compiler/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: vector_graphics_compiler
22
description: A compiler to convert SVGs to the binary format used by `package:vector_graphics`.
33
repository: https://github.com/flutter/packages/tree/main/packages/vector_graphics_compiler
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+vector_graphics%22
5-
version: 1.2.3
5+
version: 1.2.4
66

77
executables:
88
vector_graphics_compiler:

0 commit comments

Comments
 (0)