-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Summary of the new feature/enhancement
This might be a stretch but this is another one of those unfortunate gotchas when a dev is trying to use PowerShell to invoke commands that have been documented. Here's the problem:
04-25 14:54:57 84> g++ timer.cpp @conanbuildinfo.args -o timer --std=c++11
ParserError:
Line |
1 | g++ timer.cpp @conanbuildinfo.args -o timer --std=c++11
| ~~~~~~~~~~~~~~~
| The splatting operator '@' cannot be used to reference variables in an expression.
| '@conanbuildinfo' can be used only as an argument to a command. To reference variables
| in an expression use '$conanbuildinfo'.
[master ≡ +13 ~9 -0 !] /mnt/c/Users/hillr/GitHub/Conan-IO/training/consumer_gcc
04-25 14:55:28 85> g++ timer.cpp '@conanbuildinfo.args' -o timer --std=c++11In this case, conanbuildinfo.args is a file, specifically a response file that contains a bunch of arguments to g++. It is not that uncommon for exes to use a response file specified with @response_filename.
Proposed technical implementation details (optional)
I'm not entirely sure what the solution is but maybe in this case before erroring when the variable is not found (conanbuildinfo in the example above), consider passing the arg as-is to the native binary assuming it will handle the @. This might be worth emitting a warning. Something like: Could not find splatted variable 'conanbuildinfo', passing argument as-is to the application. To avoid this warning, put single quotes around the argument.. Also, if strict mode is set, maybe this should go ahead and error?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status