-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
v 0.8.0 'which' is unix specific (doesn't work on Windows) #284
Comments
Somehow path resolution fails for jruby + childprocess. That's why I added which. |
Ok, but now you've broken Windows. :-0 I can certainly help write or incorporate the methods for checking which os it is. |
BTW: I'm not using the |
Thanks for straightening me out on that, @dg-ratiodata . My bad for assuming it was the |
On jruby childruby fails to find commands using PATH. I have no idea why. Using which was the first thing which came into my mind to fix it. At least on posix platforms it worked. ;-)
Sounds reasonable. What about
Anyway. Maybe we should split the How are commands like BTW: On a Windows-system I've access to |
Since JRuby runs on multiple platforms, you'll need a platform-independent solution for it. (So the PATH approach might work some of the time, when someone happens to be running JRuby on a POSIX-compliant OS, but will fail other times.) I still don't understand the problem you're trying to solve with the Here's another way for me to ask the questions: Thanks for your patience with me on this.
On Windows, as gems or utilties are installed, generally a |
Wow. :-) Thanks for the long helpful post. To make this clear from my understanding. Using PATH
All systems including Windows an Posix make use of a PATH-environment variable... As I'm very interested in having a solution which works across all platforms I decided to use PATH. Sorry for the German Screenshots, I've got only a German one running here, but just to run my virtual machine. From my understanding even Windows looks up commands using PATH. So this should be save to rely on that. The which method should "abstract" away how the path to a command is resolved. Problem with ChildProcessI had issues with jruby (all versions in travis.yml) + childprocess. It constantly failed. Using Using another library to solve problems on windowsI'm not that sure, if this is the way to go. Besides the windows and jruby problem I like the API and implementation of childprocess. It seems to be well maintained. I think we've got some more pressing matters to be solved, e.g. cleanup and complete the test suite. I want to have a test suite I can rely on when releasing a new gem version, not breaking someon else's build process. But nevertheless you're more than welcome to have a look into this. 😄 Support for different platformsAs long as there are tests + a well defined and well documented interface aka class which wraps platform specific code I have no troubles with adding such stuff to aruba - as long as it is not tooo specific. But maybe @mattwynne can give his opinion on the platform stuff? |
Thanks for explaining so much. I really appreciate it. Now I understand a lot more about why you're using the My old Jr-high school German + my long history with Windows means I had no trouble with your German screenshots. :-) I totally understand the need to get things out the door. (Do. I. Ever.) And I'm not advocating anything like a new library just for Windows. (Maybe I'm misinterpreting your use of 'another library.') I'm just trying to figure out if we need to do one thing for Windows and other for 'everything else' -- like a few lines of code/ a method call. (That's not unusual at all when trying support multiple OSs.) As it's currently written, the PATH isn't working for windows. (It fails at There has to be at least one change made for Windows to use ChildProcess: #283 and I'll aim for a polymorphic process spawner with that. Having that in place will then provide some flexibility: if one ruby engine (like Jruby) or an OS (like Windows) requires something specific to make ChildProcess work, the framework -- including tests and any documentation -- will be in place. (And it will be interesting to see what happens with JRuby on Windows!) How about if I do the work on #283 and then, if this still isn't working for Windows, we can revisit it at that point? |
mmh.. can you try PATHEXT <--- T |
Good idea! |
@maxmeyer My mistake. I did run the tests as is (which use "ENV['PATHEXT'] ). I typed it wrong in my comment above. (I should have either copied and pasted or just pointed to the line in the file.)
But all of the tests in
The tests for run! fail at the same place, but with a little additional info about their matcher not matching:
I'm just skimming through the code, but I wonder if the issue is on this line:
Could it be that somehow environment['PATH'] is an empty string for Windows? What other way could that parameter be empty when |
and BTW, my path isn't empty. Here's my setup for working on aruba stuff right now, FYI:
|
I think the error makes sense if ENV['PATH'] is really empty. Not sure why it looks like this. Can you try to code walk using
at the very beginning of the spec? |
BTW I pushed some changes to master which might be helpful. |
Don’t forget you can natter on https://gitter.im/cucumber/aruba https://gitter.im/cucumber/aruba! |
thanks for the reminder, @mattwynne ! heading there now.. |
Sorry to awaken this old dragon, but I was thinking that I may have some value proposition. I'm developing suite of micro tools for developing CLI apps under umbrella of tty. And as so happens I've written tty-which for handling Unix which command across platforms. The library can be used independently and has no dependencies. I'm keen on providing a single reusable solution rather than going over reinventing the wheel. But I understand that you may not want to have another dependency. Any thoughts? |
Personally, I prefer to keep the dependency list as short as possible. But if you like I'm more than happy to accept a PR fixing our "windows" problem(s). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
There is now separate which code for windows so this should work properly. |
'which' is a unix-specific command; it doesn't exist on Windows ('where' is a close equivalent). Also, checking a PATH for the existence of a command does not work the same in Windows.
There is code in
spawn_process.rb
anddebug_process.rb
that uses 'which' and checks the PATH. This won't work on Windows. I'm not clear on what the intent is. I can help with a PR if you can help me better understand the intent.The text was updated successfully, but these errors were encountered: