feat: --<lang>_prefix cli option#24824
Conversation
--plugin-command-prefix
|
@mkruskal-google can you please take a look? Or ping someone who should review this, I'm not sure. |
mkruskal-google
left a comment
There was a problem hiding this comment.
Sorry for the long delay on this!
|
@mkruskal-google Thank you for the comments, I've addressed all of them. |
|
@mkruskal-google sorry for the delay, I addressed your last comments. Please take a look when you have a moment |
--plugin-command-prefix--<lang>_prefix cli option
|
Also updated PR name and description. |
|
@igor-sirotin - can you take a look at the test failures we're seeing on Windows, e.g.: |
Batch %1/%2 parameter tokenization splits on '=' (and ',' ';'), so "--bar=baz" became two parameters and the wrapper tried to exec "baz" (exit 9009). Record the raw argument tail via %* and take the last token as the plugin path instead.
@JasonLunn done! Hope it works now, unfortunately I don't have a Windows machine to verify it. |
|
@mkruskal-google @JasonLunn is it good to go now? |
Closes #23509
Description
--<lang>_prefix=COMMANDflag toprotoc, allowing a plugin to be invoked through a user-supplied command wrapper.<lang>matches the plugin used by--<lang>_out, so different plugins can use different wrappers in a single invocation.COMMAND <plugin>; COMMAND's first token is resolved via the search path (PATH), the value is tokenized on whitespace into argv, and quotes are rejected at parse time. Use a wrapper script for more complex invocations.--plugin..bat) cover happy-path invocation, argument forwarding, PATH-based resolution, missing executable, duplicate flags, empty values, and quote rejection.Naming
Earlier revisions of this PR used a single global
--plugin-command-prefixflag. Per #23509 (comment), this PR now uses per-plugin--<lang>_prefixto match the existing--<lang>_out/--<lang>_optconvention.Testing
I've tested this in https://github.com/status-im/status-go with this command in
messaging/layers/encryption/: