-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add the ability to use shell:true for DebugAdapterExecutable #224204
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 29, 2024
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 30, 2024
VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken. I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround. This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up. Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions. Fixes #5183
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 30, 2024
VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken. I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround. This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up. Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions. Fixes #5183
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 30, 2024
VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken. I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround. This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up. Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions. Fixes #5183
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 30, 2024
VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken. I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround. This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up. Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions. Fixes #5183
DanTup
added a commit
to Dart-Code/Dart-Code
that referenced
this pull request
Jul 30, 2024
VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken. I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround. This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up. Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions. Fixes #5183
Contributor
Author
|
This is being fixed better by #224320 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current insiders version of VS Code includes a new version of NodeJS that fails to spawn
.batfiles whenshell: trueis not set:https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
The
DebugAdapterExecutableclass does not currently allow extensions to setshell: truewhen describing how their debug adapter should be launched. This PR adds support for passingshell? string | booleanthrough.Without this fix, the Flutter debug adapter does not launch (it gets an
EINVALerror). With this fix, it launches successfully.Fixes #224184
I don't know if there's a way to add automated tests for this, so if that is required please provide pointers. Thanks!