Skip to content

Commit 0c3359d

Browse files
authored
Omit hardcoded --packages=.dart_tool/package_config.json. (#160982)
Closes flutter/flutter#160219. This hard-coded package configuration is no longer strictly correct as-of Dart 3.6.0; a pub _workspace_ (https://dart.dev/tools/pub/workspaces) can appear at a higher-level than a package, and if the package is part of the workspace, tooling is expected to (automatically) find `.dart_tool/package_config.json` at a higher-level. For example, the _engine_ sub-repo uses a [workspace](https://github.com/flutter/flutter/blob/9fd5bddc65c3616a5a0ba9af44e1bd7fe8c99c1d/engine/src/flutter/pubspec.yaml#L82), which means that, for example, `%ENGINE%/tools/engine_tool/.dart_tool/package_config.json` will _never_ exist (it will be at `%ENGINE%/.dart_tools/package_config.json`. As currently defined, the test-golden comparator interface will fail with a package that uses workspaces. By removing the flag (and letting automatic `--packages` resolution occur), I _believe_ the problem is automatically resolved (but I'll let CI prove that for us).
1 parent a6c057c commit 0c3359d

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

packages/flutter_tools/lib/src/test/test_golden_comparator.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ final class TestGoldenComparator {
112112
_flutterTesterBinPath,
113113
'--disable-vm-service',
114114
'--non-interactive',
115-
'--packages=${_fileSystem.path.join('.dart_tool', 'package_config.json')}',
116115
output,
117116
];
118117

packages/flutter_tools/test/general.shard/flutter_platform_test.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,7 @@ void main() {
396396
() async {
397397
processManager.addCommand(
398398
const FakeCommand(
399-
command: <String>[
400-
'flutter_tester',
401-
'--disable-vm-service',
402-
'--non-interactive',
403-
'--packages=.dart_tool/package_config.json',
404-
'',
405-
],
399+
command: <String>['flutter_tester', '--disable-vm-service', '--non-interactive', ''],
406400
stdout: '{"success": true}\n',
407401
),
408402
);

packages/flutter_tools/test/general.shard/test/test_golden_comparator_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ FakeCommand _fakeFluterTester(
222222
pathToBinTool,
223223
'--disable-vm-service',
224224
'--non-interactive',
225-
'--packages=.dart_tool/package_config.json',
226225
'compiler_output',
227226
],
228227
stdout: stdout,

0 commit comments

Comments
 (0)