[native_toolchain_c] Fix Windows env quoting in runProcess (#3321)#3329
[native_toolchain_c] Fix Windows env quoting in runProcess (#3321)#3329Chaos02 wants to merge 1 commit intodart-lang:mainfrom
Conversation
|
This PR seems similar to #3323, but this is about env vars instead of the executable path. As discussed in that PR, we had issues before with invoking tools on Windows, and that's why the runInShell was added. We can try removing it, but it might lead to those issues returning. Is there a way to make it work without changing |
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with |
On Windows,
runProcesslaunched the subprocess withrunInShell: truewhenever aworkingDirectorywas supplied. The shell re-parsed every entry in the suppliedenvironmentmap, so values containing spaces or quotes (common forPATH,INCLUDE,LIBentries from MSVC environment batch files) were corrupted before reaching the child process.This PR:
runInShellunconditionally — the child now receivesenvironmentverbatim fromdart:io'sProcess.start._quoteForCommandLog, which quotes env values containing whitesRelated Issues
Fixes #3321
PR Checklist
dart tool/ci.dart --alllocally and resolved all issues identified. This ensures the PR is formatted, has no lint errors, and ran all code generators. This applies to the packages part of the toplevelpubspec.yamlworkspace.CHANGELOG.mdfor the relevant packages. (Not needed for small changes such as doc typos).