Skip to content

Guide how to compile (AOT) of *.dart in Dart 2.0 #34343

Closed
@segfaultmedaddy

Description

@segfaultmedaddy

AOT compilation was possible on Dart 1.24 through CLI with using appropriated app-aot value for --snapshot-kind, but I've recently tried to compile *.dart source code on Dart 2.0 like this:

$ dart --snapshot-kind=app-aot --snapshot=app.snapshot example/http_handler.dart 

and it returned error with following context:

../../runtime/bin/main.cc: 251: error: Dart 2.0 AOT compilations only accept Kernel IR files as input ('example/http_handler.dart' is not a valid Kernel IR file).

Dumping native stack trace for thread 1428
  [0x0000560cff5767df] dart::Profiler::DumpStackTrace(void*)
  [0x0000560cff5767df] dart::Profiler::DumpStackTrace(void*)
  [0x0000560cff7b2302] dart::Assert::Fail(char const*, ...)
  [0x0000560cff1f3083] dart::bin::RunMainIsolate(char const*, dart::bin::CommandLineOptions*)
  [0x0000560cff1f3ae7] dart::bin::main(int, char**)
  [0x0000560cff1f43c9] Unknown symbol
-- End of DumpStackTrace
Aborted (core dumped)

Can you, please, provide a detailed guide how to AOT compile source as it seems Dart 2.0 isn't able to compile *.dart using CLI.

Metadata

Metadata

Assignees

Labels

area-sdkUse area-sdk for general purpose SDK issues (packaging, distribution, …).area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-enhancementA request for a change that isn't a bugvm-native

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions