Skip to content
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

Support Cygwin and MinGW on Windows. Fixes #24 #49

Merged
merged 1 commit into from
Nov 18, 2013

Conversation

tpbrown
Copy link
Contributor

@tpbrown tpbrown commented Nov 11, 2013

Use ENV['SystemRoot'] to determine if we're running on Windows (vs ENV[['OS']).
Also ensure we use ENV['WINDIR'] to correctly locate the hosts file.

You'll still need the hosts file to have permissions allowing modifications, or run Vagrant as an administrator.

@smdahlen
Copy link
Contributor

@tpbrown Interested in managing this project (with possibly a few others)? I'm tied up for the next few months, and will not find to appropriately review pull requests.

@tpbrown
Copy link
Contributor Author

tpbrown commented Nov 11, 2013

@smdahlen Interested, yes. Available, nope. I'm tied up too :-/

I can harass a few co-workers that may have more time though. :)

@smdahlen
Copy link
Contributor

Ha. Thanks.

On Mon, Nov 11, 2013 at 5:34 PM, Tim Brown [email protected] wrote:

@smdahlen https://github.com/smdahlen Interested, yes. Available, nope.
I'm tied up too :-/

I can harass a few co-workers that may have more time though. :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/49#issuecomment-28246734
.

@kevburnsjr
Copy link

+1 Please help us wintards

@bdcribbs
Copy link
Collaborator

I can't easily verify this patch since I'm in OSX. (It looks like this patch should not affect posix systems, but I have not tested that locally). Out of curiosity, what does ENV['OS'] report in a Cygwin environment?

Hopefully @pbitty is able to confirm and merge this one.

@kevburnsjr
Copy link

Not sure about cygwin, I'm using msysgit which is MINGW32_NT-6.1

@bdcribbs
Copy link
Collaborator

Ok, Thanks KevBurnsJr. This patch looks good to me, but I'll still defer to our more Window's savvy maintainer to confirm and merge it in. In either case, I expect it'll be in the next gem release.

@pbitty
Copy link
Contributor

pbitty commented Nov 18, 2013

Thanks @tpbrown.

Using SystemRoot definitely works. However, it seems you can detect windows using RbConfig, which doesn't depend on environment variables. Something like:

RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/

I got it from this Stackoverflow answer, and Vagrant's code does something similar.

The nice thing using RbConfig is that the host_os value is hard-coded at build-time so it's "always legit". :) (Take a lot at rbconfig.rb somewhere under your Ruby's lib directory and you'll see what I mean.)

Are you up for changing this? I'm happy to do it otherwise.

@pbitty
Copy link
Contributor

pbitty commented Nov 18, 2013

I think I'm over-complicating this. This change works and should fix the issue in cygwin.

I am testing the 'rbconfig' way in pull #48.

@tpbrown, would you be up for helping me test it? For me, it triggers the UAC prompt if I'm not running vagrant as admin.

pbitty added a commit that referenced this pull request Nov 18, 2013
Support Cygwin and MinGW on Windows.  Fixes #24
@pbitty pbitty merged commit a426b85 into devopsgroup-io:master Nov 18, 2013
@pbitty pbitty mentioned this pull request Nov 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants