Skip to content

Commit

Permalink
Remove --disable-dart-dev across flutter/engine. (flutter#54845)
Browse files Browse the repository at this point in the history
As per the Dart CLI team and @bkonyi, this is no longer providing value and we shouldn't cargo-cult it.

Work towards flutter/flutter#154268.
  • Loading branch information
matanlurey authored Aug 29, 2024
1 parent cd48ec2 commit 1198996
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bin/et
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ if [ ! -d "${ENGINE_DIR}/tools/engine_tool/.dart_tool" ]; then
exit 1
fi

"${DART}" --disable-dart-dev "${ENGINE_DIR}/tools/engine_tool/bin/et.dart" "$@"
"${DART}" "${ENGINE_DIR}/tools/engine_tool/bin/et.dart" "$@"
2 changes: 1 addition & 1 deletion bin/et.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ cd "%engine_tool_dir%"
REM Do not use the CALL command in the next line to execute Dart. CALL causes
REM Windows to re-read the line from disk after the CALL command has finished
REM regardless of the ampersand chain.
"%dart%" --disable-dart-dev bin\et.dart %* & exit /B !ERRORLEVEL!
"%dart%" bin\et.dart %* & exit /B !ERRORLEVEL!
8 changes: 2 additions & 6 deletions build/dart/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ template("flutter_frontend_server") {
]
snapshot_depfile = "$kernel_output.d"

common_vm_args = [ "--disable-dart-dev" ]

flutter_patched_sdk =
rebase_path("$root_out_dir/flutter_patched_sdk", root_build_dir)

Expand Down Expand Up @@ -106,7 +104,7 @@ template("flutter_frontend_server") {
frontend_server =
rebase_path("$root_gen_dir/frontend_server_aot.dart.snapshot")

args = [ dart ] + common_vm_args + [ frontend_server ] + common_args
args = [ dart ] + [ frontend_server ] + common_args
}
} else {
prebuilt_dart_action(target_name) {
Expand All @@ -122,8 +120,7 @@ template("flutter_frontend_server") {
inputs = [ invoker.main_dart ]
outputs = [ invoker.kernel_output ]
depfile = snapshot_depfile
vm_args = common_vm_args
args = common_args
vm_args = (args = common_args)
}
}
}
Expand Down Expand Up @@ -337,7 +334,6 @@ template("application_snapshot") {
abs_output = rebase_path(output)
rel_output = rebase_path(output, root_build_dir)
snapshot_vm_args = [
"--disable-dart-dev",
"--deterministic",
"--packages=$package_config",
"--snapshot=$abs_output",
Expand Down
2 changes: 1 addition & 1 deletion ci/analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ WEB_SDK_TEST_FILES="$FLUTTER_DIR/web_sdk/test/*"
for testFile in $WEB_SDK_TEST_FILES
do
echo "Running $testFile"
(cd "$FLUTTER_DIR"; FLUTTER_DIR="$FLUTTER_DIR" "$DART" --disable-dart-dev --enable-asserts $testFile)
(cd "$FLUTTER_DIR"; FLUTTER_DIR="$FLUTTER_DIR" "$DART" --enable-asserts $testFile)
done
2 changes: 0 additions & 2 deletions ci/bin/format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,6 @@ final class HeaderFormatChecker extends FormatChecker {
}
final List<String> args = <String>[
_dartBin,
'--disable-dart-dev',
_headerGuardCheckBin,
...include.map((String f) => '--include=$f'),
];
Expand Down Expand Up @@ -1078,7 +1077,6 @@ final class HeaderFormatChecker extends FormatChecker {
}
final List<String> args = <String>[
_dartBin,
'--disable-dart-dev',
_headerGuardCheckBin,
'--fix',
...include.map((String f) => '--include=$f'),
Expand Down
1 change: 0 additions & 1 deletion ci/check_build_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ DART="${DART_BIN}/dart"

cd "$SCRIPT_DIR"
"$DART" \
--disable-dart-dev \
"$SRC_DIR/flutter/tools/pkg/engine_build_configs/bin/check.dart" \
"$SRC_DIR"

1 change: 0 additions & 1 deletion ci/clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ echo "$(date +%T) Running clang_tidy"

cd "$SCRIPT_DIR"
"$DART" \
--disable-dart-dev \
"$SRC_DIR/flutter/tools/clang_tidy/bin/main.dart" \
--src-dir="$SRC_DIR" \
${CLANG_TIDY_PATH:+--clang-tidy="$SRC_DIR/$CLANG_TIDY_PATH"} \
Expand Down
2 changes: 1 addition & 1 deletion ci/format.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ cd "%ci_dir%"
REM Do not use the CALL command in the next line to execute Dart. CALL causes
REM Windows to re-read the line from disk after the CALL command has finished
REM regardless of the ampersand chain.
"%dart%" --disable-dart-dev bin\format.dart %* & exit /B !ERRORLEVEL!
"%dart%" bin\format.dart %* & exit /B !ERRORLEVEL!
1 change: 0 additions & 1 deletion ci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ DART="${DART_BIN}/dart"

cd "$SCRIPT_DIR"
"$DART" \
--disable-dart-dev \
bin/format.dart \
"$@"
3 changes: 1 addition & 2 deletions ci/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dart --version
# Runs the tests for the license script.
function run_tests() (
cd "$SRC_DIR/flutter/tools/licenses"
find . -name "*_test.dart" | xargs -n 1 dart --disable-dart-dev --enable-asserts
find . -name "*_test.dart" | xargs -n 1 dart -enable-asserts
)

# Collects the license information from the repo.
Expand All @@ -94,7 +94,6 @@ function collect_licenses() (
# interpreter is faster than using unoptimized machine code, which has
# no chance of being optimized(due to its size).
dart \
--disable-dart-dev \
--enable-asserts \
--interpret_irregexp \
lib/main.dart \
Expand Down
18 changes: 9 additions & 9 deletions testing/benchmark/upload_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ VARIANT=$1
shift 1

cd "$SCRIPT_DIR"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/txt_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/fml_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/shell_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/ui_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/display_list_builder_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/display_list_region_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/display_list_transform_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/geometry_benchmarks.json "$@"
"$DART" --disable-dart-dev bin/parse_and_send.dart \
"$DART" bin/parse_and_send.dart \
--json $ENGINE_PATH/src/out/${VARIANT}/canvas_benchmarks.json "$@"
6 changes: 3 additions & 3 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ def run_benchmark_tests(build_dir):
test_dir = os.path.join(BUILDROOT_DIR, 'flutter', 'testing', 'benchmark')
dart_tests = glob.glob('%s/test/*_test.dart' % test_dir)
for dart_test_file in dart_tests:
opts = ['--disable-dart-dev', dart_test_file]
opts = [dart_test_file]
run_engine_executable(
build_dir, os.path.join('dart-sdk', 'bin', 'dart'), None, flags=opts, cwd=test_dir
)
Expand Down Expand Up @@ -1114,7 +1114,7 @@ def run_impeller_golden_tests(build_dir: str, require_skia_gold: bool = False):
golden_path = os.path.join('testing', 'impeller_golden_tests_output.txt')
script_path = os.path.join('tools', 'dir_contents_diff', 'bin', 'dir_contents_diff.dart')
diff_result = subprocess.run(
f'{dart_bin} --disable-dart-dev {script_path} {golden_path} {temp_dir}',
f'{dart_bin} {script_path} {golden_path} {temp_dir}',
check=False,
shell=True,
stdout=subprocess.PIPE,
Expand Down Expand Up @@ -1154,7 +1154,7 @@ def run_impeller_golden_tests(build_dir: str, require_skia_gold: bool = False):

with DirectoryChange(harvester_path):
bin_path = Path('.').joinpath('bin').joinpath('golden_tests_harvester.dart')
run_cmd([dart_bin, '--disable-dart-dev', str(bin_path), temp_dir])
run_cmd([dart_bin, str(bin_path), temp_dir])


def main():
Expand Down
5 changes: 2 additions & 3 deletions tools/api_check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
Verifies that enums in each of the platform-specific embedders, and the embedder
API remain consistent with their API in dart:ui.

### Running the tool
## Running the tool

This tool is run as part of `testing/run_tests.sh`.

To run the tool, invoke with the path of the Flutter engine repo as the first
argument.

```
```sh
../../../out/host_debug_unopt/dart-sdk/bin/dart \
--disable-dart-dev \
test/apicheck_test.dart \
"$(dirname $(dirname $PWD))"
```
2 changes: 1 addition & 1 deletion tools/engine_tool/lib/src/commands/lint_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class LintCommand extends CommandBase {
]);
_linters[Linter.java] =
_LinterDescription(Linter.java, environment.engine.flutterDir, <String>[
findDartBinary(environment), '--disable-dart-dev',
findDartBinary(environment),
p.join(engineFlutterPath, 'tools', 'android_lint', 'bin', 'main.dart'),
]);
_linters[Linter.c] = _LinterDescription(
Expand Down
1 change: 0 additions & 1 deletion tools/githooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def Main(argv):

result = subprocess.run([
os.path.join(GetDartBin(), 'dart'),
'--disable-dart-dev',
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
] + githook_args + [
'post-checkout',
Expand Down
1 change: 0 additions & 1 deletion tools/githooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def Main(argv):

result = subprocess.run([
os.path.join(GetDartBin(), 'dart'),
'--disable-dart-dev',
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
] + githook_args + [
'post-merge',
Expand Down
1 change: 0 additions & 1 deletion tools/githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def Main(argv):

result = subprocess.run([
os.path.join(GetDartBin(), 'dart'),
'--disable-dart-dev',
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
] + githook_args + [
'pre-push',
Expand Down
1 change: 0 additions & 1 deletion tools/githooks/pre-rebase
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def Main(argv):

result = subprocess.run([
os.path.join(GetDartBin(), 'dart'),
'--disable-dart-dev',
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
] + githook_args + [
'pre-rebase',
Expand Down

0 comments on commit 1198996

Please sign in to comment.