Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Deferred components causes release builds to fail #545

Closed
guidezpl opened this issue Sep 14, 2021 · 10 comments · Fixed by #730
Closed

Deferred components causes release builds to fail #545

guidezpl opened this issue Sep 14, 2021 · 10 comments · Fixed by #730
Assignees
Labels
bug Something isn't working P1 Priority 1 - Must have

Comments

@guidezpl
Copy link
Member

flutter build appbundle -v --no-deferred-components successfully completes, whereas
flutter build appbundle -v fails:

[   +2 ms] [   +1 ms] Running font-subset: /Users/plg/development/flutter-dev/bin/cache/artifacts/engine/darwin-x64/font-subset
/Users/plg/development/gallery/build/app/intermediates/flutter/release/flutter_assets/fonts/MaterialIcons-Regular.otf
/Users/plg/development/flutter-dev/bin/cache/artifacts/material_fonts/MaterialIcons-Regular.otf, using codepoints 58727 58332 57490 57491 57706 57496 57694
57695 57810 57609 57657 57882 57504 57634 57415 58372 58370 58814 58813 57846 58193 57402 59102 57759 59039 57947 57400 57425 57411 57461 57649 57399 57638
57632 57689 57423 59069 58514 58240 57785 57726 57948 57588 57583 58874 58873 59070 58513 58530 57898 58751 58554 58548 58447 58729 58121 58659 57686 58198
59011 58172 57718 58231 58059 57500 58173 57952 57782 58675 58569 57454 58146 58834 57522 58438 58563 58361 58938 57690 58286 57501 57498 58665 57757 57424
58195 58337 58136 58780 58648 57434 58771
[  +94 ms] [ +149 ms] aot_android_asset_bundle: Complete
[+585724 ms] [+585674 ms] ===== CRASH =====
[  +10 ms] [  +34 ms] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x17fb1b1af
[        ] [   +9 ms] Dart snapshot generator failed with exit code -6
[+2470 ms] [+2467 ms] ===== CRASH =====
[        ] [        ] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x17fb1b1af
[        ] [        ] Dart snapshot generator failed with exit code -6
[+15399 ms] [+15402 ms] android_aot_release_android-arm: Complete
[ +800 ms] [ +790 ms] android_aot_bundle_release_android-arm: Starting due to {}
[        ] [  +21 ms] android_aot_bundle_release_android-arm: Complete
[ +299 ms] [ +274 ms] android_aot_deferred_components_bundle_release_android-arm: Starting due to {}
[  +99 ms] [ +109 ms] android_aot_deferred_components_bundle_release_android-arm: Complete
[ +301 ms] [ +303 ms] Persisting file store
[        ] [  +21 ms] Done persisting file store
[        ] [  +28 ms] Target android_aot_release_android-x64 failed: Exception: AOT snapshotter exited with code -6
[  +99 ms]            #0      AndroidAot.build (package:flutter_tools/src/build_system/targets/android.dart:258:7)
[        ]            <asynchronous suspension>
[        ]            #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:836:9)
[        ]            <asynchronous suspension>
[        ]            #2      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #4      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[ +293 ms]            <asynchronous suspension>
[        ]            #6      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #8      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #9      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #10     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:603:16)
[+4409 ms]            <asynchronous suspension>
[        ]            #11     AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:314:32)
[        ]            <asynchronous suspension>
[        ]            #12     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
[        ]            <asynchronous suspension>
[        ]            #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #14     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[        ]            #15     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
[ +198 ms]            <asynchronous suspension>
[        ]            #16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #17     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
[        ]            <asynchronous suspension>
[        ]            #18     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[        ]            <asynchronous suspension>
[        ]            #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #20     main (package:flutter_tools/executable.dart:92:3)
[+1346 ms]            <asynchronous suspension>
[        ] [        ] Target android_aot_release_android-arm64 failed: Exception: AOT snapshotter exited with code -6
[        ]            #0      AndroidAot.build (package:flutter_tools/src/build_system/targets/android.dart:258:7)
[        ]            <asynchronous suspension>
[        ]            #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:836:9)
[        ]            <asynchronous suspension>
[        ]            #2      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[ +288 ms]            <asynchronous suspension>
[        ]            #4      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #6      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[        ]            #7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #8      Future.wait.<anonymous closure> (dart:async/future.dart)
[        ]            <asynchronous suspension>
[+1708 ms]            #9      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:774:32)
[        ]            <asynchronous suspension>
[        ]            #10     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:603:16)
[        ]            <asynchronous suspension>
[        ]            #11     AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:314:32)
[        ]            <asynchronous suspension>
[        ]            #12     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
[        ]            <asynchronous suspension>
[        ]            #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[ +340 ms]            #14     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[        ]            #15     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
[        ]            <asynchronous suspension>
[        ]            #16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #17     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
[        ]            <asynchronous suspension>
[        ]            #18     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[+1495 ms]            <asynchronous suspension>
[        ]            #19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #20     main (package:flutter_tools/executable.dart:92:3)
[        ]            <asynchronous suspension>
[        ] [  +15 ms] 
[        ]            #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[        ]            #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:331:7)
[        ]            <asynchronous suspension>
[        ]            #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
[        ]            <asynchronous suspension>
[+5655 ms]            #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +2 ms]            <asynchronous suspension>
[        ]            #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[        ]            #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
[        ]            <asynchronous suspension>
[        ]            #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
[ +634 ms]            <asynchronous suspension>
[        ]            #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[        ]            <asynchronous suspension>
[        ]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #10     main (package:flutter_tools/executable.dart:92:3)
[        ]            <asynchronous suspension>
[   +2 ms] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script '/Users/plg/development/flutter-dev/packages/flutter_tools/gradle/flutter.gradle' line: 1005
[        ] * What went wrong:
[        ] Execution failed for task ':app:compileFlutterBuildRelease'.
[  +80 ms] > Process 'command '/Users/plg/development/flutter-dev/bin/flutter'' finished with non-zero exit value 1
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 11m 35s
[   +2 ms] [  +27 ms] "flutter assemble" took 690,857ms.
[        ] [ +139 ms] ensureAnalyticsSent: 136ms
[        ] [   +3 ms] Running shutdown hooks
[        ] [        ] Shutdown hooks complete
[        ] [        ] exiting with code 1
[        ] > Task :app:compileFlutterBuildRelease FAILED
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[ +149 ms] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[   +1 ms] 1 actionable task: 1 executed
[  +96 ms] Running Gradle task 'bundleRelease'... (completed in 712.7s)
[ +374 ms] "flutter appbundle" took 730,893ms.
[ +117 ms] Gradle task bundleRelease failed with exit code 1
[   +9 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:383:9)
           <asynchronous suspension>
           #2      AndroidGradleBuilder.buildAab (package:flutter_tools/src/android/gradle.dart:196:5)
           <asynchronous suspension>
           #3      BuildAppBundleCommand.runCommand (package:flutter_tools/src/commands/build_appbundle.dart:148:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:92:3)
           <asynchronous suspension>
           
           
[ +377 ms] ensureAnalyticsSent: 260ms
[  +10 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[   +4 ms] exiting with code 1
@GaryQian
Copy link
Contributor

cc @rmacnak-google gen_snapshot seems to be segfaulting with -6. There have not been any gallery changes and I am still bisecting when this began to occur. It seems to happened beyond a week ago.

@guidezpl guidezpl added the bug Something isn't working label Oct 28, 2021
@GaryQian
Copy link
Contributor

GaryQian commented Nov 5, 2021

cc @rmacnak-google Have you had a chance to look at this?

@guidezpl
Copy link
Member Author

Hey wondering if there's an update on this?

@guidezpl guidezpl added the P1 Priority 1 - Must have label Dec 9, 2021
@guidezpl
Copy link
Member Author

friendly ping for an update

@guidezpl
Copy link
Member Author

guidezpl commented Apr 1, 2022

Still reproes

[+2595 ms] [+2537 ms] aot_android_asset_bundle: Complete
[+40206 ms] [+40199 ms] ===== CRASH =====
[        ] [        ] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x173430020
[        ] [        ] version=2.17.0-251.0.dev (dev) (Tue Mar 29 00:56:13 2022 -0700) on "macos_arm"
[        ] [        ] pid=36345, thread=-1, isolate_group=isolate(0x7fbd3e808200), isolate=isolate(0x7fbd3e80e000)
[        ] [        ] isolate_instructions=0, vm_instructions=0
[        ] [        ]   pc 0x0000000102f1cb4e fp 0x000000030a8b25b0 dart::Serializer::RecordDeferredCode(dart::CodePtr)+0x3e
[        ] [        ]   pc 0x0000000102f2d018 fp 0x000000030a8b2610 dart::CodeSerializationCluster::Trace(dart::Serializer*, dart::ObjectPtr)+0x78
[        ] [        ]   pc 0x0000000102f1eb61 fp 0x000000030a8b26c0 dart::Serializer::Serialize(dart::SerializationRoots*)+0x1a1
[        ] [        ]   pc 0x0000000102f2232a fp 0x000000030a8b2920 dart::FullSnapshotWriter::WriteProgramSnapshot(dart::ZoneGrowableArray<dart::Object*>*,
dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0xda
[        ] [        ]   pc 0x0000000102f228b7 fp 0x000000030a8b2950
dart::FullSnapshotWriter::WriteFullSnapshot(dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0x47
[        ] [        ]   pc 0x0000000103325da2 fp 0x000000030a8b2c50 dart::CreateAppAOTSnapshot(void (*)(void*, unsigned char const*, long), void*, bool,
bool, void*, dart::GrowableArray<dart::LoadingUnitSerializationData*>*, dart::LoadingUnitSerializationData*, unsigned int)+0x412
[        ] [        ]   pc 0x00000001033264df fp 0x000000030a8b2d30 dart::Split(void (*)(void*, long, void**, void**), void*, bool, bool, void (*)(void*,
unsigned char const*, long), void (*)(void*))+0x39f
[        ] [        ]   pc 0x0000000103326ce1 fp 0x000000030a8b2e00 Dart_CreateAppAOTSnapshotAsElfs+0x131
[        ] [        ]   pc 0x0000000102ec7702 fp 0x000000030a8b2fa0 dart::bin::main(int, char**)+0xf22
[        ] [        ]   pc 0x000000020393f51e fp 0x000000030a8b30b0 Unknown symbol
[        ] [        ] -- End of DumpStackTrace
[        ] [   +1 ms] Dart snapshot generator failed with exit code -6
[ +797 ms] [ +864 ms] ===== CRASH =====
[        ] [        ] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x4e5a0000000f
[        ] [        ] version=2.17.0-251.0.dev (dev) (Tue Mar 29 00:56:13 2022 -0700) on "macos_x64"
[        ] [        ] pid=36348, thread=-1, isolate_group=isolate(0x7fc59e808200), isolate=isolate(0x7fc59e80e000)
[        ] [        ] isolate_instructions=0, vm_instructions=0
[        ] [        ]   pc 0x00000001006189cd fp 0x00000003056395f0 dart::Serializer::RecordDeferredCode(dart::CodePtr)+0x4d
[        ] [        ]   pc 0x0000000100628506 fp 0x0000000305639650 dart::CodeSerializationCluster::Trace(dart::Serializer*, dart::ObjectPtr)+0x76
[        ] [        ]   pc 0x000000010061a820 fp 0x0000000305639700 dart::Serializer::Serialize(dart::SerializationRoots*)+0x1a0
[        ] [        ]   pc 0x000000010061e03a fp 0x0000000305639960 dart::FullSnapshotWriter::WriteProgramSnapshot(dart::ZoneGrowableArray<dart::Object*>*,
dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0xda
[        ] [        ]   pc 0x000000010061e5c7 fp 0x0000000305639990
dart::FullSnapshotWriter::WriteFullSnapshot(dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0x47
[        ] [        ]   pc 0x0000000100a36602 fp 0x0000000305639c90 dart::CreateAppAOTSnapshot(void (*)(void*, unsigned char const*, long), void*, bool,
bool, void*, dart::GrowableArray<dart::LoadingUnitSerializationData*>*, dart::LoadingUnitSerializationData*, unsigned int)+0x412
[        ] [        ]   pc 0x0000000100a36d3a fp 0x0000000305639d70 dart::Split(void (*)(void*, long, void**, void**), void*, bool, bool, void (*)(void*,
unsigned char const*, long), void (*)(void*))+0x39a
[        ] [        ]   pc 0x0000000100a374f1 fp 0x0000000305639e40 Dart_CreateAppAOTSnapshotAsElfs+0x131
[   +1 ms] [        ]   pc 0x00000001005c20e2 fp 0x0000000305639fe0 dart::bin::main(int, char**)+0xf22
[        ] [        ]   pc 0x0000000200fca51e fp 0x000000030563a0f0 Unknown symbol
[        ] [        ] -- End of DumpStackTrace
[        ] [        ] Dart snapshot generator failed with exit code -6
[ +197 ms] [ +147 ms] ===== CRASH =====
[        ] [        ] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x90b257388
[        ] [        ] version=2.17.0-251.0.dev (dev) (Tue Mar 29 00:56:13 2022 -0700) on "macos_simarm64"
[        ] [        ] pid=36347, thread=-1, isolate_group=isolate(0x7f90ff008200), isolate=isolate(0x7f90ff00e000)
[        ] [        ] isolate_instructions=0, vm_instructions=0
[        ] [   +1 ms]   pc 0x0000000100f19c56 fp 0x0000000306a385f0 dart::Serializer::RecordDeferredCode(dart::CodePtr)+0x156
[        ] [        ]   pc 0x0000000100f29686 fp 0x0000000306a38650 dart::CodeSerializationCluster::Trace(dart::Serializer*, dart::ObjectPtr)+0x76
[        ] [        ]   pc 0x0000000100f1b9a0 fp 0x0000000306a38700 dart::Serializer::Serialize(dart::SerializationRoots*)+0x1a0
[        ] [        ]   pc 0x0000000100f1f1ba fp 0x0000000306a38960 dart::FullSnapshotWriter::WriteProgramSnapshot(dart::ZoneGrowableArray<dart::Object*>*,
dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0xda
[        ] [        ]   pc 0x0000000100f1f747 fp 0x0000000306a38990
dart::FullSnapshotWriter::WriteFullSnapshot(dart::GrowableArray<dart::LoadingUnitSerializationData*>*)+0x47
[        ] [        ]   pc 0x000000010133c0c2 fp 0x0000000306a38c90 dart::CreateAppAOTSnapshot(void (*)(void*, unsigned char const*, long), void*, bool,
bool, void*, dart::GrowableArray<dart::LoadingUnitSerializationData*>*, dart::LoadingUnitSerializationData*, unsigned int)+0x412
[        ] [        ]   pc 0x000000010133c7fa fp 0x0000000306a38d70 dart::Split(void (*)(void*, long, void**, void**), void*, bool, bool, void (*)(void*,
unsigned char const*, long), void (*)(void*))+0x39a
[        ] [        ]   pc 0x000000010133cfb1 fp 0x0000000306a38e40 Dart_CreateAppAOTSnapshotAsElfs+0x131
[        ] [        ]   pc 0x0000000100ec3062 fp 0x0000000306a38fe0 dart::bin::main(int, char**)+0xf22
[        ] [        ]   pc 0x0000000201aca51e fp 0x0000000306a390f0 Unknown symbol
[        ] [        ] -- End of DumpStackTrace
[        ] [        ] Dart snapshot generator failed with exit code -6
[        ] [        ] Persisting file store
[        ] [   +9 ms] Done persisting file store
[  +98 ms] [  +72 ms] Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -6

@Smoovsky
Copy link

Same here, no problem with apk release, but for appbundle, build will fail without --no-deferred-components flag.
The slight difference is that I'm getting a different exit code:
Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073741819

@mraleph
Copy link
Member

mraleph commented Jun 8, 2022

/cc @a-siva seems like deferred components are broken for a while?

@lawangle
Copy link

Same here. Flutter tools is v3.0.2. Gallery branch is master. Run 'flutter build appbundle --verbose' and report the same error.

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jun 23, 2022
…aries when partitioning the program into loading units.

If a library contained an entry point but was not reachable from the root library, it was not assigned to any loading unit and caused a null dereference in gen_snapshot. This is not possible with the standalone embedder, but is possible in Flutter because it passes multiple sources to frontend_server.  E.g., `--source dart_plugin_registrant.dart`.

TEST=gallery
Bug: flutter/gallery#545
Change-Id: I9c67f0e39f7509094ee873610d80851a702a0cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249640
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jun 24, 2022
…ot" libraries when partitioning the program into loading units."

This reverts commit 9c2a91f.

Reason for revert: breaks google3 (b/237016312)

Original change's description:
> Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units.
>
> If a library contained an entry point but was not reachable from the root library, it was not assigned to any loading unit and caused a null dereference in gen_snapshot. This is not possible with the standalone embedder, but is possible in Flutter because it passes multiple sources to frontend_server.  E.g., `--source dart_plugin_registrant.dart`.
>
> TEST=gallery
> Bug: flutter/gallery#545
> Change-Id: I9c67f0e39f7509094ee873610d80851a702a0cf2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249640
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com

Change-Id: I3e17bf29b8f29e4797abfca35fa82b9ca3b5a160
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: flutter/gallery#545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249681
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jun 27, 2022
…oot" libraries when partitioning the program into loading units."

Weaken assertion in gen_snapshot requiring all libraries to have a loading unit as there can still be unreachable libraries:
  - Google3 and Fuchsia will compile all the sources in a package to a single dill file, then present multiple input dill files to the AOT compilation. Since the set of libraries was derived from package membership instead of imports, many can be unreachable.
  - When the root library's main comes from an export, the frontend's representation will incorrectly report the library containing main as the root library and the true root library may be unreachable from it.

Instead, assert only that surviving compiled code is assigned a loading unit.

TEST=gallery
Bug: flutter/gallery#545
Bug: #49325
Bug: #41974
Bug: b/237016312
Change-Id: Ia52563a6f517308d041368be11dcc85270f19acc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249724
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
@wtwsky
Copy link

wtwsky commented Jun 28, 2022

Me too!!! Run 'flutter build appbundle --verbose' and report the same error.
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1396, on macOS 11.6 20G165 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.68.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jun 30, 2022
Cf. 4c82eb5

TEST=gallery
Bug: flutter/gallery#545
Change-Id: I90935aba3737f7b6873368e5a8ebf1cc48d34a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250320
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
@enricoi
Copy link

enricoi commented Jul 2, 2022

Same problem. flutter build appbundle fail only with deferred components

Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-arm, locale it-IT)
✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.68.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P1 Priority 1 - Must have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants