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.25k stars 1.58k forks source link

Error: Input file not found: clang_x64/dart2js_platform.dill. #41110

Closed liudonghua123 closed 4 years ago

liudonghua123 commented 4 years ago

I followed the instructions on https://github.com/dart-lang/sdk/wiki/Building-Dart-SDK-for-ARM-processors and https://github.com/dart-lang/sdk/wiki/Building-Dart-SDK-for-Android, and I after gclient sync, I executed time tools/build.py -a arm,arm64,ia32,x64 -m all --os=android create_sdk | tee log.txt.

But in the end, I got the following errors:

[3961/4014] STAMP obj/utils/dartanalyzer/generate_dartanalyzer_snapshot.stamp
[3962/4014] COPY gen/dartanalyzer.dart.snapshot dart-sdk/bin/snapshots/dartanalyzer.dart.snapshot
[3963/4014] STAMP obj/sdk/copy_dartanalyzer_snapshot.stamp
[3964/4014] ACTION //utils/compiler:dart2js(//build/toolchain/android:clang_x64)
FAILED: gen/dart2js.dart.snapshot 
python ../../build/gn_run_binary.py compiled_action clang_x64/dart --deterministic --packages=/home/ldh/code/dart/dart-sdk/sdk/.packages --snapshot=gen/dart2js.dart.snapshot --snapshot-depfile=/home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/dart2js.dart.snapshot.d --snapshot-kind=app-jit /home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/utils/compiler/dart2js.dart.dill --packages=/home/ldh/code/dart/dart-sdk/sdk/.packages --libraries-spec=/home/ldh/code/dart/dart-sdk/sdk/sdk/lib/libraries.json /home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/utils/compiler/dart2js.dart
Command failed: ./clang_x64/dart --deterministic --packages=/home/ldh/code/dart/dart-sdk/sdk/.packages --snapshot=gen/dart2js.dart.snapshot --snapshot-depfile=/home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/dart2js.dart.snapshot.d --snapshot-kind=app-jit /home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/utils/compiler/dart2js.dart.dill --packages=/home/ldh/code/dart/dart-sdk/sdk/.packages --libraries-spec=/home/ldh/code/dart/dart-sdk/sdk/sdk/lib/libraries.json /home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/utils/compiler/dart2js.dart
output: Error: Input file not found: clang_x64/dart2js_platform.dill.
Error: Error when reading 'clang_x64/dart2js_platform.dill': Error reading 'clang_x64/dart2js_platform.dill'  (No such file or directory)
gen/utils/compiler/dart2js.dart:
Internal Error: The compiler crashed when compiling this element.

The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (2.8.0-edge.afbce123fa6e6c15bbdb67b94b3b310882d45ebf), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

The compiler crashed: Crash when compiling file:///home/ldh/code/dart/dart-sdk/sdk/out/DebugAndroidX64/gen/utils/compiler/dart2js.dart,
at character offset null:
Bad state: Empty input given.
#0      BinaryBuilder._checkEmptyInput (package:kernel/binary/ast_from_binary.dart:434:29)
#1      BinaryBuilder.readComponent.<anonymous closure> (package:kernel/binary/ast_from_binary.dart:451:7)
#2      Timeline.timeSync (dart:developer/timeline.dart:163:22)
#3      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:449:21)
#4      ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:391:10)
#5      ProcessedOptions.loadAdditionalDills.<anonymous closure> (package:front_end/src/base/processed_options.dart:368:35)
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:417:29)
#7      ListIterable.toList (dart:_internal/iterable.dart:221:19)
#8      ProcessedOptions.loadAdditionalDills (package:front_end/src/base/processed_options.dart:368:67)
<asynchronous suspension>
#9      generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:87:26)
<asynchronous suspension>
#10     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#11     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#12     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#13     compile.<anonymous closure> (package:front_end/src/api_unstable/dart2js.dart:185:43)
#14     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#15     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#16     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#17     new Future.sync (dart:async/future.dart:224:31)
#18     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#19     _rootRun (dart:async/zone.dart:1133:13)
#20     _CustomZone.run (dart:async/zone.dart:1026:19)
#21     _runZoned (dart:async/zone.dart:1525:10)
#22     runZoned (dart:async/zone.dart:1472:12)
#23     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#24     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#25     compile (package:front_end/src/api_unstable/dart2js.dart:183:57)
#26     KernelLoaderTask.load.<anonymous closure> (package:compiler/src/kernel/loader.dart:112:27)
#27     CompilerTask.measure (package:compiler/src/common/tasks.dart:64:51)
#28     KernelLoaderTask.load (package:compiler/src/kernel/loader.dart:59:12)
#29     Compiler.runInternal (package:compiler/src/compiler.dart:238:48)
#30     Compiler.run.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:212:38)
#31     new Future.sync (dart:async/future.dart:224:31)
#32     Compiler.run.<anonymous closure> (package:compiler/src/compiler.dart:212:20)
#33     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:179:35)
#34     Compiler.run (package:compiler/src/compiler.dart:209:41)
#35     CompilerImpl.run.<anonymous closure>.<anonymous closure> (package:compiler/src/apiimpl.dart:91:22)
#36     _RootZone.runUnary (dart:async/zone.dart:1388:54)
#37     _FutureListener.handleValue (dart:async/future_impl.dart:140:18)
#38     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:681:45)
#39     Future._propagateToListeners (dart:async/future_impl.dart:710:32)
#40     Future._completeWithValue (dart:async/future_impl.dart:525:5)
#41     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:555:7)
#42     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#43     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#44     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#45     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

#0      BinaryBuilder._checkEmptyInput (package:kernel/binary/ast_from_binary.dart:434:29)
#1      BinaryBuilder.readComponent.<anonymous closure> (package:kernel/binary/ast_from_binary.dart:451:7)
#2      Timeline.timeSync (dart:developer/timeline.dart:163:22)
#3      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:449:21)
#4      ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:391:10)
#5      ProcessedOptions.loadAdditionalDills.<anonymous closure> (package:front_end/src/base/processed_options.dart:368:35)
#6      MappedListIterable.elementAt (dart:_internal/iterable.dart:417:29)
#7      ListIterable.toList (dart:_internal/iterable.dart:221:19)
#8      ProcessedOptions.loadAdditionalDills (package:front_end/src/base/processed_options.dart:368:67)
<asynchronous suspension>
#9      generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:87:26)
<asynchronous suspension>
#10     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart)
#11     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#12     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#13     compile.<anonymous closure> (package:front_end/src/api_unstable/dart2js.dart:185:43)
#14     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#15     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart)
#16     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#17     new Future.sync (dart:async/future.dart:224:31)
#18     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#19     _rootRun (dart:async/zone.dart:1133:13)
#20     _CustomZone.run (dart:async/zone.dart:1026:19)
#21     _runZoned (dart:async/zone.dart:1525:10)
#22     runZoned (dart:async/zone.dart:1472:12)
#23     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#24     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#25     compile (package:front_end/src/api_unstable/dart2js.dart:183:57)
#26     KernelLoaderTask.load.<anonymous closure> (package:compiler/src/kernel/loader.dart:112:27)
#27     CompilerTask.measure (package:compiler/src/common/tasks.dart:64:51)
#28     KernelLoaderTask.load (package:compiler/src/kernel/loader.dart:59:12)
#29     Compiler.runInternal (package:compiler/src/compiler.dart:238:48)
#30     Compiler.run.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:212:38)
#31     new Future.sync (dart:async/future.dart:224:31)
#32     Compiler.run.<anonymous closure> (package:compiler/src/compiler.dart:212:20)
#33     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:179:35)
#34     Compiler.run (package:compiler/src/compiler.dart:209:41)
#35     CompilerImpl.run.<anonymous closure>.<anonymous closure> (package:compiler/src/apiimpl.dart:91:22)
#36     _RootZone.runUnary (dart:async/zone.dart:1388:54)
#37     _FutureListener.handleValue (dart:async/future_impl.dart:140:18)
#38     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:681:45)
#39     Future._propagateToListeners (dart:async/future_impl.dart:710:32)
#40     Future._completeWithValue (dart:async/future_impl.dart:525:5)
#41     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:555:7)
#42     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#43     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#44     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#45     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

[3965/4014] ACTION //utils/analysis_server:analysis_server_dill(//build/toolchain/android:clang_x64)
[3966/4014] ACTION //utils/kernel-service:frontend_server_dill(//build/toolchain/android:clang_x64)
[3967/4014] ACTION //utils/dartdoc:dartdoc_dill(//build/toolchain/android:clang_x64)
[3968/4014] ACTION //utils/dartfmt:dartfmt_dill(//build/toolchain/android:clang_x64)
[3969/4014] ACTION //utils/dartdevc:dartdevc(//build/toolchain/android:clang_x64)
ninja: build stopped: subcommand failed.
ninja -C out/DebugAndroidX64 create_sdk
BUILD FAILED

real    115m25.343s
user    394m24.053s
sys 14m53.927s

The full log is attached below.

log.txt

athomas commented 4 years ago

We don't support building the full SDK (the create_sdk target for Android). I've changed the title of that wiki page to "Building the Dart VM for Android". It only describes that runtime is supposed to work. If you just need a Dart VM that works on Android, use tools/build.py -a arm,arm64,ia32,x64 -m all --os=android. You could also specify fewer modes and architectures, if you don't need all of them: tools/build.py -a arm64 -m release --os=android.

If you want to create Android applications in Dart, flutter.dev is probably what you want.