Closed saibotma closed 5 years ago
I also hit this issue on Dart 2.3.2-dev.0.1
. The same file compiles successfully on 2.3.1 when using build_web_compilers 1.x (i.e. not the kernel-based DDC).
Edit: added a caveat about the env where compilation succeeds.
https://github.com/dart-lang/sdk/issues/36912 was blocking us from upgrading to build_web_compilers 2.x and the kernel-based DDC, but that is now fixed in the latest dev branch. Unfortunately if there isn't a workaround for this issue, then we will still be blocked from upgrading even with the Dart 2.4 release. Any one know if there is a workaround or if a fix for this is known/in progress?
@jakemac53 @vsmenon @kmillikin
Thanks for the ping, I hadn't seen this bug or heard anybody else mention it so I think it slipped through the cracks. We can take a look.
cc @nshahan
@evanweible-wf Which versions of angular and angular_components are you using?
@nshahan I'm actually see this trying to run pub run build_runner build
in one of our private packages. I can try to provide some source code via email if that would help? I'm not sure if you just need the single file that DDC is failing on or if you'd need all the imported code as well.
@evanweible-wf The stack trace looks like it's failing while compiling a file from the angular_components package so I'm guessing your private package has a dependency on it?
If so I'm trying to figure out what versions of angular_components and angular you are using. Could you find it by running pub deps -s compact
.
Sorry, I should have posted my own stack trace:
[SEVERE] build_web_compilers:ddc on package:w_virtual_components/src/item_size_collection.ddc.module:
Error compiling dartdevc module:w_virtual_components|lib/src/item_size_collection.ddc.js
We're sorry, you've found a bug in our compiler.
You can report this bug at:
https://github.com/dart-lang/sdk/issues/labels/area-dev-compiler
Please include the information below in your report, along with
any other information that may help us track it down. Thanks!
-------------------- %< --------------------
dartdevc -k arguments: --dart-sdk-summary=/usr/local/Cellar/dart/2.3.2-dev.0.1/libexec/lib/_internal/ddc_sdk.dill --modules=amd --no-summarize -o packages/w_virtual_components/src/item_size_collection.ddc.js --source-map -s packages/dart2_constant/math.ddc.dill=packages/dart2_constant/math -s packages/js/js.ddc.dill=packages/js/js -s packages/react/react_client/js_interop_helpers.ddc.dill=packages/react/react_client/js_interop_helpers -s packages/react/react_dom_server.ddc.dill=packages/react/react_dom_server -s packages/meta/meta.ddc.dill=packages/meta/meta -s packages/react/react.ddc.dill=packages/react/react -s packages/react/react_dom.ddc.dill=packages/react/react_dom -s packages/react/react_client/react_interop.ddc.dill=packages/react/react_client/react_interop -s packages/react/src/ddc_emulated_function_name_bug.ddc.dill=packages/react/src/ddc_emulated_function_name_bug -s packages/react/react_client.ddc.dill=packages/react/react_client -s packages/collection/src/utils.ddc.dill=packages/collection/src/utils -s packages/collection/src/algorithms.ddc.dill=packages/collection/src/algorithms -s packages/collection/src/iterable_zip.ddc.dill=packages/collection/src/iterable_zip -s packages/collection/src/comparators.ddc.dill=packages/collection/src/comparators -s packages/collection/src/priority_queue.ddc.dill=packages/collection/src/priority_queue -s packages/collection/src/canonicalized_map.ddc.dill=packages/collection/src/canonicalized_map -s packages/collection/collection.ddc.dill=packages/collection/collection -s packages/pub_semver/pub_semver.ddc.dill=packages/pub_semver/pub_semver -s packages/platform_detect/src/browser.ddc.dill=packages/platform_detect/src/browser -s packages/platform_detect/platform_detect.ddc.dill=packages/platform_detect/platform_detect -s packages/rxdart/src/samplers/buffer_strategy.ddc.dill=packages/rxdart/src/samplers/buffer_strategy -s packages/rxdart/src/transformers/buffer.ddc.dill=packages/rxdart/src/transformers/buffer -s packages/rxdart/transformers.ddc.dill=packages/rxdart/transformers -s packages/rxdart/samplers.ddc.dill=packages/rxdart/samplers -s packages/rxdart/src/streams/amb.ddc.dill=packages/rxdart/src/streams/amb -s packages/rxdart/streams.ddc.dill=packages/rxdart/streams -s packages/rxdart/futures.ddc.dill=packages/rxdart/futures -s packages/logging/logging.ddc.dill=packages/logging/logging -s packages/w_common/src/common/disposable.ddc.dill=packages/w_common/src/common/disposable -s packages/w_common/disposable.ddc.dill=packages/w_common/disposable -s packages/w_flux/src/action.ddc.dill=packages/w_flux/src/action -s packages/w_flux/src/component_client.ddc.dill=packages/w_flux/src/component_client -s packages/quiver/core.ddc.dill=packages/quiver/core -s packages/over_react/src/component/dummy_component.ddc.dill=packages/over_react/src/component/dummy_component -s packages/over_react/src/component_declaration/annotations.ddc.dill=packages/over_react/src/component_declaration/annotations -s packages/built_value/built_value.ddc.dill=packages/built_value/built_value -s packages/quiver/iterables.ddc.dill=packages/quiver/iterables -s packages/quiver/collection.ddc.dill=packages/quiver/collection -s packages/built_collection/built_collection.ddc.dill=packages/built_collection/built_collection -s packages/built_redux/src/action.ddc.dill=packages/built_redux/src/action -s packages/built_redux/built_redux.ddc.dill=packages/built_redux/built_redux -s packages/over_react/component_base.ddc.dill=packages/over_react/component_base -s packages/focus/focus.ddc.dill=packages/focus/focus --packages file:///var/folders/lp/11mtc2k10tb70x332n6cfgt00000gn/T/kernel_builder_wr0ue7/.packages --module-name packages/w_virtual_components/src/item_size_collection --multi-root-scheme org-dartlang-app --multi-root . --track-widget-creation --inline-source-map package:w_virtual_components/src/size.dart package:w_virtual_components/src/value_range.dart package:w_virtual_components/src/typedefs.dart package:w_virtual_components/src/util/hasher.dart package:w_virtual_components/src/virtual_scroll_bars/common.dart package:w_virtual_components/src/virtual_list/floating_item_utils.dart package:w_virtual_components/src/virtual_scroll_bars/virtual_scroll_bars.dart package:w_virtual_components/src/util/tweener.dart package:w_virtual_components/src/virtual_tree/tree_node.dart package:w_virtual_components/src/util/reconciliation_util.dart package:w_virtual_components/src/layouts.dart package:w_virtual_components/src/util/resize_sensor_reset.dart package:w_virtual_components/src/virtual_viewport/virtual_viewport.dart package:w_virtual_components/src/util/browser.dart package:w_virtual_components/src/virtual_list/virtual_list.dart package:w_virtual_components/src/virtual_list/virtual_list.over_react.g.dart package:w_virtual_components/src/util/key.dart package:w_virtual_components/src/virtual_scroll_bars/virtual_scroll_bar.over_react.g.dart package:w_virtual_components/src/virtual_scroll_bars/virtual_scroll_bars.over_react.g.dart package:w_virtual_components/src/item_size_collection.dart package:w_virtual_components/src/virtual_tree/virtual_tree.dart package:w_virtual_components/src/virtual_viewport/virtual_viewport.over_react.g.dart package:w_virtual_components/src/virtual_tree/virtual_tree.over_react.g.dart package:w_virtual_components/w_virtual_components.dart package:w_virtual_components/src/util/position_utils.dart package:w_virtual_components/src/virtual_scroll_bars/virtual_scroll_bar.dart package:w_virtual_components/src/virtual_tree/tree_node_renderer.dart package:w_virtual_components/src/util/item_insulator.dart package:w_virtual_components/src/util/easing_functions.dart package:w_virtual_components/src/util/touch_session.dart package:w_virtual_components/src/util/stream_listener.dart
dart --version: 2.3.2-dev.0.1 (Tue Jun 4 10:56:51 2019 +0200) on "macos_x64"
RangeError: Line may not be negative, was -2.
#0 new SourceLocation (package:source_span/src/location.dart:53:7)
#1 ProgramCompiler._getLocation (package:dev_compiler/src/kernel/compiler.dart:3124:14)
#2 ProgramCompiler._nodeStart (package:dev_compiler/src/kernel/compiler.dart:3092:47)
#3 ProgramCompiler._emitVariableDef (package:dev_compiler/src/kernel/compiler.dart:3779:53)
#4 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#5 ListIterator.moveNext (dart:_internal/iterable.dart:343:26)
#6 new List.from (dart:core-patch/array_patch.dart:33:29)
#7 new List.of (dart:core/list.dart:140:65)
#8 ProgramCompiler._emitParameters (package:dev_compiler/src/kernel/compiler.dart:2710:16)
#9 ProgramCompiler._defineClass.emitMixinConstructors (package:dev_compiler/src/kernel/compiler.dart:726:24)
#10 ProgramCompiler._defineClass (package:dev_compiler/src/kernel/compiler.dart:807:28)
#11 ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:500:5)
#12 ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:447:21)
#13 List.forEach (dart:core-patch/growable_array.dart:278:8)
#14 ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:393:23)
#15 Iterable.forEach (dart:core/iterable.dart:277:30)
#16 ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:299:15)
#17 _compile (package:dev_compiler/src/kernel/command.dart:332:27)
<asynchronous suspension>
#18 compile (package:dev_compiler/src/kernel/command.dart:42:18)
<asynchronous suspension>
#19 compile (package:dev_compiler/src/compiler/shared_command.dart:401:12)
#20 _CompilerWorker.performRequest.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:55:39)
#21 _rootRun (dart:async/zone.dart:1124:13)
#22 _CustomZone.run (dart:async/zone.dart:1021:19)
#23 _runZoned (dart:async/zone.dart:1516:10)
#24 runZoned (dart:async/zone.dart:1463:12)
#25 _CompilerWorker.performRequest (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:55:24)
<asynchronous suspension>
#26 AsyncWorkerLoop.run.<anonymous closure> (package:bazel_worker/src/worker/async_worker_loop.dart:33:41)
#27 _rootRun (dart:async/zone.dart:1124:13)
#28 _CustomZone.run (dart:async/zone.dart:1021:19)
#29 _runZoned (dart:async/zone.dart:1516:10)
#30 runZoned (dart:async/zone.dart:1463:12)
#31 AsyncWorkerLoop.run (package:bazel_worker/src/worker/async_worker_loop.dart:33:26)
<asynchronous suspension>
#32 main (file:///b/s/w/ir/cache/builder/sdk/pkg/dev_compiler/bin/dartdevc.dart:28:57)
<asynchronous suspension>
#33 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:296:32)
#34 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
@nshahan @jakemac53
Looks similar to:
https://github.com/dart-lang/sdk/blame/master/pkg/dev_compiler/lib/src/kernel/compiler.dart#L3127
May need to add RangeError
until we figure out the root cause. Jake landed the above - see comment thread here:
I feel like a fix for this should be part of the D24 release. Do people agree?
I still can't repro this issue. Do you have a repro that uses angular_components and can you provide the version numbers of the packages you are using when you experience this error? I'd like to try and track down the root cause.
We haven't been able to repro, so I can't promise a fix. Looking at the code, it's not clear how it's getting to the failure point.
If you can help us with a small, reliable repro, that would help!
Judging from the stack trace, it looks like a mixin application issue, but I cannot trigger anything from angular_components either. Do you have anything "interesting" in your mixin usage?
Are you on the latest dev SDK / webdev / build_web_compilers?
Working on a repro, interestingly enough extracting just the 3 files that were involved in the item_sizecollection.dart file that fails to compile to their own package doesn't result in the same error, even with the same dart version and build* pkg versions. I have to step out briefly but will keep messing with it in an hour and let you know if I have any luck.
Thanks, @evanweible-wf !
@vsmenon here's the smallest repro I could come up with: https://github.com/evanweible-wf/repro_dart_ddc_range_error
It's somehow related to the package:collection/collection.dart
import even though it's unused 🤷♂
Awesome, I can reproduce it using those instructions.
@jakemac53 I just pushed another commit with slightly smaller repro source.
I sent out https://dart-review.googlesource.com/c/sdk/+/105340 which just swallows the error, from what I understand that is fine to do in this case (although we should figure out the root cause of these problems).
This does resolve the issues in the repro case for me.
Thanks for the quick turnaround @jakemac53! Since this has landed in master does that mean it will make it into the 2.4 release?
Yes, we haven't cut a branch for that yet.
Closing this - @jakemac53 opened this for further investigation / cleanup:
dartdevc -k arguments: --dart-sdk-summary=/usr/local/Cellar/dart/2.3.1-dev.0.0/libexec/lib/_internal/ddc_sdk.dill --modules=amd --no-summarize -o packages/angular_components/material_tab/tab_button.ddc.js --source-map -s packages/meta/meta.ddc.dill=packages/meta/meta -s packages/collection/src/utils.ddc.dill=packages/collection/src/utils -s packages/collection/src/algorithms.ddc.dill=packages/collection/src/algorithms -s packages/collection/src/iterable_zip.ddc.dill=packages/collection/src/iterable_zip -s packages/collection/src/comparators.ddc.dill=packages/collection/src/comparators -s packages/collection/src/priority_queue.ddc.dill=packages/collection/src/priority_queue -s packages/collection/src/canonicalized_map.ddc.dill=packages/collection/src/canonicalized_map -s packages/collection/collection.ddc.dill=packages/collection/collection -s packages/logging/logging.ddc.dill=packages/logging/logging -s packages/path/path.ddc.dill=packages/path/path -s packages/stack_trace/src/chain.ddc.dill=packages/stack_trace/src/chain -s packages/meta/dart2js.ddc.dill=packages/meta/dart2js -s packages/angular/src/core/change_detection/change_detection.ddc.dill=packages/angular/src/core/change_detection/change_detection -s packages/angular/src/core/application_tokens.ddc.dill=packages/angular/src/core/application_tokens -s packages/angular/core.ddc.dill=packages/angular/core -s packages/angular/di.ddc.dill=packages/angular/di -s packages/angular/src/core/change_detection/change_detection.template.ddc.dill=packages/angular/src/core/change_detection/change_detection.template -s packages/angular/di.template.ddc.dill=packages/angular/di.template -s packages/intl/date_symbols.ddc.dill=packages/intl/date_symbols -s packages/intl/number_symbols.ddc.dill=packages/intl/number_symbols -s packages/intl/number_symbols_data.ddc.dill=packages/intl/number_symbols_data -s packages/intl/src/plural_rules.ddc.dill=packages/intl/src/plural_rules -s packages/intl/intl.ddc.dill=packages/intl/intl -s packages/angular/src/core/application_tokens.template.ddc.dill=packages/angular/src/core/application_tokens.template -s packages/angular/core.template.ddc.dill=packages/angular/core.template -s packages/js/js_util.ddc.dill=packages/js/js_util -s packages/js/js.ddc.dill=packages/js/js -s packages/angular/src/bootstrap/modules.ddc.dill=packages/angular/src/bootstrap/modules -s packages/angular/angular.ddc.dill=packages/angular/angular -s packages/angular_components/material_tab/tab_mixin.ddc.dill=packages/angular_components/material_tab/tab_mixin -s packages/angular_components/utils/browser/feature_detector/feature_detector.ddc.dill=packages/angular_components/utils/browser/feature_detector/feature_detector -s packages/angular_components/utils/browser/events/events.ddc.dill=packages/angular_components/utils/browser/events/events -s packages/quiver/core.ddc.dill=packages/quiver/core -s packages/angular_components/utils/color/color.ddc.dill=packages/angular_components/utils/color/color -s packages/angular_components/utils/color/material.ddc.dill=packages/angular_components/utils/color/material -s packages/angular_components/material_ripple/material_ripple.ddc.dill=packages/angular_components/material_ripple/material_ripple -s packages/angular_components/interfaces/has_disabled.ddc.dill=packages/angular_components/interfaces/has_disabled -s packages/quiver/strings.ddc.dill=packages/quiver/strings -s packages/angular_components/utils/angular/properties/properties.ddc.dill=packages/angular_components/utils/angular/properties/properties -s packages/angular_components/mixins/has_tab_index.ddc.dill=packages/angular_components/mixins/has_tab_index -s packages/angular_components/utils/disposer/disposer.ddc.dill=packages/angular_components/utils/disposer/disposer -s packages/angular_components/utils/disposer/disposable_callback.ddc.dill=packages/angular_components/utils/disposer/disposable_callback -s packages/angular_components/utils/rate_limit_utils/rate_limit_utils.ddc.dill=packages/angular_components/utils/rate_limit_utils/rate_limit_utils -s packages/angular_components/src/utils/async/async_update_scheduler.ddc.dill=packages/angular_components/src/utils/async/async_update_scheduler -s packages/angular_components/utils/async/async.ddc.dill=packages/angular_components/utils/async/async -s packages/angular_components/utils/browser/dom_service/dom_service.ddc.dill=packages/angular_components/utils/browser/dom_service/dom_service -s packages/angular_components/src/laminate/enums/base.ddc.dill=packages/angular_components/src/laminate/enums/base -s packages/angular_components/laminate/enums/position.ddc.dill=packages/angular_components/laminate/enums/position -s packages/angular_components/laminate/enums/visibility.ddc.dill=packages/angular_components/laminate/enums/visibility -s packages/angular_components/src/laminate/ruler/ruler_interface.ddc.dill=packages/angular_components/src/laminate/ruler/ruler_interface -s packages/angular_components/laminate/ruler/dom_ruler.ddc.dill=packages/angular_components/laminate/ruler/dom_ruler -s packages/angular_components/focus/focus_interface.ddc.dill=packages/angular_components/focus/focus_interface -s packages/angular_components/annotations/rtl_annotation.ddc.dill=packages/angular_components/annotations/rtl_annotation -s packages/angular_components/laminate/enums/alignment.ddc.dill=packages/angular_components/laminate/enums/alignment -s packages/angular_components/src/laminate/popup/dom_popup_source.ddc.dill=packages/angular_components/src/laminate/popup/dom_popup_source -s packages/angular_components/laminate/overlay/constants.ddc.dill=packages/angular_components/laminate/overlay/constants -s packages/dart_internal/extract_type_arguments.ddc.dill=packages/dart_internal/extract_type_arguments -s packages/observable/observable.ddc.dill=packages/observable/observable -s packages/angular_components/utils/angular/reference/reference.ddc.dill=packages/angular_components/utils/angular/reference/reference -s packages/angular_components/src/laminate/popup/popup_hierarchy.ddc.dill=packages/angular_components/src/laminate/popup/popup_hierarchy -s packages/angular_components/laminate/popup/popup.ddc.dill=packages/angular_components/laminate/popup/popup -s packages/angular_components/content/deferred_content_aware.ddc.dill=packages/angular_components/content/deferred_content_aware -s packages/angular_components/utils/angular/imperative_view/imperative_view.ddc.dill=packages/angular_components/utils/angular/imperative_view/imperative_view -s packages/angular_components/laminate/portal/portal.ddc.dill=packages/angular_components/laminate/portal/portal -s packages/angular_components/laminate/overlay/zindexer.ddc.dill=packages/angular_components/laminate/overlay/zindexer -s packages/angular_components/src/laminate/overlay/overlay_ref.ddc.dill=packages/angular_components/src/laminate/overlay/overlay_ref -s packages/angular_components/laminate/overlay/overlay.ddc.dill=packages/angular_components/laminate/overlay/overlay -s packages/angular_components/src/laminate/components/modal/modal_controller_directive.ddc.dill=packages/angular_components/src/laminate/components/modal/modal_controller_directive -s packages/angular_components/src/model/action/async_action.ddc.dill=packages/angular_components/src/model/action/async_action -s packages/angular_components/model/action/async_action.ddc.dill=packages/angular_components/model/action/async_action -s packages/angular_components/laminate/components/modal/modal.ddc.dill=packages/angular_components/laminate/components/modal/modal -s packages/angular_components/focus/focus.ddc.dill=packages/angular_components/focus/focus -s packages/angular_components/button_decorator/button_decorator.ddc.dill=packages/angular_components/button_decorator/button_decorator -s packages/angular_components/material_button/material_button_base.ddc.dill=packages/angular_components/material_button/material_button_base --packages file:///var/folders/lm/0wp_1hxn7mj5gybk477hdh300000gn/T/kernel_builder_sfRrEk/.packages --module-name packages/angular_components/material_tab/tab_button --multi-root-scheme org-dartlang-app --multi-root . --track-widget-creation --inline-source-map package:angular_components/material_tab/tab_button.dart dart --version: 2.3.1-dev.0.0 (Wed May 8 14:36:43 2019 +0200) on "macos_x64"
RangeError: Line may not be negative, was -2.
0 new SourceLocation (package:source_span/src/location.dart:53:7)
1 ProgramCompiler._getLocation (package:dev_compiler/src/kernel/compiler.dart:3113:14)
2 ProgramCompiler._nodeStart (package:dev_compiler/src/kernel/compiler.dart:3081:47)
3 ProgramCompiler._emitVariableDef (package:dev_compiler/src/kernel/compiler.dart:3750:53)
4 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
5 ListIterator.moveNext (dart:_internal/iterable.dart:343:26)
6 new List.from (dart:core-patch/array_patch.dart:52:19)
7 ProgramCompiler._emitParameters (package:dev_compiler/src/kernel/compiler.dart:2701:16)
8 ProgramCompiler._defineClass.emitMixinConstructors (package:dev_compiler/src/kernel/compiler.dart:724:24)
9 ProgramCompiler._defineClass (package:dev_compiler/src/kernel/compiler.dart:805:28)
10 ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:499:5)
11 ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:446:21)
12 List.forEach (dart:core-patch/growable_array.dart:278:8)
13 ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:392:23)
14 Iterable.forEach (dart:core/iterable.dart:277:30)
15 ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:298:15)
16 _compile (package:dev_compiler/src/kernel/command.dart:333:27)