-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update 1.19.4 breaks wildcard operator '*' in tasks.json code will not compile #12001
Comments
Hi @venkat-ranganathan . I believe what you're seeing is actually 'by design'. When represented as an array, we do not expect arguments to contain shell escaping or other special shell characters. When present, they are now properly escaped. This recently changed, to address users' issues with args that refer to paths (containing special characters) that not being properly escaped, resulting in failing commands. I believe the proper solution here would be either for us to add an addition field for a command line fragment (allowing a partial command line, where shell escaping would be expected/supported), or allow arguments to also be included in the "command" field (which seems appropriately named to do so). I think the later may be more straight-forward. (The |
Quoted from The Linux Getting Started Docs So either the design has changed or this new behavior isn't actually correct. |
Hi @ecurtz . Thanks for bringing that documentation issue to our attention. In the past, as we've addressed issues from users who have effectively expected arguments to support or not support shell escaping (these expectations are mutually exclusive), we've inadvertently ping-ponged the behavior back and forth. To resolve the confusion and ambiguity, we've adopted a consistent design pattern throughout the C/C++ extension:
This parallels similar expectations of the This is also consistent with VS Code's default task provider, which does not expect shell escaping within an A command line is a shell concept, and an array of arguments (i.e. Currently, in a Similarly, our custom configuration provider API accepts these separately in |
Related on Stack Overflow:
|
This is the cpp tools extension, but this new behaviour breaks C/C++ compiling on Windows with MinGW gcc, gcc on MacOS, and clang on MacOS. The behaviour of quoting the
compiles with v1.18.5 on Windows with MinGW gcc, vs. the build command
This is based on the following
And for clang:
Is there any feasible alternative to using |
Original response: > Hi @venkat-ranganathan . I believe what you're seeing is actually 'by design'. Hi @Colengms, It doesn't seem that this can be by design when the cppTools are now broken on C/C++ compiling of larger-than-hello-world projects for multiple compilers on multiple platforms. It would be helpful to roll back the fix then develop a different fix for the original problem that was being solved so that the different fix solves the problem without also breaking most compile jobs. |
When I try using a string instead of an array for
This is my build task: {
"type": "cppbuild",
"label": "multiple cpp files",
"command": "/usr/bin/g++",
"args": "-Wall -Wextra -g -fdiagnostics-color=always ${workspaceFolder}/**/*.cpp -o ${workspaceFolder}/build/multiple-cpp-files",
"problemMatcher": ["$gcc"],
}, And trying to run the build task anyway gives me the message
I'm on v1.19.4 of this extension. What's going on? |
@john-boyer-phd my advice: do yourself a favour and build your larger-than-hello-world project with a buildsystem. Read bottom paragraph of https://stackoverflow.com/a/78058239/11107541 |
starball5 > @john-boyer-phd my advice: do yourself a favour and build your larger-than-hello-world project with a buildsystem. Read bottom paragraph of https://stackoverflow.com/a/78058239/11107541 I think you wouldn't be pleased to go to the doctor, say "doctor, it hurts when I do this," and then have the doctor say "well then don't do that." Same idea, i.e., thanks for your advice, but I'd like to use the built-in build system that worked until it got broken. When the built-in build system works, it's easy to use the dev environment to set up and debug a straightforward multifile project (a hello world program only has one file, and the quote marks don't seem to get added when there's only one file). |
We have been discussing this issue as a team and will be reverting the behavior to re-align with how VS Code's tasks work. This will be fixed in 1.19.5 which should be released this week. |
Thank you Bob, we really appreciate your expedient decision and action on this issue. |
@bobbrow, thanks for finding the two related issues (spaces and asterisks). Many of us have been spinning our wheels with workarounds. I am glad you guys are on top of this! |
Environment
Commit: microsoft/vscode@903b1e9
Date: 2024-02-13T19:42:12.210Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
Bug Summary and Steps to Reproduce
Since this morning I can no longer use the wild card operator to compile multiple files with the same extension, this was previously working as expected since I configured it a year ago.
The same command works if I type it in the terminal manually, i.e. "clang -g *.c"
This problem is compiler agnostic, the same error shows up if I try to use gcc instead of clang
Steps to Reproduce:
configure tasks.json to launch all files with the same extension using *.c, for example:
Error
attempt to compile code using task
receive the following error:
Expected behavior:
should compile the same as when user enters the same command in terminal manually
Configuration and Logs
Other Extensions
remote SSH
remote SSH editing
remote explorer
material icon theme
monokai vibrant theme
monokai night theme
python
pylance
python debugger
vscode pdf
Additional context
No response
The text was updated successfully, but these errors were encountered: