Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Initial findings in porting to Cygwin on Windows #158

Open
alankent opened this issue Dec 18, 2015 · 3 comments
Open

Initial findings in porting to Cygwin on Windows #158

alankent opened this issue Dec 18, 2015 · 3 comments

Comments

@alankent
Copy link

I don't have time to complete this properly, but recording some notes here in case someone else finds useful as a starting point for porting this project to Windows with Cygwin.

  • check_prerequisites is hard coded to make sure OS X (Darwin) – I commented out the call to the function so Cygwin worked.
  • I had to compile up https://github.com/emcrisostomo/fswatch - which for me involved installing more Cygwin libraries and the C++ compiler. I could not find fswatch in the default cygwin downloads.
  • I replaced “greadlink” with “readlink” (greadlink was a separate command added on OS X because the built in readlink was not powerful enough on OS X).
  • I commented out the “install_dependencies” call (I could have turned on ‘skip dependencies’ flag it looks like) – this invokes ‘homebrew’ to install stuff on OS X. I had already done these steps by hand on Windows (that is, install boot2docker etc).
  • The ‘install’ command failed to add a hostname to /etc/hosts for two reasons: It used 'sudo' which failed under cygwin, and it messed up the CRLF line ending for Windows. That needs to be more robust.

After that the 'install' command seemed to work and set everything up surprisingly well, and I could use the script to start boot2docker, sync to docker host, etc. Nice work!!!

@brikis98
Copy link
Owner

Wow, nice work! I'm amazed those were the only changes required. Is there a package manager that works with cygwin that could fill in fswatch and the other dependencies in install_dependencies? If so, all the other issues would be straightforward to fix. And if that's all it takes to support Windows, I'm totally game.

@alankent
Copy link
Author

Unfortunately not that I know of - other than cygwin. If cygwin added fswatch support for example, that would be a great win. This seems to be the relevant page: https://cygwin.com/setup.html. The fswatch owner does not make a Windows binary available - so maybe that is step one. Find a volunteer to get fswatch included in cygwin. Then, as you say, the rest is probably straightforward for you to do.

(I don't think you can install packages from the command line in cygwin by the way - they have a separate tool that can install updates - assuming you are not running cygwin at the time. In Windows, you cannot replace binaries if the code is currently executing, so I think the install process had to be kept separate. So it is going to be just echo statements saying "you also need to install the following cygwin packages". Maybe that is all you do - echo cygwin packages you need, don't try to install them.)

@brikis98
Copy link
Owner

That's a shame about package management on Cygwin.

One thought on maintainability: I don't even have a Windows box these days, so testing changes would be tough. In fact, even maintaining the code on OS X is tough, as we can't run integration tests due to #7. To add Windows to the mix, I'd probably need a solution to #7 for both OS X and Windows so we had a reasonable suite of integration tests that ran automatically. Otherwise, the code would almost certainly break after a short while.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants