Skip to content
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

The compiler is broken #59870

Open
ac-arconomy opened this issue Jan 9, 2025 · 2 comments
Open

The compiler is broken #59870

ac-arconomy opened this issue Jan 9, 2025 · 2 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-crashes Crashes in the CFE triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@ac-arconomy
Copy link

ac-arconomy commented Jan 9, 2025

Trying to build flutter web application in Docker.

Using Docker image from https://github.com/cirruslabs/docker-images-flutter/pkgs/container/flutter

Flutter 3.27.1

FROM ghcr.io/cirruslabs/flutter:stable

10.86 The compiler crashed: Crash when compiling:
10.86 RangeError (length): Invalid value: Only valid value is 0: 1
10.86 
10.86 #0      List.[] (dart:core-patch/growable_array.dart)
10.86 #1      Class._computeOnClause (package:kernel/src/ast/declarations.dart:208:73)
10.86 #2      Class.onClause (package:kernel/src/ast/declarations.dart:191:49)
10.86 #3      _FieldPromotability.getSuperclasses (package:front_end/src/source/source_library_builder.dart:2433:44)
10.86 #4      _InterfaceNode.computeDependencies (package:_fe_analyzer_shared/src/field_promotability.dart:400:49)
10.86 #5      Node.getDependencies (package:_fe_analyzer_shared/src/util/dependency_walker.dart:150:40)
10.86 #6      DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:55:40)
10.86 #7      DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #8      DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #9      DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #10     DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #11     DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #12     DependencyWalker.walk.strongConnect (package:_fe_analyzer_shared/src/util/dependency_walker.dart:68:11)
10.86 #13     DependencyWalker.walk (package:_fe_analyzer_shared/src/util/dependency_walker.dart:121:5)
10.86 #14     FieldPromotability.computeNonPromotabilityInfo (package:_fe_analyzer_shared/src/field_promotability.dart:277:23)
10.86 #15     SourceLibraryBuilder.computeFieldPromotability (package:front_end/src/source/source_library_builder.dart:1054:43)
10.86 #16     SourceLoader.computeFieldPromotability (package:front_end/src/source/source_loader.dart:2823:17)
10.86 #17     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/kernel/kernel_target.dart:643:14)
10.86 <asynchronous suspension>
10.86 #18     withCrashReporting (package:front_end/src/base/crash.dart:138:12)
10.86 <asynchronous suspension>
10.86 #19     KernelTarget.buildOutlines (package:front_end/src/kernel/kernel_target.dart:487:12)
10.86 <asynchronous suspension>
10.86 #20     _buildInternal (package:front_end/src/kernel_generator_impl.dart:175:7)
10.86 <asynchronous suspension>
10.86 #21     withCrashReporting (package:front_end/src/base/crash.dart:138:12)
10.86 <asynchronous suspension>
10.86 #22     compile.<anonymous closure> (package:front_end/src/api_unstable/dart2js.dart:166:37)
10.86 <asynchronous suspension>
10.86 #23     CompilerContext.clear (package:front_end/src/base/compiler_context.dart:79:3)
10.86 <asynchronous suspension>
10.86 #24     compile (package:front_end/src/api_unstable/dart2js.dart:164:36)
10.86 <asynchronous suspension>
10.86 #25     _loadFromSource (package:compiler/src/phase/load_kernel.dart:318:29)
10.86 <asynchronous suspension>
10.86 #26     run (package:compiler/src/phase/load_kernel.dart:412:36)
10.86 <asynchronous suspension>
10.86 #27     Compiler.loadKernel (package:compiler/src/compiler.dart:393:9)
10.86 <asynchronous suspension>
10.86 #28     Compiler.produceKernel (package:compiler/src/compiler.dart:400:36)
10.86 <asynchronous suspension>
10.86 #29     Compiler.runSequentialPhases (package:compiler/src/compiler.dart:634:20)
10.86 <asynchronous suspension>
10.86 #30     Compiler.runInternal.<anonymous closure> (package:compiler/src/compiler.dart:317:7)
10.86 <asynchronous suspension>
10.86 #31     Compiler.runInternal (package:compiler/src/compiler.dart:316:5)
10.86 <asynchronous suspension>
10.86 #32     Compiler.run.<anonymous closure> (package:compiler/src/compiler.dart:237:11)
10.86 <asynchronous suspension>
10.86 #33     compile.<anonymous closure> (package:compiler/compiler_api.dart:257:30)
10.86 <asynchronous suspension>
10.86 #34     compile.compilationDone (package:compiler/src/dart2js.dart:723:3)
10.86 <asynchronous suspension>
10.86 #35     main (package:compiler/src/dart2js.dart:1226:3)
10.86 <asynchronous suspension>
10.86   Command: /sdks/flutter/bin/cache/dart-sdk/bin/dart /sdks/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot --platform-binaries=/sdks/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/cb4b5fff73850b2e42bd4de7cb9a4310a78ac40d/ --native-null-assertions --no-source-maps -o /home/flutteruser/app/.dart_tool/flutter_build/8709deb7242c0c703cfa5d7d7b5e7122/app.dill --packages=/home/flutteruser/app/.dart_tool/package_config.json --cfe-only /home/flutteruser/app/.dart_tool/flutter_build/8709deb7242c0c703cfa5d7d7b5e7122/main.dart
10.86 #0      RunResult.throwException (package:flutter_tools/src/base/process.dart:122:5)
10.86 #1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:389:19)
10.86 <asynchronous suspension>
10.86 #2      Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:202:5)
10.86 <asynchronous suspension>
10.86 #3      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:891:9)
10.86 <asynchronous suspension>
10.86 #4      Future.wait.<anonymous closure> (dart:async/future.dart:520:21)
10.86 <asynchronous suspension>
10.86 #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32)
10.86 <asynchronous suspension>
10.86 #6      Future.wait.<anonymous closure> (dart:async/future.dart:520:21)
10.86 <asynchronous suspension>
10.86 #7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:829:32)
10.86 <asynchronous suspension>
10.86 #8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:651:16)
10.86 <asynchronous suspension>
10.86 #9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:92:34)
10.86 <asynchronous suspension>
10.86 #10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:233:5)
10.86 <asynchronous suspension>
10.86 #11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1450:27)
10.86 <asynchronous suspension>
10.86 #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
10.86 <asynchronous suspension>
10.86 #13     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
10.86 <asynchronous suspension>
10.86 #14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9)
10.86 <asynchronous suspension>
10.86 #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
10.86 <asynchronous suspension>
10.86 #16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
10.86 <asynchronous suspension>
10.86 #17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:131:9)
10.86 <asynchronous suspension>
10.86 #18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
10.86 <asynchronous suspension>
10.86 #19     main (package:flutter_tools/executable.dart:94:3)
10.86 <asynchronous suspension>
10.86 
10.86 Compiling lib/main.dart for the Web...                           1,279ms
10.87 Error: Failed to compile application for the Web.
------
Dockerfile:40
--------------------
  38 |     
  39 |     # Build app using cached dependencies
  40 | >>> RUN flutter build web
  41 |     
  42 |     # Final Image with Flutter Web App served by a GoLang Web Server
--------------------
ERROR: failed to solve: process "/bin/sh -c flutter build web" did not complete successfully: exit code: 1
@dart-github-bot
Copy link
Collaborator

Summary: Flutter web build in Docker fails with a Dart compiler crash due to a RangeError. The error originates in the kernel package.

@dart-github-bot dart-github-bot added area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 9, 2025
@biggs0125 biggs0125 added area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jan 9, 2025
@johnniwinther johnniwinther added the cfe-crashes Crashes in the CFE label Jan 9, 2025
@johnniwinther
Copy link
Member

@jensjoha Can you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-crashes Crashes in the CFE triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants