-
Notifications
You must be signed in to change notification settings - Fork 217
Supporting passing a filename that contains a list of arguments as the last argument #2485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be a replacement for any arguments, and not only test paths.
For instance this should work with an arbitrary number of -n
arguments as well.
This does require some manual pre-processing of the input args as opposed to using rest
but ultimately makes things more flexible.
Oh, I see! Should we do this in the |
I guess a related question is whether this even belongs in |
I would just do it in executable.dart - that is how we handle it most other places. |
…e last argument Allows the final argument to be `@filename` where `filename` is a path (relative to `cwd`) to a file that contains arguments to replace it before parsing. This allows arguments longer than Windows supports to be provided (see Dart-Code/Dart-Code#5473).
@jakemac53 I've updated it, PTAL :-) |
@jakemac53 I was just starting to do something equivalent for So now I'm wondering if it would make sense to do the same for Edit: Flutter PR is at flutter/flutter#167272 |
… as the last argument On Windows, there is a limit to how long command lines can be. This causes problems if a user selects a large subset of test files to run (which prevents using `flutter test foldername`) - see Dart-Code/Dart-Code#5473 This change allows the last argument to be `@filename` where filename is a text file containing arguments that should be substituted in its place. This is roughly equivalent to a `dart test` change for the same at dart-lang/test#2485 which is similar to existing functionality elsewhere (such as Bazel - see Dart-Code/Dart-Code#5473 (comment)). To ensure these args always behave identically to args passed on the command line, the substitution is done as the very first thing in `executable.dart`.
I think previously this was just the very first time you send a PR it would make a contributor approve things, and if you have any commits in the history it would run them without approval. Maybe that changed, not sure. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. |
It sounds reasonable to me, but also I think you could land this here first if you wanted, and it shouldn't get in the way. If |
Yeah, good point. Let's continue with this as-is then because it'll likely be simpler to land and allow us to solve the immediate issue sooner. The failed check was because I didn't add to test_core changelog. I've added there too but also left it in (You may need to re-kick the bots it seems!) |
This is definitely interesting. Do we have any concern that I like the idea of having general support for this in Would it be more discoverable and flexible if we added a global |
It's a possibility, though if this convention exists elsewhere, maybe it's not unreasonable to not support it. We could also restrict it in other ways (must be
I started a PR at flutter/flutter#167272 for this for discussion too, and I do think it'd be good to have something consistent across the two.
Supporting that would be quite trivial, it just increases the chances of a real arg wanting to start with
Perhaps, but I it could have drawbacks:
Personally, I'm not too concerned with what the solution is, only that there is a solution - so I'm happy to go with whatever others feel would be best (and ideally that we can do consistently across tools). |
I think it's worth having a discussion about this with a wider group (probably dart-cli@) before we commit to adding this generally, especially if we want to support additional trailing arguments. |
Agreed, and there is precedent with at least bazel and our own tools which support bazel. These aren't really user facing though, but I don't ever expect any user to be doing this.
I am not concerned about this personally, pretty extreme edge case imo. You would have to be trying to run tests which both live at the root of your repo, and have a name starting with |
Is this an internal group? Should I file an SDK issue on GH?
I'd also be ok with that, but it would also be nice that if we landed something in |
Yeah, it's an internal group. Filing an SDK issue with the proposed behavior would be great! |
@bkonyi I've opened dart-lang/sdk#60551. If you're able to attract the right peoples eyes, that would be appreciated (it would be good to agree a format and answer the questions so even if we choose to just ship something in |
Allows the final argument to be
@filename
wherefilename
is a path (relative tocwd
) to a file that contains arguments to replace it before parsing.This allows arguments longer than Windows supports to be provided (see Dart-Code/Dart-Code#5473).
cc @jakemac53