How to build frontend_server.dart.snapshot for linux arm?

Issue

Anyone knows how to build a frontend_server.dart.snapshot for linux arm/arm64?

source code https://github.com/flutter/engine/tree/master/flutter_frontend_server

flutter engine version v1.20.1

dart-sdk version

Dart SDK version: 2.9.0 (stable) (Fri Jul 31 10:59:48 2020 +0200) on "linux_x64"

i suppose to do like this?

/workspace/engine/src/flutter/flutter_frontend_server$ /workspace/dart-sdk/bin/dart --snapshot-kind=kernel --snapshot=frontend_server.dart.snapshot --packages=.packages   bin/starter.dart 

errors below

../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:20:24: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
    {int Function(T, T)? compare}) {
                       ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:50:67: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
int lowerBound<T>(List<T> sortedList, T value, {int Function(T, T)? compare}) {
                                                                  ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:70:44: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
void shuffle(List list, [int start = 0, int? end]) {
                                           ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:84:44: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
void reverse(List list, [int start = 0, int? end]) {
                                           ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:115:24: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
    {int Function(T, T)? compare, int start = 0, int? end}) {
                       ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:115:53: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
    {int Function(T, T)? compare, int start = 0, int? end}) {
                                                    ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:159:24: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
    {int start = 0, int? end, int Function(T, T)? compare}) {
                       ^
../../third_party/dart/third_party/pkg/collection/lib/src/algorithms.dart:159:49: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
    {int start = 0, int? end, int Function(T, T)? compare}) {
                                                ^
../../third_party/dart/third_party/pkg/collection/lib/src/canonicalized_map.dart:18:25: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
  final bool Function(K)? _isValidKeyFn;
                        ^
../../third_party/dart/third_party/pkg/collection/lib/src/canonicalized_map.dart:31:28: Error: Null safety features are disabled for this library.
Try removing the `@dart=` annotation or setting the language version higher.
      {bool Function(K key)? isValidKey})

Looking forward! Thanks.

Solution

Null safety feature is a breaking change.
I fixed this problem by doing git reset to earlier version.
example:
change src/third_party/dart/third_party/pkg/collection to tag 1.14.13
git reset 00540dce43a9bc778bfa55935a182799ff00044d
remember to do git checkout all the modified files.

Answered By – kakapowu

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.