Fix --disable-telemetry by adding the necessary handling to the VM

TEST=manual testing
Change-Id: I78e91bd19bb9612010f1b01f4c376d55d2f575a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293440
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
This commit is contained in:
Janice Collins
2023-04-04 20:33:30 +00:00
committed by Commit Queue
parent ebd3243b2b
commit 2f71556f8b
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -16,6 +16,17 @@ import 'core.dart';
int? get dartdevUsageLineLength =>
stdout.hasTerminal ? stdout.terminalColumns : null;
/// Global options for dartdev.
///
/// ** READ THIS BEFORE MODIFYING **
///
/// Adding or changing behavior for global flags may have consequences for
/// integration with the VM. Check `runtime/bin/main_options.cc` in the
/// Dart SDK if adding or changing any flags. This is most important for
/// those that are intended to be run without a script such as
/// `dart --disable-analytics` as there is special handling. Any flags
/// added here should also be tested by hand with a compiled SDK as unit tests
/// running `dartdev.dart` directly do not hit that code path.
ArgParser globalDartdevOptionsParser({bool verbose = false}) {
var argParser = ArgParser(
usageLineLength: dartdevUsageLineLength,
+3
View File
@@ -468,6 +468,9 @@ bool Options::ParseArguments(int argc,
} else if (IsOption(argv[i], "disable-analytics")) {
disable_dartdev_analytics = true;
skipVmOption = true;
} else if (IsOption(argv[i], "disable-telemetry")) {
disable_dartdev_analytics = true;
skipVmOption = true;
} else if (IsOption(argv[i], "no-analytics")) {
// Just add this option even if we don't go to dartdev.
// It is irrelevant for the vm.