-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bug when used for paths with spaces #27
Comments
I'm working on this on the CmdSpaceBug branch. I'm able to get through installation of poetry now when running Error (quotes are being placed around " run python -c "): Correct cmd line (origen interactive starts): |
I'm not a fan of Rust's command builder. The second line states: In the case of running Part of the problem I was running into was Rust would eat the quotes in some cases, but not others. I never really figured out what it was doing, I just got something that worked. My only goal for #10 was just to get O2 from immediately panicking/crashing the terminal (depending on what command was run) to being usable. |
Fair enough. I'm fighting through |
I just re-read the issue thread in the rust repo rust-lang/rust#29494 ...it's been open for 5 years! I would assume that everybody who cares created a workaround using |
|
I was really close to doing that myself. I decided against it because I wasn't sure how well that'd go over. Creating and executing a The |
I can't get the command string for interactive origen to work no matter how many escape characters I use. I can get the whole command to print when it errors out with this code:
arg.replace(";", "^;").replace(" ", "^ ").replace("(", "^(")
But, no matter what I do Rust is inserting some extra double quotes. I guess I'll look into |
My first thought on a |
I get the feeling that if we're having this much trouble with just a DesignSync I doubt Rust would have a wrapper for. |
I would say that we just should not support paths with spaces. But, all of the program binaries will live in a folder named I'm not ready to throw in the towel yet. |
Well, I can beat it into submission if I dump the python code into a For debug I'm putting the "launcher" code in |
Are we just talking about the Powershell case here? If so then I don't mind what hack you need to come up with. |
We're calling the windows command shell (cmd) to execute. The root of the issue is with the way Rust builds the execution string. It's attempting to provide all of the window dressing needed so that the command line is interpreted correctly by Windows. But, it's not getting it right. After thinking about this some more, I think we should hold off on implementing a hacky solution. I think in the end we may need to make our own Windows process launcher. For development I'm fine manually launching. |
@pderouen your ability to persevere is second to none 👍 |
LOL... I think it's a disorder. I don't know when to quit. I plan to expand our existing wrapper to handle booting origen from windows using that powershell string. I'm not happy about getting the new command shell window though. But, maybe it'll do until I figure out how to manually launch the process. I couldn't find the documentation on |
This code does not work when the command contains a path with spaces:
o2/rust/origen/src/core/os.rs
Lines 24 to 26 in c4662b5
According to this comment using
cmd /C command_to_execute
argument is "normally" not needed. But, I suppose we have a case where it is needed.https://stackoverflow.com/questions/44757893/cmd-c-doesnt-work-in-rust-when-command-includes-spaces
If I construct the return value exactly the same way as it's done for Linux, I don't have any issue. What led to the need for executing like this on Windows?
The text was updated successfully, but these errors were encountered: