-
-
Couldn't load subscription status.
- Fork 32
feat(symbolication): upload dart symbol mapping file #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
bfd77cd
Initial impl
buenaflor 99dee07
Initial impl
buenaflor 21ba340
Initial impl
buenaflor 4449ef8
Update
buenaflor 7fed2aa
Update
buenaflor 46729fd
Fix
buenaflor e20751a
Merge branch 'feat/find-relevant-debug-files' into feat/find-mapping-…
buenaflor 3272add
Update
buenaflor a25d75a
Update
buenaflor e69117e
Update
buenaflor 45f7bc2
Update
buenaflor e97c0df
Update
buenaflor 8615400
Update
buenaflor c777be7
Update
buenaflor 8c97581
Update
buenaflor 0502f23
Update
buenaflor 4524772
Optimize
buenaflor 396507c
Update
buenaflor 1eea0d8
Update
buenaflor c420e72
Remove unnecessary file check
buenaflor 0cd79e7
Review
buenaflor a49d2de
Add missing test
buenaflor 82f1afc
Update tests
buenaflor 035af1b
Update tests
buenaflor b4d9a97
Update tests
buenaflor 832e5b8
Update
buenaflor 4da7432
Update
buenaflor 5eff2db
Update
buenaflor 90a99cb
Update
buenaflor 48305ef
Updaet
buenaflor ad59fb8
Update
buenaflor c9092b5
Update
buenaflor 6e7b946
Update
buenaflor 4645b04
Update
buenaflor a0fb007
Update
buenaflor c1bdd43
Update
buenaflor 5edd4f7
Update
buenaflor d5d6490
Update
buenaflor 6cea83c
Update cli_params.dart
buenaflor 610cffe
Update dart_symbol_map.dart
buenaflor 8f224b8
Update tests
buenaflor cc7514b
Fix
buenaflor 5210a26
Update
buenaflor f096be1
Update
buenaflor 187f68b
Update
buenaflor 0f930a4
Merge branch 'main' into feat/find-mapping-file
buenaflor 07106f7
Run tests
buenaflor 3f3a278
Add marker
buenaflor b605d70
Update
buenaflor ced1eee
Update
buenaflor 897756c
Update
buenaflor 1cb2765
Update
buenaflor 725ea42
Update
buenaflor 78faf96
Update
buenaflor 8a8ee27
Update
buenaflor 440caf0
Update
buenaflor 6d69035
Update
buenaflor 6b6eff0
Update
buenaflor 67a0f17
Update
buenaflor a2bf91c
Update
buenaflor 90bbaf0
Update
buenaflor f4e1ccb
Update
buenaflor aea323e
Update
buenaflor 1dd8c9c
Update
buenaflor 40ddd00
Update
buenaflor 82c6294
Update CHANGELOG
buenaflor 2b63ca8
Update CHANGELOG
buenaflor 089f82e
Update
buenaflor 54dd327
Update
buenaflor 1af9d5b
Update
buenaflor f0b27b5
Update
buenaflor 9a35bd6
Update
buenaflor 49d12eb
Update
buenaflor 1f31f27
Update
buenaflor a1eeebe
Update
buenaflor 811a8d4
Update
buenaflor fba5932
Update docs
buenaflor 777e17d
Fix tests
buenaflor 9db5261
Update CHANGELOG
buenaflor 0f899d5
Update
buenaflor 1ee6f3d
Update test
buenaflor a79df66
Remove duplicate
buenaflor 3224d42
Cursor review
buenaflor 0ef4ecf
Update marker
buenaflor 3b3af39
Update comment
buenaflor 4a61274
Review
buenaflor 7919595
Update CI
buenaflor 7c56763
Update
buenaflor f81d281
Update
buenaflor e67917a
Update
buenaflor 08b9690
Update
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| import 'package:file/file.dart'; | ||
|
|
||
| import '../configuration.dart'; | ||
| import 'flutter_debug_files.dart'; | ||
|
|
||
| /// If [configuredPath] is provided, validates and returns the absolute path to the Dart symbol map. | ||
| /// If not provided, returns null. | ||
| /// | ||
| /// Note: we do not scan the filesystem for this file because the file does not | ||
| /// have a special extension so worst case we would have to check every file. | ||
| Future<String?> resolveDartSymbolMapPath({ | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| required FileSystem fs, | ||
| String? configuredPath, | ||
| }) async { | ||
| if (configuredPath == null || configuredPath.isEmpty) return null; | ||
|
|
||
| final file = fs.file(configuredPath); | ||
| if (!await file.exists()) { | ||
| throw StateError( | ||
| "Dart symbol map file not found at '$configuredPath'. Ensure the path is correct and the file exists.", | ||
| ); | ||
| } | ||
|
|
||
| return file.absolute.path; | ||
| } | ||
|
|
||
| /// Finds Flutter-relevant debug file paths for Android and Apple (iOS/macOS) | ||
| /// that should be paired with a Dart symbol map. | ||
| Future<Set<String>> findFlutterRelevantDebugFilePaths({ | ||
| required FileSystem fs, | ||
| required Configuration config, | ||
| }) async { | ||
| final Set<String> foundPaths = <String>{}; | ||
|
|
||
| Future<void> collectAndroidSymbolsUnder(String rootPath) async { | ||
| if (rootPath.isEmpty) return; | ||
|
|
||
| final directory = fs.directory(rootPath); | ||
| if (await directory.exists()) { | ||
| await for (final entity | ||
| in directory.list(recursive: true, followLinks: false)) { | ||
| if (entity is! File) continue; | ||
| final String basename = fs.path.basename(entity.path); | ||
| if (basename.startsWith('app') && | ||
| basename.endsWith('.symbols') && | ||
| !basename.contains('darwin')) { | ||
| foundPaths.add(fs.file(entity.path).absolute.path); | ||
| } | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| final file = fs.file(rootPath); | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (await file.exists()) { | ||
| final String basename = fs.path.basename(file.path); | ||
| if (basename.startsWith('app') && | ||
| basename.endsWith('.symbols') && | ||
| !basename.contains('darwin')) { | ||
| foundPaths.add(file.absolute.path); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (config.symbolsFolder.isNotEmpty) { | ||
| await collectAndroidSymbolsUnder(config.symbolsFolder); | ||
| } | ||
|
|
||
| if (config.buildFilesFolder != config.symbolsFolder) { | ||
| await collectAndroidSymbolsUnder(config.buildFilesFolder); | ||
| } | ||
|
|
||
| Future<void> collectAppleMachOUnder(String rootPath) async { | ||
| if (rootPath.isEmpty) return; | ||
| final dir = fs.directory(rootPath); | ||
| if (!await dir.exists()) return; | ||
|
|
||
| await for (final entity in dir.list(recursive: true, followLinks: false)) { | ||
| if (entity is! Directory) continue; | ||
| final String basename = fs.path.basename(entity.path); | ||
| if (basename == 'App.framework.dSYM') { | ||
| final String machOPath = fs.path.join( | ||
| entity.path, | ||
| 'Contents', | ||
| 'Resources', | ||
| 'DWARF', | ||
| 'App', | ||
| ); | ||
| final File machOFile = fs.file(machOPath); | ||
| if (await machOFile.exists()) { | ||
| foundPaths.add(machOFile.absolute.path); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| await collectAppleMachOUnder(config.buildFilesFolder); | ||
|
|
||
| await for (final root in enumerateDebugSearchRoots(fs: fs, config: config)) { | ||
| await collectAppleMachOUnder(root); | ||
| await collectAndroidSymbolsUnder(root); | ||
| } | ||
|
|
||
| return foundPaths; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.