-
Notifications
You must be signed in to change notification settings - Fork 90
[native_toolchain_c] cl.exe path with space #2870
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: main
Are you sure you want to change the base?
[native_toolchain_c] cl.exe path with space #2870
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
dcharkes
left a comment
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.
Is there a way to trigger this in a test on the GitHub actions?
| ...?environment?.entries.map((entry) => '${entry.key}=${entry.value}'), | ||
| executable.toFilePath(), | ||
| ...arguments.map((a) => a.contains(' ') ? "'$a'" : a), | ||
| ...arguments, |
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.
Doesn't this break other things?
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.
Yes, you’re right. After testing, I found that my changes cause other issues in some scenarios.
| workingDirectory: workingDirectory?.toFilePath(), | ||
| environment: environment, | ||
| runInShell: Platform.isWindows && workingDirectory != null, | ||
| runInShell: executable.toFilePath().contains(' ') |
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.
I prefer a runInShell override in the method parameter, because otherwise it becomes too much magic why it choses what.
c229fc7 to
16f7776
Compare
When the Visual Studio C++ compiler (cl.exe) is installed in a path containing spaces (e.g., the default "C:\Program Files\Microsoft Visual Studio\2022\..."), the build system failed to execute it correctly. The command was invoked without proper quoting, leading to an error: 'C:\Program' is not recognized as an internal or external command Signed-off-by: Dee HY <[email protected]>
16f7776 to
c77845e
Compare
For the runInShell parameter, I have preserved the original logic as much as possible, only setting runInShell to false when the executable file path contains spaces. I believe this change will better align with the expected behavior.
Contribution guidelines:
dart format.Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.