roxy icon indicating copy to clipboard operation
roxy copied to clipboard

Invoking mlcp with roxy in Cygwin/Windows

Open JackYoungblood opened this issue 10 years ago • 6 comments

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.

JackYoungblood avatar Jan 13 '16 21:01 JackYoungblood

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.

rlouapre avatar Mar 19 '16 18:03 rlouapre

Sounds like we should recommend not using Cygwin.. :P

grtjn avatar Mar 20 '16 19:03 grtjn

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.

rlouapre avatar Mar 21 '16 12:03 rlouapre

Sorry, I meant both.. come up with a fix, and recommend against Cygwin until fixed.. ;)

grtjn avatar Mar 21 '16 12:03 grtjn

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?

rlouapre avatar Mar 26 '16 16:03 rlouapre

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..

grtjn avatar Jun 14 '17 10:06 grtjn