-
Notifications
You must be signed in to change notification settings - Fork 279
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
Add support for Windows #185
Conversation
@lencioni Thanks for the comments, keep 'em coming! Keep in mind that this is a wholly unadulterated commit stream, which means I haven't done any rebase/amend cleanup to eliminate obsolete commits, squash related ones together, or elaborate in commit messages. |
This is looking really good so far! If you think this might take a while, a lot of these could be merged as you go, which would help prevent bitrot and make future reviews a bit easier. Feel free to submit incremental pull requests of chunks that you feel good about and we'll try to get them merged in quickly. Thanks so much for working on adding Windows support to overcommit. There are a lot of people who will benefit from your contributions here. |
@lencioni @sds All changes not specifically related to Windows support have been extracted and merged in separate PRs. Thanks! There are still some issues standing in the way:
I know there's not much you can do to help here since you don't have a Windows dev machine to play with, just thought I'd give an update. Here's the latest failed build for reference. |
Apparently the
This causes the |
@sds @lencioni Sorry for the lack of updates on this, I've been busy with other projects and honestly, I'm not sure how to move forward. Integration tests are failing with output like the following, and I have no idea why:
The But I'm at a total loss regarding the failures with
Really not sure what's going on with that. It's even stranger since all the integration tests pass on my local Windows VM. Might be worth opening an issue over at appveyor/ci. |
Thanks for the heads up @jawshooah, It's interesting that the error message you display has both single and double quotes |
Added some debug statements to get deeper into this, and it looks like the auto-generated
This leads us to the RubyGems code that generates that file which looks like it was updated in rubygems/rubygems@dcf1d124 to fix a bug that looks suspiciously like our problem. I see in our |
There are issues with building native extensions on Windows in newer versions of |
Alright, since Ruby 1.9.3 has been EOLed as of February, I have no issue with dropping Ruby 1.9.3 from the Windows test suite. Removing it reveals a number of failures with integration tests I've added recently. I'll try to have a look at those soon and get them fixed. |
Looks like there were some more calls to |
Only thing failing now is |
Finally, all tests are passing! 🍻 We're not out of the woods yet, though. Take a look at this test run. You'll notice at the bottom that the This exposes a couple of problems:
Another problem, unrelated to this particular test run, is that many hooks grab the file name with a regex group that looks something like |
Appveyor is a CI tool for Windows, similar to Travis.
`File.symlink` is not implemented for Windows in the core library. Here we override `File.symlink` and `File.symlink?` to use the Windows `mklink` command as an alternative.
Ruby 1.9.3 reached its end-of-life in February 2015. Considering that it causes problems when building native extensions on Windows with RubyGems >= 2.4.0, we may as well stop testing against it.
Attempting to set the variable inline with the overcommit run results in the following error on Windows: 'BUNDLE_GEMFILE' is not recognized as an internal or external command, operable program or batch file.
Windows will not execute a script with no extension unless it can find a script with the same name in the same directory, suffixed with one of the extensions listed in PATHEXT. In addition, Windows will not be able to find the script to execute if its path uses '/' as a separator rather than '\'.
Windows doesn't know how to handle these.
Thanks for your hard work on this, @jawshooah! I've squashed some of your commits in an effort to quiet a bit of the intermediate work here. Merged in ee50226...627a8c0. |
Is there anything else holding us back from saying Overcommit supports Windows, @jawshooah? |
Given Windows' stricter limitation on command length, we should probably convert all hooks that call external commands to use "splittable" args, and do so for all such hooks in the future. |
Also important to note that the |
Following up on #161. As the title indicates, this is very much still a work in progress. Figured I'd go ahead and open this to get some feedback while I continue to work on it.
Since Travis does not yet support Windows as a platform, I'm using Appveyor for CI, and a Windows 7 VM for local testing.