[ VM / CLI ] Redirect users to use 'dart compile' for snapshot generation

Note: `--snapshot=` and related flags are still valid for non-DartDev
invocations of the VM (e.g., 'dart --snapshot=').

TEST=Local testing

Fixes https://github.com/dart-lang/sdk/issues/49276

Change-Id: I666f68bd46d5b22c691da15267f14f4ad5a53731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ben Konyi 2022-06-23 20:35:15 +00:00
parent 4ac76c7f35
commit 95d1558109

View file

@ -1378,6 +1378,12 @@ void main(int argc, char** argv) {
if (should_run_user_program) {
try_load_snapshots_lambda();
}
} else if (script_name == nullptr &&
Options::gen_snapshot_kind() != SnapshotKind::kNone) {
Syslog::PrintErr(
"Snapshot generation should be done using the 'dart compile' "
"command.\n");
Platform::Exit(kErrorExitCode);
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)