[SDK] Adds dart2exe to create standalone executables.

Tested:
  ./tools/build.py --arch x64 --mode release --verbose create_sdk copy_gen_kernel_snapshot copy_dart2aot
  ./tools/build.py --arch x64 --mode product --verbose copy_gen_snapshot copy_dartaotruntime
  cp -r out/ProductX64/dart-sdk/bin/{dartaotruntime,utils/} out/ReleaseX64/dart-sdk/bin/
  out/ReleaseX64/dart-sdk/bin/dart2native ~/src/hello_world.dart
  ~/tmp/hello_world.exe

  dart tools/bots/aot_smoke_tests.dart

  python tools/test.py -n dartkp-linux-release-x64 vm/dart/run_appended_aot_snapshot_test

Change-Id: I149fcd18405cdf0a87b8f4b4072c0f0e8f98c067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117140
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Clement Skau 2019-09-23 12:00:08 +00:00 committed by commit-bot@chromium.org
parent 94dd49cdb6
commit f546362691
12 changed files with 371 additions and 249 deletions

View file

@ -29,6 +29,7 @@ crypto:third_party/pkg/crypto/lib
csslib:third_party/pkg/csslib/lib
dart2js_info:third_party/pkg/dart2js_info/lib
dart2js_tools:pkg/dart2js_tools/lib
dart2native:pkg/dart2native/lib
dart_internal:pkg/dart_internal/lib
dart_style:third_party/pkg_tested/dart_style/lib
dartdoc:third_party/pkg/dartdoc/lib

View file

@ -1,81 +0,0 @@
#!/usr/bin/env dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:args/args.dart';
import 'package:path/path.dart';
const clearLine = '\r\x1b[2K';
void aot(String sourceFile, String snapshotFile, bool enableAsserts,
bool buildElf, bool tfa, bool noTfa, String packages, List<String> ds) {
if (!FileSystemEntity.isFileSync(sourceFile)) {
print('Error: $sourceFile is not a file');
return;
}
String genSnapshotOption = buildElf
? '--snapshot-kind=app-aot-assembly'
: '--snapshot-kind=app-aot-blobs';
String genSnapshotFilename = buildElf
? '--assembly=$snapshotFile.S'
: '--blobs_container_filename=$snapshotFile';
String snapDir = dirname(Platform.script.path);
String binDir = canonicalize(join(snapDir, '..'));
String sdkDir = canonicalize(join(binDir, '..'));
String dartCommand = join(binDir, 'dart');
String snapshot = join(snapDir, 'gen_kernel.dart.snapshot');
stdout.write('${clearLine}Generating AOT snapshot');
List<String> dartArgs = <String>[
snapshot,
'--platform',
'${sdkDir}//lib/_internal/vm_platform_strong.dill',
'--aot',
'-Ddart.vm.product=true',
if (tfa) '--tfa',
if (noTfa) '--no-tfa',
...ds,
if (packages != null) ...['--packages', packages],
'-o',
'$snapshotFile.dill',
sourceFile
];
var cmdResult = Process.runSync(dartCommand, dartArgs);
if (cmdResult.exitCode != 0) {
print('\nGenerating AOT snapshot failed\n');
print(cmdResult.stdout);
print(cmdResult.stderr);
return;
}
stdout.write("${clearLine}Generating AOT .dill");
String genSnapshotCommand = join(binDir, 'utils', 'gen_snapshot');
List<String> genSnapshotArgs = [
genSnapshotOption,
genSnapshotFilename,
if (enableAsserts) '--enable-asserts',
'$snapshotFile.dill'
];
cmdResult = Process.runSync(genSnapshotCommand, genSnapshotArgs);
if (cmdResult.exitCode != 0) {
print('\nGenerating AOT .dill failed\n');
print(cmdResult.stdout);
print(cmdResult.stderr);
return;
}
stdout.write("${clearLine}Done.\n");
stdout.flush();
}
void setupAOTArgs(ArgParser parser) {
parser.addFlag('build-elf');
parser.addFlag('enable-asserts');
parser.addFlag('tfa');
parser.addFlag('no-tfa');
parser.addOption('packages');
}

View file

@ -3,68 +3,140 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:args/args.dart';
import 'dart2aot.dart';
import 'package:dart2native/dart2native.dart';
import 'package:path/path.dart' as path;
typedef void Command(ArgResults args, List<String> ds);
final String executableSuffix = Platform.isWindows ? '.exe' : '';
final String snapshotDir = path.dirname(Platform.script.toFilePath());
final String binDir = path.canonicalize(path.join(snapshotDir, '..'));
final String sdkDir = path.canonicalize(path.join(binDir, '..'));
final String dart = path.join(binDir, 'dart${executableSuffix}');
final String genKernel = path.join(snapshotDir, 'gen_kernel.dart.snapshot');
final String dartaotruntime =
path.join(binDir, 'dartaotruntime${executableSuffix}');
final String genSnapshot =
path.join(binDir, 'utils', 'gen_snapshot${executableSuffix}');
final String platformDill =
path.join(sdkDir, 'lib', '_internal', 'vm_platform_strong.dill');
void main(List<String> args) {
Map<String, Command> commands = <String, Command>{};
commands['aot'] = callAOT;
// Read -D args that the ArgParser can't handle.
List<String> ds = [];
args = filterDArgs(args, ds);
ArgParser parser = ArgParser();
parser.addFlag('help');
ArgParser aotParser = parser.addCommand('aot');
setupAOTArgs(aotParser);
ArgResults result = null;
Future<void> generateNative(Kind kind, String sourceFile, String outputFile,
String packages, List<String> defines, bool enableAsserts) async {
final Directory tempDir = Directory.systemTemp.createTempSync();
try {
result = parser.parse(args);
} catch (ArgParserException) {
// We handle this case as result == null below.
}
final String kernelFile = path.join(tempDir.path, 'kernel.dill');
final String snapshotFile = (kind == Kind.aot
? outputFile
: path.join(tempDir.path, 'snapshot.aot'));
if (result == null || result.command == null || result['help']) {
print('dart2native <command> <args>\n');
print(' command: ');
print(' aot - Compile script into one ahead of time dart snapshot');
return;
}
if (commands.containsKey(result.command.name)) {
commands[result.command.name](result.command, ds);
return;
}
}
void callAOT(ArgResults args, List<String> ds) {
List<String> rest = args.rest;
if (rest.length != 2) {
print(
'Usage: dart2native aot [options] <dart-source-file> <dart-aot-file>\n');
print(
'Dart AOT (ahead-of-time) compile Dart source code into native machine code.');
return;
}
aot(rest[0], rest[1], args['build-elf'], args['enable-asserts'], args['tfa'],
args['no-tfa'], args['packages'], ds);
}
List<String> filterDArgs(List<String> args, List<String> ds) {
List<String> result = <String>[];
args.forEach((String arg) {
if (!arg.startsWith('-D')) {
result.add(arg);
} else {
ds.add(arg);
print('Generating AOT kernel dill.');
final kernelResult = await generateAotKernel(dart, genKernel, platformDill,
sourceFile, kernelFile, packages, defines);
if (kernelResult.exitCode != 0) {
stderr.writeln(kernelResult.stdout);
stderr.writeln(kernelResult.stderr);
await stderr.flush();
throw 'Generating AOT kernel dill failed!';
}
});
return result;
print('Generating AOT snapshot.');
final snapshotResult = await generateAotSnapshot(
genSnapshot, kernelFile, snapshotFile, enableAsserts);
if (snapshotResult.exitCode != 0) {
stderr.writeln(snapshotResult.stdout);
stderr.writeln(snapshotResult.stderr);
await stderr.flush();
throw 'Generating AOT snapshot failed!';
}
if (kind == Kind.exe) {
print('Generating executable.');
await writeAppendedExecutable(dartaotruntime, snapshotFile, outputFile);
if (Platform.isLinux || Platform.isMacOS) {
print('Marking binary executable.');
await markExecutable(outputFile);
}
}
print('Generated: ${outputFile}');
} finally {
tempDir.deleteSync(recursive: true);
}
}
void printUsage(final ArgParser parser) {
print('Usage: dart2native <dart-script-file> [<options>]');
print('');
print('Generates an executable or an AOT snapshot from <dart-script-file>.');
print('');
print(parser.usage);
}
Future<void> main(List<String> args) async {
final ArgParser parser = ArgParser()
..addMultiOption('define',
abbr: 'D',
valueHelp: 'key=value',
help: 'The values for the environment constants.')
..addFlag('enable-asserts',
negatable: false, help: 'Enable assert statements.')
..addFlag('help',
abbr: 'h', negatable: false, help: 'Displays the help message.')
..addOption('output',
abbr: 'o', valueHelp: 'path', help: 'Path to output file.')
..addOption('output-kind',
abbr: 'k',
allowed: ['exe', 'aot'],
defaultsTo: 'exe',
valueHelp: 'exe|aot',
help:
'Whether to generate a stand-alone executable or an AOT snapshot.')
..addOption('packages',
valueHelp: 'path', help: 'Where to find a package spec file.');
final ArgResults parsedArgs = parser.parse(args);
if (parsedArgs['help']) {
printUsage(parser);
exit(0);
}
if (parsedArgs.rest.length != 1) {
printUsage(parser);
exit(1);
}
final Kind kind = {
'aot': Kind.aot,
'exe': Kind.exe,
}[parsedArgs['output-kind']];
final sourcePath = path.canonicalize(path.normalize(parsedArgs.rest[0]));
final outputPath =
path.canonicalize(path.normalize(parsedArgs['output'] != null
? parsedArgs['output']
: {
Kind.aot: '${sourcePath}.aot',
Kind.exe: '${sourcePath}.exe',
}[kind]));
if (!FileSystemEntity.isFileSync(sourcePath)) {
stderr.writeln(
'"${sourcePath}" is not a file. See \'--help\' for more information.');
await stderr.flush();
exit(1);
}
try {
await generateNative(kind, sourcePath, outputPath, parsedArgs['packages'],
parsedArgs['define'], parsedArgs['enable-asserts']);
} catch (e) {
stderr.writeln('Failed to generate native files:');
stderr.writeln(e);
await stderr.flush();
exit(1);
}
}

View file

@ -0,0 +1,72 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'dart:typed_data';
import 'package:path/path.dart' as path;
const appSnapshotPageSize = 4096;
const appjitMagicNumber = <int>[0xdc, 0xdc, 0xf6, 0xf6, 0, 0, 0, 0];
enum Kind { aot, exe }
Future writeAppendedExecutable(
String dartaotruntimePath, String payloadPath, String outputPath) async {
final dartaotruntime = File(dartaotruntimePath);
final int dartaotruntimeLength = dartaotruntime.lengthSync();
final padding =
((appSnapshotPageSize - dartaotruntimeLength) % appSnapshotPageSize);
final padBytes = Uint8List(padding);
final offset = dartaotruntimeLength + padding;
// Note: The offset is always Little Endian regardless of host.
final offsetBytes = new ByteData(8) // 64 bit in bytes.
..setUint64(0, offset, Endian.little);
final outputFile = File(outputPath).openWrite();
outputFile.add(dartaotruntime.readAsBytesSync());
outputFile.add(padBytes);
outputFile.add(File(payloadPath).readAsBytesSync());
outputFile.add(offsetBytes.buffer.asUint8List());
outputFile.add(appjitMagicNumber);
await outputFile.close();
}
Future markExecutable(String outputFile) {
return Process.run('chmod', ['+x', outputFile]);
}
Future generateAotKernel(
String dart,
String genKernel,
String platformDill,
String sourceFile,
String kernelFile,
String packages,
List<String> defines) {
return Process.run(dart, [
genKernel,
'--platform',
platformDill,
'--aot',
'-Ddart.vm.product=true',
...defines,
if (packages != null) ...['--packages', packages],
'-o',
kernelFile,
sourceFile
]);
}
Future generateAotSnapshot(String genSnapshot, String kernelFile,
String snapshotFile, bool enableAsserts) {
return Process.run(genSnapshot, [
'--snapshot-kind=app-aot-blobs',
'--blobs_container_filename=${snapshotFile}',
if (enableAsserts) '--enable-asserts',
kernelFile
]);
}

View file

@ -179,9 +179,12 @@ AppSnapshot* Snapshot::TryReadAppendedAppSnapshotBlobs(
if (!file->ReadFully(&appended_header, sizeof(appended_header))) {
return nullptr;
}
// Length is always encoded as Little Endian.
const uint64_t appended_length =
Utils::LittleEndianToHost64(appended_header[0]);
if (memcmp(&appended_header[1], appjit_magic_number.bytes,
appjit_magic_number.length) != 0 ||
appended_header[0] <= 0 || !file->SetPosition(appended_header[0])) {
appended_length <= 0 || !file->SetPosition(appended_length)) {
return nullptr;
}

View file

@ -299,11 +299,14 @@ class Utils {
static uint32_t HostToLittleEndian32(uint32_t host_value);
static uint64_t HostToLittleEndian64(uint64_t host_value);
static uint32_t BigEndianToHost32(uint32_t be_value) {
// Going between Host <-> BE is the same operation for all practical
// purposes.
// Going between Host <-> LE/BE is the same operation for all practical
// purposes.
static inline uint32_t BigEndianToHost32(uint32_t be_value) {
return HostToBigEndian32(be_value);
}
static inline uint64_t LittleEndianToHost64(uint64_t le_value) {
return HostToLittleEndian64(le_value);
}
static bool DoublesBitEqual(const double a, const double b) {
return bit_cast<int64_t, double>(a) == bit_cast<int64_t, double>(b);

View file

@ -38,6 +38,8 @@ inline int Utils::CountTrailingZeros(uword x) {
return static_cast<int>(result);
}
// WARNING: The below functions assume host is always Little Endian!
inline uint16_t Utils::HostToBigEndian16(uint16_t value) {
return _byteswap_ushort(value);
}

View file

@ -2,73 +2,57 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "dart:async";
import "dart:io";
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import "package:path/path.dart" as path;
import 'package:dart2native/dart2native.dart';
import 'package:path/path.dart' as path;
import 'package:expect/expect.dart';
import "snapshot_test_helper.dart";
final appSnapshotPageSize = 4096;
const appjitMagicNumber = <int>[0xdc, 0xdc, 0xf6, 0xf6, 0, 0, 0, 0];
Future writeAppendedExecutable(runtimePath, payloadPath, outputPath) async {
final runtime = File(runtimePath);
final int runtimeLength = runtime.lengthSync();
final padding = (appSnapshotPageSize - (runtimeLength % appSnapshotPageSize));
final padBytes = new List<int>.filled(padding, 0);
final offset = runtimeLength + padding;
final offsetBytes = new ByteData(8) // 64 bit in bytes.
..setUint64(0, offset, Endian.little);
final outputFile = File(outputPath).openWrite();
outputFile.add(runtime.readAsBytesSync());
outputFile.add(padBytes);
outputFile.add(File(payloadPath).readAsBytesSync());
outputFile.add(offsetBytes.buffer.asUint8List());
outputFile.add(appjitMagicNumber);
await outputFile.close();
}
import 'snapshot_test_helper.dart';
Future<void> main(List<String> args) async {
if (args.length == 1 && args[0] == "--child") {
print("Hello, Appended AOT");
if (args.length == 1 && args[0] == '--child') {
print('Hello, Appended AOT');
return;
}
final String sourcePath = path.join(
'runtime', 'tests', 'vm', 'dart', 'run_appended_aot_snapshot_test.dart');
await withTempDir((String tmp) async {
final String dillPath = path.join(tmp, "test.dill");
final String aotPath = path.join(tmp, "test.aot");
final String exePath = path.join(tmp, "test.exe");
final String dillPath = path.join(tmp, 'test.dill');
final String aotPath = path.join(tmp, 'test.aot');
final String exePath = path.join(tmp, 'test.exe');
final dillResult = await runGenKernel("generate dill", [
"--aot",
"-o",
dillPath,
"runtime/tests/vm/dart/run_appended_aot_snapshot_test.dart",
]);
expectOutput("", dillResult);
{
final result = await generateAotKernel(checkedInDartVM, genKernel,
platformDill, sourcePath, dillPath, null, []);
Expect.equals(result.stderr, '');
Expect.equals(result.exitCode, 0);
Expect.equals(result.stdout, '');
}
final aotResult = await runGenSnapshot("generate aot", [
"--snapshot-kind=app-aot-blobs",
"--blobs_container_filename=$aotPath",
dillPath,
]);
expectOutput("", aotResult);
{
final result =
await generateAotSnapshot(genSnapshot, dillPath, aotPath, false);
Expect.equals(result.stderr, '');
Expect.equals(result.exitCode, 0);
Expect.equals(result.stdout, '');
}
await writeAppendedExecutable(dartPrecompiledRuntime, aotPath, exePath);
if (Platform.isLinux || Platform.isMacOS) {
final execResult =
await runBinary("make executable", "chmod", ["+x", exePath]);
expectOutput("", execResult);
final result = await markExecutable(exePath);
Expect.equals(result.stderr, '');
Expect.equals(result.exitCode, 0);
Expect.equals(result.stdout, '');
}
final runResult =
await runBinary("run appended aot snapshot", exePath, ["--child"]);
expectOutput("Hello, Appended AOT", runResult);
await runBinary('run appended aot snapshot', exePath, ['--child']);
expectOutput('Hello, Appended AOT', runResult);
});
}

View file

@ -230,6 +230,7 @@ VM_UNIT_TEST_CASE(Endianity) {
EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value32be)[1]);
EXPECT_EQ(0xf1, reinterpret_cast<uint8_t*>(&value32be)[2]);
EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value32be)[3]);
EXPECT_EQ(0xf1f2u, Utils::BigEndianToHost32(value32be));
uint32_t value32le = Utils::HostToLittleEndian32(0xf1f2);
EXPECT_EQ(0xf2, reinterpret_cast<uint8_t*>(&value32le)[0]);
@ -256,6 +257,7 @@ VM_UNIT_TEST_CASE(Endianity) {
EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[5]);
EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[6]);
EXPECT_EQ(0x0, reinterpret_cast<uint8_t*>(&value64le)[7]);
EXPECT_EQ(0xf1f2f3f4ul, Utils::LittleEndianToHost64(value64le));
}
VM_UNIT_TEST_CASE(DoublesBitEqual) {

View file

@ -13,57 +13,120 @@ import 'dart:io';
import 'dart:convert';
import 'package:args/args.dart';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
get_dart2aot() {
if (Platform.isLinux) {
return 'out/ReleaseX64/dart-sdk/bin/dart2aot';
} else if (Platform.isMacOS) {
return 'xcodebuild/ReleaseX64/dart-sdk/bin/dart2aot';
} else if (Platform.isWindows) {
return 'out\\ReleaseX64\\dart-sdk\\bin\\dart2aot.bat';
} else {
throw 'Unsupported host platform!';
final String newline = Platform.isWindows ? '\r\n' : '\n';
final String scriptSuffix = Platform.isWindows ? ".bat" : "";
final String executableSuffix = Platform.isWindows ? ".exe" : "";
final String sdkBinDir = path.dirname(Platform.executable);
final String dart2aot = path.join(sdkBinDir, 'dart2aot${scriptSuffix}');
final String dartaotruntime =
path.join(sdkBinDir, 'dartaotruntime${executableSuffix}');
final String dart2native = path.join(sdkBinDir, 'dart2native${scriptSuffix}');
Future<void> withTempDir(Future fun(String dir)) async {
final Directory tempDir = Directory.systemTemp.createTempSync();
try {
await fun(tempDir.path);
} finally {
tempDir.deleteSync(recursive: true);
}
}
get_dartaotruntime() {
if (Platform.isLinux) {
return 'out/ReleaseX64/dart-sdk/bin/dartaotruntime';
} else if (Platform.isMacOS) {
return 'xcodebuild/ReleaseX64/dart-sdk/bin/dartaotruntime';
} else if (Platform.isWindows) {
return 'out\\ReleaseX64\\dart-sdk\\bin\\dartaotruntime.exe';
} else {
throw 'Unsupported host platform!';
}
}
assert_equals(var expected, var actual) {
if (expected != actual) {
print('Test failed! Expected \'$expected\', got \'$actual\'');
exit(1);
}
}
main(List<String> args) async {
ProcessResult result;
result = Process.runSync(get_dart2aot(),
['tools/bots/dart_aot_test.dart', 'tools/bots/dart_aot_test.dart.aot'],
stdoutEncoding: utf8, stderrEncoding: utf8);
stdout.write(result.stdout);
if (result.exitCode != 0 || result.stderr != '') {
stderr.write(result.stderr);
exit(1);
}
result = Process.runSync(
get_dartaotruntime(), ['tools/bots/dart_aot_test.dart.aot'],
stdoutEncoding: utf8, stderrEncoding: utf8);
if (result.exitCode != 0 || result.stderr != '') {
stderr.write(result.stderr);
exit(1);
}
assert_equals('Hello, 世界.', result.stdout.trim());
void main(List<String> args) {
test("dart2aot: Can compile and run AOT", () async {
await withTempDir((String tmp) async {
final String testCode = path.join('tools', 'bots', 'dart_aot_test.dart');
final String tmpAot = path.join(tmp, 'dart_aot_test.dart.aot');
{
final ProcessResult result =
await Process.run(dart2aot, [testCode, tmpAot]);
expect(result.stderr, '');
expect(result.exitCode, 0);
expect(result.stdout, '');
}
{
const String testStr = 'Dart AOT';
final ProcessResult result =
await Process.run(dartaotruntime, [tmpAot, testStr]);
expect(result.stderr, '');
expect(result.exitCode, 0);
expect(result.stdout, 'Hello, ${testStr}.${newline}');
}
});
});
test("dart2native: Can compile and run AOT", () async {
await withTempDir((String tmp) async {
final String testCode = path.join('tools', 'bots', 'dart_aot_test.dart');
final String tmpAot = path.join(tmp, 'dart_aot_test.dart.aot');
{
final ProcessResult result = await Process.run(dart2native,
[testCode, '--output', tmpAot, '--output-kind', 'aot']);
expect(result.stderr, '');
expect(result.exitCode, 0);
}
{
const String testStr = 'Dart AOT';
final ProcessResult result =
await Process.run(dartaotruntime, [tmpAot, testStr]);
expect(result.stderr, '');
expect(result.exitCode, 0);
expect(result.stdout, 'Hello, ${testStr}.${newline}');
}
});
});
test("dart2native: Can compile and run exe", () async {
await withTempDir((String tmp) async {
final String testCode = path.join('tools', 'bots', 'dart_aot_test.dart');
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
final ProcessResult result =
await Process.run(dart2native, [testCode, '--output', tmpExe]);
expect(result.stderr, '');
expect(result.exitCode, 0);
}
{
const String testStr = 'Dart AOT';
final ProcessResult result = await Process.run(tmpExe, [testStr]);
expect(result.stderr, '');
expect(result.exitCode, 0);
expect(result.stdout, 'Hello, ${testStr}.${newline}');
}
});
});
test("dart2native: Returns non-zero on missing file.", () async {
await withTempDir((String tmp) async {
final String testCode = path.join(tmp, 'does_not_exist.dart');
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
final ProcessResult result =
await Process.run(dart2native, [testCode, '--output', tmpExe]);
expect(result.exitCode, isNonZero);
}
});
});
test("dart2native: Returns non-zero on non-file.", () async {
await withTempDir((String tmp) async {
final String testCode = tmp; // This is a directory, not a file.
final String tmpExe = path.join(tmp, 'dart_aot_test.exe');
{
final ProcessResult result =
await Process.run(dart2native, [testCode, '--output', tmpExe]);
expect(result.exitCode, isNonZero);
}
});
});
}

View file

@ -5,6 +5,7 @@
// Test program for Dart AOT (dart2aot, dartaotruntime).
main(List<String> args) async {
print('Hello, 世界.');
void main(List<String> args) async {
final String who = !args.isEmpty ? args[0] : '世界';
print('Hello, ${who}.');
}

View file

@ -1611,8 +1611,8 @@
"script": "tools/bots/dart_sdk.py"
},
{
"name": "run smoke tests",
"script": "out/ReleaseX64/dart",
"name": "run AOT and Exe smoke tests",
"script": "out/ReleaseX64/dart-sdk/bin/dart",
"arguments": [
"tools/bots/aot_smoke_tests.dart"
]
@ -1661,8 +1661,8 @@
"script": "tools/bots/dart_sdk.py"
},
{
"name": "run smoke tests",
"script": "xcodebuild/ReleaseX64/dart",
"name": "run AOT and Exe smoke tests",
"script": "xcodebuild/ReleaseX64/dart-sdk/bin/dart",
"arguments": [
"tools/bots/aot_smoke_tests.dart"
]
@ -1698,8 +1698,8 @@
"script": "tools/bots/dart_sdk.py"
},
{
"name": "run smoke tests",
"script": "out/ReleaseX64/dart.exe",
"name": "run AOT and Exe smoke tests",
"script": "out/ReleaseX64/dart-sdk/bin/dart.exe",
"arguments": [
"tools/bots/aot_smoke_tests.dart"
]