Skip to content

only run in shell when on windows and running a .bat file #252

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

Merged
merged 3 commits into from
Jul 30, 2025

Conversation

jakemac53
Copy link
Contributor

Based on this suggestion from @DanTup dart-lang/tools#2138 (comment)

Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

runInShell:
// Required when running .bat files on windows, but otherwise should
// be avoided.
io.Platform.isWindows && commandWithPaths.first.endsWith('.bat'),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you doing any escaping of the command/args before here, or does that just happen inside processManager when runInShell is true? (you probably don't want any escaping when this is false).

You might also want to include .cmd for completeness (I didn't in Dart-Code because I know the only Windows shell scripts are flutter.bat).

I don't know how this works for non-Windows. I presume it you use a shell script that has a shebang line it'll just spawn the shell anyway (Dart-Code never uses shell execute for non-Windows).

Copy link
Contributor Author

@jakemac53 jakemac53 Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you doing any escaping of the command/args before here, or does that just happen inside processManager when runInShell is true? (you probably don't want any escaping when this is false).

Nothing is happening before here (or at all by us)

Copy link

auto-submit bot commented Jul 30, 2025

autosubmit label was removed for dart-lang/ai/252, because - The status or check suite build (master, windows-latest) has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit label Jul 30, 2025
Copy link
Member

@bwilkerson bwilkerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danny can provide better feedback than I can, but lgtm.

Copy link

@DanTup DanTup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - the test failure doesn't seem related to this, but there doesn't seem to be much in the logs to understand why it timed out.

@jakemac53
Copy link
Contributor Author

Re-running the failed job to make sure it was a flake

@jakemac53 jakemac53 merged commit 0dbbd8b into main Jul 30, 2025
31 of 32 checks passed
@jakemac53 jakemac53 deleted the dont-use-run-in-shell branch July 30, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants