Description
On Windows, there is a limit to the size of a command line (executable + arguments). It's easy to hit this limit with some operations like asking the IDE to re-run all test files that had failing tests from the last run, because each test file needs to be listed specifically:
One option to fix this for dart test
is to support an argument like --tests-from-file testlist.txt
, however this only solves the issue for that specific case, but it would be nice to solve this more generally.
@jakemac53 noted that Bazel supports a final argument of @filename
that can be used to read arguments from a file which seems like a nice convention to follow (and I started implementing at dart-lang/test#2485), and this is also implemented in Dart compute_kernel.dart here.
When trying to add the equivalent to flutter test
, it turned out to be easier to support for the whole flutter
command because of how the CommandRunner
works (I started this at flutter/flutter#167272). If doing this for all of flutter
it would be nice if we also supported it for all of dart
(instead of only pkg:test
).
@bkonyi had some questions that would be worth discussing if we're going to implement this more generally across all tools/commands (and I added a few):
- Are we concerned about legit args that start with
@
that aren't this file? - Should we support replacing args-from-file that aren't in the final position of the command?
- Exactly what should the format of the file be?
- Bazel seems to support a few formats but the Dart code here seems to just assume raw args on individual lines (I presume this makes it impossible to provide newlines in the values)
I don't personally have any real preference for what the solution is, my main goal is to be able to resolve bugs like the one shown up-top. I do think a general solution implemented once in dart ...
and flutter ...
would be better than having multiple implementations in individual sub-commands though.