-
Notifications
You must be signed in to change notification settings - Fork 41
Binary PATH execution regression on Windows (since 3.0.15) #17
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
Comments
I can confirm these issues on my machines. Can you create PRs for that? |
@michael-o : Thanks for the bump ^^, it was out of my mind. I had a look on problem when I have opened the bug, but the root cause wasn't trivial (for me). I will try to found the time todo that. |
Problem is due to Charles Duffy / @krosenvold improvment (b38a1b3 : Commandline shell injection problems). |
Hummm ... after reflexion, if conditional processing or redirection is used, it is perhaps more sustainable to use |
@michael-o (or a maintainer): Could you please update the milestone to 3.1.0 ? Version has been released today, the changelog should be relevant (this fix/change is major for Windows usage). Thank you. |
Done. |
@khmarbaise: Thanks ! |
Apparently this breaks Ctrl+C on Windows, which will kill the |
@tbroyer : Do you have a simple use case to reproduce the problem ? Because using this simple
And execute it in a cmd ( Same behavior with native Java Runtime:
Is the problem not more linked to differences between a Linux Shell and Windows cmd ? I agree with you that this behavior could be a problem, but is it not more to Java code to manage that, by adding a hook (for sample).
Perhaps could be a "feature" of |
Best I can provide is: > mvn archetype:generate ^
-DarchetypeGroupId=net.ltgt.gwt.archetypes ^
-DarchetypeArtifactId=modular-webapp ^
-DarchetypeVersion=2018.5.2
[…]
> mvn gwt:codeserver -pl *-client -am
There is a shutdown hook already: plexus-utils/src/main/java/org/codehaus/plexus/util/cli/CommandLineUtils.java Lines 136 to 154 in ac81ee2
|
@tbroyer : The root cause is the usage of
But I have not (now) found any solution to destroy/kill the sub-process started by |
I personally do not understand why we have to launch a subshell at all. Why can't we simply pass the command as-is? @khmarbaise |
@michael-o : Without that, on Windows, any binaries on PATH or any embedded commands (like |
I don't see the bug, if you want some builtin command of an executable, you have to run that executable. Executables work, cmd scripts work for me:
output:
another one:
output:
|
@michael-o : The problem is mainly with Windows shell interpretations ... if you open a shell on Linux or Windows (cmd), the commands These interpretation are not native on Windows when invoking:
|
|
So this commit can be purely removed ... or we can to deal with these corners cases, with:
I agree it is not a really beautiful solution, but I did not see other solution to be cross-platform as much as it can. |
I wouldn't handle both at all:
All we do is simply to abstract. As soon we leave Java with |
OK. So commit a49305fb52674cfec3a180cb5fae11baea1423e3 should be revert. |
Yes, and in my opinion it needs a redesign. At the end, it is not our task to invoke |
Quick proposal for this revert (keeping unit tests): #41 |
Hi,
Upgrading plexus-utils from 3.0.15 to last version in some application using Commandline occurs problems on Windows for executed binaries when on Windows PATH.
With v3.0.24, this snippet (not the best stream management, this is just a sample):
Fails with (tested with java 1.7.0_51, 1.8.0_31, 1.8.0_91):
Same with cmd embedded command:
NB: These snippets worked fine in v3.0.15 (or in pure cmd command-line).
Is there some upgrades to do for this code continuing to work ? (Environment items to fill, ...)
I have tried to use
cmd.addSystemEnvironment();
(containing PATH), but no change.I'm not able to establish if it should be considered as a bug or not, because executing all plexus-utils unit tests (on Windows 10) for :
Some fails are similar to my PATH binary execution problem:
Some others seems more to be a forgot unit test expected results update about quotes management improvements (perhaps except the last/third):
I could work on PR (fix or UT update), but some opinion/feedback/advice would be useful.
Thanks in advance.
Best regards
The text was updated successfully, but these errors were encountered: