Skip to content

Allow long arguments to be provided via a file instead of only on the command lineΒ #60551

Open
@DanTup

Description

@DanTup

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:

Image

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?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions