Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7bfcaf9
chore: flutter symbol collector CLI tool
vaind Oct 11, 2023
d1313bd
renames
vaind Oct 12, 2023
7a0c73e
symbol collector CLI integration
vaind Oct 12, 2023
ac1c1c0
fixup getVersion()
vaind Oct 12, 2023
7218df6
collector upload
vaind Oct 12, 2023
d394181
collect platform info with symbol archive
vaind Oct 12, 2023
5e963aa
download and extract zip archives
vaind Oct 12, 2023
c4aa8a8
download via cli bin
vaind Oct 12, 2023
a7a80ea
upload via symbol-collector cli
vaind Oct 12, 2023
667c144
add symbol collector CI
vaind Oct 13, 2023
5390bcf
extract inner zip files
vaind Oct 13, 2023
2bc4ed7
test symbol collector in CI
vaind Oct 13, 2023
ed79ef4
fix tests
vaind Oct 13, 2023
ff91b35
chore: update changelog
vaind Oct 13, 2023
795e7a4
fix tests
vaind Oct 13, 2023
816ae3e
fix tests
vaind Oct 13, 2023
5170a46
upload android symbols
vaind Oct 13, 2023
caa9b62
fix duplicate upload
vaind Oct 13, 2023
4724c81
upload symbols for all of 3.13.*
vaind Oct 24, 2023
b55becb
cache previous symbol collector successful uploads
vaind Oct 24, 2023
cb298d6
fix artifacts
vaind Oct 24, 2023
57efb36
we need to use cache
vaind Oct 24, 2023
8d686cb
cron
vaind Oct 24, 2023
bdfcfdc
test
vaind Oct 24, 2023
cee0761
use artifacts
vaind Oct 24, 2023
611f636
run for all v3 flutter versions
vaind Oct 24, 2023
321198c
fixup changelog
vaind Oct 24, 2023
6834bc8
fixup changelog
vaind Oct 25, 2023
dfb8fee
refactor: move status cache to a separate file
vaind Oct 25, 2023
deca8fc
change artifact action to download from previous runs
vaind Oct 25, 2023
12f6033
fix status cache
vaind Oct 25, 2023
0dc96c3
fix status cache
vaind Oct 25, 2023
3875129
register symbol collector CLI updater
vaind Oct 25, 2023
6ba64f6
log status change
vaind Oct 25, 2023
d352c73
fix status caching
vaind Oct 25, 2023
6d163a6
fix
vaind Oct 25, 2023
b7e4719
process all flutter v3 subversions
vaind Oct 25, 2023
2edb9be
try to fix memory usage
vaind Oct 25, 2023
adf8f60
cleanup earlier
vaind Oct 25, 2023
6529c4b
roll back changes after figuring out the issue is with symbol collect…
vaind Oct 25, 2023
6f1fc8d
update symbol-collector to the latest version
vaind Oct 26, 2023
7b9fb06
rename .successful to .cache
vaind Oct 26, 2023
e7a20f3
don't use version in the status cache
vaind Oct 26, 2023
9461372
remove temp code
vaind Oct 26, 2023
986f954
run cron every hour
vaind Oct 26, 2023
9b74649
update symbol collector issue link
vaind Oct 27, 2023
5edbf3d
Merge branch 'main' into feat/flutter-symbol-upload
vaind Oct 30, 2023
0d8652b
minor fixes
vaind Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
collect platform info with symbol archive
  • Loading branch information
vaind committed Oct 25, 2023
commit d3941818f59cad11b610c6129d901673540f6c96
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import 'package:gcloud/storage.dart';
import 'package:platform/platform.dart';

import 'symbol_archive.dart';

abstract class FlutterSymbolResolver {
final String _prefix;
final Bucket _bucket;
final _resolvedFiles = List<String>.empty(growable: true);
final _resolvedFiles = List<SymbolArchive>.empty(growable: true);
Platform get platform;

FlutterSymbolResolver(this._bucket, String prefix)
: _prefix = prefix.endsWith('/')
Expand All @@ -19,18 +23,21 @@ abstract class FlutterSymbolResolver {
.map((v) => v.name)
.toList();
if (matches.isNotEmpty) {
_resolvedFiles.add(matches.single);
_resolvedFiles.add(SymbolArchive(matches.single, platform));
}
}

Future<List<String>> listArchives();
Future<List<SymbolArchive>> listArchives();
}

class IosSymbolResolver extends FlutterSymbolResolver {
IosSymbolResolver(super.bucket, super.prefix);

@override
Future<List<String>> listArchives() async {
final platform = FakePlatform(operatingSystem: Platform.iOS);

@override
Future<List<SymbolArchive>> listArchives() async {
await tryResolve('ios-release/Flutter.dSYM.zip');
return _resolvedFiles;
}
Expand All @@ -40,7 +47,10 @@ class MacOSSymbolResolver extends FlutterSymbolResolver {
MacOSSymbolResolver(super.bucket, super.prefix);

@override
Future<List<String>> listArchives() async {
final platform = FakePlatform(operatingSystem: Platform.macOS);

@override
Future<List<SymbolArchive>> listArchives() async {
// darwin-x64-release directory contains a fat (arm64+x86_64) binary.
await tryResolve('darwin-x64-release/FlutterMacOS.dSYM.zip');
return _resolvedFiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:path/path.dart' as path;

import 'flutter_version.dart';
import 'flutter_symbol_resolver.dart';
import 'symbol_archive.dart';

class FlutterSymbolSource {
late final Logger _log;
Expand All @@ -22,7 +23,7 @@ class FlutterSymbolSource {
.listTags(_flutterRepo, perPage: 30)
.map((t) => FlutterVersion(t.name));

Future<List<String>> listSymbolArchives(FlutterVersion version) async {
Future<List<SymbolArchive>> listSymbolArchives(FlutterVersion version) async {
// example: https://console.cloud.google.com/storage/browser/flutter_infra_release/flutter/9064459a8b0dcd32877107f6002cc429a71659d1
final prefix = 'flutter/${await version.getEngineVersion()}/';

Expand All @@ -38,24 +39,21 @@ class FlutterSymbolSource {
}

assert(resolvers.isNotEmpty);
final archives = List<String>.empty(growable: true);
final archives = List<SymbolArchive>.empty(growable: true);
for (var resolver in resolvers) {
final files = await resolver.listArchives();
if (files.isEmpty) {
_log.warning(
'Flutter ${version.tagName}: no debug symbols found by ${resolver.runtimeType}');
} else {
_log.fine(
'Flutter ${version.tagName}: ${resolver.runtimeType} found debug symbols: ${files.map((v) => path.basename(v))}');
'Flutter ${version.tagName}: ${resolver.runtimeType} found debug symbols: ${files.map((v) => path.basename(v.path))}');
archives.addAll(files);
}
}

return archives;
}

Stream<List<int>> download(
String path,
) =>
_symbolsBucket.read(path);
Stream<List<int>> download(String path) => _symbolsBucket.read(path);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:platform/platform.dart';

class SymbolArchive {
final String path;
final Platform platform;

SymbolArchive(this.path, this.platform);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,10 @@ void main() {
final archives = await sut.listSymbolArchives(FlutterVersion('3.13.4'));
const prefix = 'flutter/9064459a8b0dcd32877107f6002cc429a71659d1';
expect(
archives,
archives.map((v) => '${v.platform.operatingSystem} - ${v.path}'),
equals([
'$prefix/ios-release/Flutter.dSYM.zip',
'$prefix/darwin-x64-release/FlutterMacOS.dSYM.zip'
]));
});

test('listSymbolArchives() supports expected platforms', () async {
final archives = await sut.listSymbolArchives(FlutterVersion('3.13.4'));
const prefix = 'flutter/9064459a8b0dcd32877107f6002cc429a71659d1';
expect(
archives,
equals([
'$prefix/ios-release/Flutter.dSYM.zip',
'$prefix/darwin-x64-release/FlutterMacOS.dSYM.zip'
'ios - $prefix/ios-release/Flutter.dSYM.zip',
'macos - $prefix/darwin-x64-release/FlutterMacOS.dSYM.zip'
]));
});

Expand Down