dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.24k stars 1.57k forks source link

build_web_compilers|ddc on test/httpserver_test.dartdevc.module: Error compiling dartdevc module:httpserver|test/httpserver_test.ddc.js #35195

Open ResourceHog opened 5 years ago

ResourceHog commented 5 years ago

extract tutorial code from https://www.dartlang.org/tutorials/dart-vm/httpserver run dart note_server.dart add build_runner: andbuild_web_compilers: to dependencies pub install pub upgrade

dart --version
Dart VM version: 2.0.0 (Fri Aug 3 10:53:23 2018 +0200) on "windows_x64"

after webdev serve

webdev serve 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 arguments: --dart-sdk=C:\tools\dart-sdk --dart-sdk-summary=C:\tools\dart-sdk/lib/_internal/ddc_sdk.sum --modules=amd -o C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\test/httpserver_test.ddc.js --module-root=. --library-root=/test --summary-extension=dartdevc.linked.sum --no-summarize --options=C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/build_modules/src/analysis_options.default.yaml --source-map --source-map-comment --inline-source-map -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/number_thinker.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/number_guesser.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/mini_file_server.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/hello_world_server_secure.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/hello_world_server.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/basic_writer_server.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/basic_writer_client.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/mime/mime.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/path/path.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/http_server/http_server.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\bin/basic_file_server.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/meta/meta.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/stack_trace/stack_trace.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/matcher/src/core_matchers.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/matcher/matcher.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/utils.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/algorithms.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/canonicalized_map.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/comparators.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/iterable_zip.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/src/priority_queue.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/collection/collection.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/async/async.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/stream_channel/stream_channel.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/charcode/ascii.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/charcode/html_entity.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/charcode/charcode.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/source_span/source_span.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/string_scanner/string_scanner.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/term_glyph/term_glyph.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/boolean_selector/boolean_selector.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/test_api/test_api.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/pool/pool.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/test_api/src/util/iterable_set.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/test_core/test_core.dartdevc.linked.sum -s C:\Users\Riversong\AppData\Local\Temp\scratch_spacec2bff965-e9c8-11e8-a901-9cb6d0e1e4da\packages/test/test.dartdevc.linked.sum --url-mapping=file:///test/httpserver_test.dart,test/httpserver_test.dart file:///test/httpserver_test.dart dart --version: 2.0.0 (Fri Aug 3 10:53:23 2018 +0200) on "windows_x64"

Invalid library root. C:\test\ does not contain \bin\hello_world_server.dart
#0      jsLibraryName (package:dev_compiler/src/analyzer/code_generator.dart:6384:5)
#1      CodeGenerator.emitLibraryName.<anonymous closure> (package:dev_compiler/src/analyzer/code_generator.dart:6151:34)#2      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:277:23)
#3      CodeGenerator.emitLibraryName (package:dev_compiler/src/analyzer/code_generator.dart:6150:18)
#4      CodeGenerator._emitTopLevelNameNoInterop (package:dev_compiler/src/analyzer/code_generator.dart:3345:9)
#5      CodeGenerator._emitTopLevelName (package:dev_compiler/src/analyzer/code_generator.dart:3339:33)
#6      CodeGenerator._emitLibraryMemberElement (package:dev_compiler/src/analyzer/code_generator.dart:3040:18)
#7      CodeGenerator._emitSimpleIdentifier (package:dev_compiler/src/analyzer/code_generator.dart:3023:14)
#8      CodeGenerator.visitSimpleIdentifier (package:dev_compiler/src/analyzer/code_generator.dart:2967:20)
#9      SimpleIdentifierImpl.accept (package:analyzer/src/dart/ast/ast.dart:9583:49)
#10     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#11     CodeGenerator._emitFunctionCall (package:dev_compiler/src/analyzer/code_generator.dart:3871:14)
#12     CodeGenerator.visitMethodInvocation (package:dev_compiler/src/analyzer/code_generator.dart:3624:14)
#13     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7827:49)
#14     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#15     MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#16     ListIterable.toList (dart:_internal/iterable.dart:219:19)
#17     CodeGenerator._visitExpressionList (package:dev_compiler/src/analyzer/code_generator.dart:5824:42)
#18     CodeGenerator.visitListLiteral (package:dev_compiler/src/analyzer/code_generator.dart:5691:37)
#19     ListLiteralImpl.accept (package:analyzer/src/dart/ast/ast.dart:7319:49)
#20     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#21     CodeGenerator._emitArgumentList (package:dev_compiler/src/analyzer/code_generator.dart:4041:18)
#22     CodeGenerator._emitMethodCall (package:dev_compiler/src/analyzer/code_generator.dart:3720:16)
#23     CodeGenerator.visitMethodInvocation (package:dev_compiler/src/analyzer/code_generator.dart:3633:12)
#24     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7827:49)
#25     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#26     CodeGenerator.visitExpressionFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:3569:22)
#27     ExpressionFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:4106:15)
#28     CodeGenerator._emitFunctionScopedBody (package:dev_compiler/src/analyzer/code_generator.dart:2810:22)
#29     CodeGenerator._emitFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:2793:17)
#30     CodeGenerator._emitFunction (package:dev_compiler/src/analyzer/code_generator.dart:2777:11)
#31     CodeGenerator._emitArrowFunction (package:dev_compiler/src/analyzer/code_generator.dart:2735:13)
#32     CodeGenerator.visitFunctionExpression (package:dev_compiler/src/analyzer/code_generator.dart:2728:14)
#33     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5436:49)
#34     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#35     CodeGenerator._emitArgumentList (package:dev_compiler/src/analyzer/code_generator.dart:4041:18)
#36     CodeGenerator._emitFunctionCall (package:dev_compiler/src/analyzer/code_generator.dart:3869:16)
#37     CodeGenerator.visitMethodInvocation (package:dev_compiler/src/analyzer/code_generator.dart:3624:14)
#38     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7827:49)
#39     CodeGenerator.visitExpressionStatement (package:dev_compiler/src/analyzer/code_generator.dart:4087:23)
#40     ExpressionStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:4323:49)
#41     CodeGenerator._visitStatement (package:dev_compiler/src/analyzer/code_generator.dart:5812:18)
#42     MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#43     ListIterable.toList (dart:_internal/iterable.dart:219:19)
#44     CodeGenerator._visitStatementList (package:dev_compiler/src/analyzer/code_generator.dart:5819:41)
#45     CodeGenerator.visitBlockFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:3577:21)
#46     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1294:49)
#47     CodeGenerator._emitFunctionScopedBody (package:dev_compiler/src/analyzer/code_generator.dart:2810:22)
#48     CodeGenerator._emitFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:2793:17)
#49     CodeGenerator._emitFunction (package:dev_compiler/src/analyzer/code_generator.dart:2777:11)
#50     CodeGenerator._emitArrowFunction (package:dev_compiler/src/analyzer/code_generator.dart:2735:13)
#51     CodeGenerator.visitFunctionExpression (package:dev_compiler/src/analyzer/code_generator.dart:2728:14)
#52     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5436:49)
#53     CodeGenerator._visitExpression (package:dev_compiler/src/analyzer/code_generator.dart:5803:18)
#54     CodeGenerator._emitArgumentList (package:dev_compiler/src/analyzer/code_generator.dart:4041:18)
#55     CodeGenerator._emitFunctionCall (package:dev_compiler/src/analyzer/code_generator.dart:3869:16)
#56     CodeGenerator.visitMethodInvocation (package:dev_compiler/src/analyzer/code_generator.dart:3624:14)
#57     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7827:49)
#58     CodeGenerator.visitExpressionStatement (package:dev_compiler/src/analyzer/code_generator.dart:4087:23)
#59     ExpressionStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:4323:49)
#60     CodeGenerator._visitStatement (package:dev_compiler/src/analyzer/code_generator.dart:5812:18)
#61     MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#62     ListIterable.toList (dart:_internal/iterable.dart:219:19)
#63     CodeGenerator._visitStatementList (package:dev_compiler/src/analyzer/code_generator.dart:5819:41)
#64     CodeGenerator.visitBlockFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:3577:21)
#65     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1294:49)
#66     CodeGenerator._emitFunctionScopedBody (package:dev_compiler/src/analyzer/code_generator.dart:2810:22)
#67     CodeGenerator._emitFunctionBody (package:dev_compiler/src/analyzer/code_generator.dart:2793:17)
#68     CodeGenerator._emitFunction (package:dev_compiler/src/analyzer/code_generator.dart:2777:11)
#69     CodeGenerator._emitFunctionExpression (package:dev_compiler/src/analyzer/code_generator.dart:2760:12)
#70     CodeGenerator.visitFunctionDeclaration (package:dev_compiler/src/analyzer/code_generator.dart:2638:14)
#71     FunctionDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:5279:49)
#72     CodeGenerator.visitCompilationUnit (package:dev_compiler/src/analyzer/code_generator.dart:683:30)
#73     List.forEach (dart:core/runtime/libarray.dart:79:8)
#74     CodeGenerator._emitModule (package:dev_compiler/src/analyzer/code_generator.dart:418:22)
#75     CodeGenerator.compile (package:dev_compiler/src/analyzer/code_generator.dart:269:20)
#76     ModuleCompiler.compile (package:dev_compiler/src/analyzer/module_compiler.dart:201:26)
#77     _compile (package:dev_compiler/src/analyzer/command.dart:185:25)
#78     compile (package:dev_compiler/src/analyzer/command.dart:57:5)
#79     _CompilerWorker.performRequest (file:///E:/b/build/slave/dart-sdk-windows-stable/build/sdk/pkg/dev_compiler/bin/dartdevc.dart:43:20)
<asynchronous suspension>
#80     AsyncWorkerLoop.run.<anonymous closure> (package:bazel_worker/src/worker/async_worker_loop.dart:33:41)
#81     _rootRun (dart:async/zone.dart:1124:13)
#82     _CustomZone.run (dart:async/zone.dart:1021:19)
#83     _runZoned (dart:async/zone.dart:1516:10)
#84     runZoned (dart:async/zone.dart:1463:12)
#85     AsyncWorkerLoop.run (package:bazel_worker/src/worker/async_worker_loop.dart:33:26)
<asynchronous suspension>
#86     main (file:///E:/b/build/slave/dart-sdk-windows-stable/build/sdk/pkg/dev_compiler/bin/dartdevc.dart:23:64)
<asynchronous suspension>
#87     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:277:32)
#88     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

}

It seems to me that the compiler is looking for a global directory test folder instead of a local one.

vsmenon commented 5 years ago

This may be a package:build issue, but DDC should be giving a nicer error.