Invoking mlcp with roxy in Cygwin/Windows
I was having trouble invoking mlcp from roxy when using Cygwin/Windows. The problem ultimately ended up being related to the File.expand_path function that is called in line 1065 of server_config.rb.
I had used linux conventions when specifying my mlcp-home variable (i.e. "/cygwin/c/install/mlcp") in build.properties file. But the File.expand_path functions expands the path using the path convention of the Windows OS. You end up with a convoluted path that mixes linux and Windows conventions and, as a result, mlcp.sh can't be found.
The solution was to change mlcp-home to use the Windows path convention (i.e. "C:\install\mlcp") instead of the linux path convention and now it appears that I'm able to invoke mlcp from roxy in Cygwin/Windows.
Interesting...
I did not check the code but a quick test: ruby -e 'p File.expand_path("hello")'
From Windows Prompt it returns "c:/Users/rlouapre/Documents/GitHub/roxy/hello"
From Cygwin it returns: "C:/Users/rlouapre/hello"
No backslash.
Sounds like we should recommend not using Cygwin.. :P
I do not agree. Cygwin support is a must. I will try to reproduce the issue and see if I can provide a fix for it.
Sorry, I meant both.. come up with a fix, and recommend against Cygwin until fixed.. ;)
Actually I was not testing from Cygwin but from Babun (assuming Babun uses Cygwin...)
Same command executed from cygwin: ruby -e 'p File.expand_path("hello")' "/cygdrive/c/Users/rlouapre/Documents/GitHub/roxy/hello"
Assuming mlcp-home is set using cygwin path:
mlcp-home=/cygdrive/c/Dev/mlcp
This code will fix mlcp for cygwin
require 'rbconfig'
# line 1188
if RbConfig::CONFIG['host_os'] == 'cygwin'
classpath = "`cygpath -wp #{classpath}`"
end
I guess the same fix will be required for corb and other command line tool. But the question is more should Roxy fully support cygwin?
I think neither mlcp.sh nor mlcp.bat works in Cygwin, so should we go beyond the official support? And I think Roxy does not support Cygwin officially either. I've never tried using it in Cygwin at least..