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

Running Beaker on Windows #373

Closed
Aethylred opened this issue Jul 25, 2014 · 9 comments
Closed

Running Beaker on Windows #373

Aethylred opened this issue Jul 25, 2014 · 9 comments

Comments

@Aethylred
Copy link

For reasons we shall not discuss (as it involves All of Government Purchasing policy, Public Records Act, red tape, and other-non-technical-issues-that-are-harder-than-make-it-work-in-windows) my $work requires that I develop puppet modules in a Windows environment. I'd really like to add beaker acceptance tests to my modules and run them locally.

I have Ruby 2.0, Vagrant, Puppet, Virtualbox, and VMware Workstation all working fine in Windows 7 x64, but installing beaker fails.

C:\Development\vagrant\ruby [master +0 ~1 -0]> gem install beaker
ERROR:  Error installing beaker:
        The 'nokogiri' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

However installing Nokogiri itself works, as the later version bundles binaries & libraries with the gem:

C:\Development\vagrant\ruby [master +0 ~1 -0]> gem install nokogiri
Fetching: mini_portile-0.6.0.gem (100%)
Successfully installed mini_portile-0.6.0
Fetching: nokogiri-1.6.3.1-x64-mingw32.gem (100%)
Nokogiri is built with the packaged libraries: libxml2-2.8.0, libxslt-1.1.28, zlib-1.2.8, libiconv-1.14.
Successfully installed nokogiri-1.6.3.1-x64-mingw32
Parsing documentation for mini_portile-0.6.0
Installing ri documentation for mini_portile-0.6.0
Parsing documentation for nokogiri-1.6.3.1-x64-mingw32
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/nokogiri/2.0/nokogiri.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/nokogiri/2.1/nokogiri.so, skipping
Installing ri documentation for nokogiri-1.6.3.1-x64-mingw32
2 gems installed

Would it be possible to check that beaker works with the later Nokogiri version, and have it's dependency changed to allow the use of this version.

No doubt, once this is sorted, I'll find another problem... probably symbolic links...

...I'm also expecting some comments about how gems bundling libraries and binaries is bad, because it is...

@Aethylred
Copy link
Author

Inclusion of 'fat binaries' starts with Nokogiri 1.6.2 https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.rdoc#162--2014-05-12

@joshcooper
Copy link
Contributor

@Aethylred you might be able to workaround for the time being by installing the ruby devkit from rubyinstaller.org. Make sure to select the compiler version that matches your ruby version.

@Aethylred
Copy link
Author

I've tried that, to no avail. I've even installed the whole Windows and mingw development environment. I'm not a Ruby developer, having to install the dev kit to use a testing tool seems overkill.

(OTOH I've got things to say about packages that require compiler tools on Linux too)

@anodelman
Copy link
Contributor

beaker is only designed to be able to run tests on windows nodes, not to be run on windows itself - you are in pretty much uncharted territory here so I can't say if there is a way to get it to work.

@Aethylred
Copy link
Author

I don't think designed is the word you want there, it's more that there was no intention for it to run under Windows... however without the operational environment for beaker being specified in the documentation it would be assumed that beaker can run where Ruby, Puppet and Vagrant can be run.

@Aethylred
Copy link
Author

The more relevant point (that came to me later) is that if a policy ever comes in that module PR must include beaker acceptance tests (like they now require puppet-rspec tests), then this will exclude users who develop modules on Windows (i.e. me) unless some kind of hosted beaker test suite is provided (similar to Travis).

Note: though I contribute to Linux modules, the environment I develop in is Windows, because of stupid policy and compliance regulations we do our work in.

@Iristyle
Copy link
Contributor

I've run into similar issues on x64 Windows. On that platform, Nokogiri requires a 1.6.x version to build properly, and our gemspec references ~> 1.5.10.

http://stackoverflow.com/a/23437057

I'm not sure what to make of the comment in the gemspec about the inclusion of this version for Ruby 1.8 support, but since we haven't shipped a Ruby 1.8 version on Windows any longer, my suggestion is to simply exclude Nokogiri from the gemspec on Windows.

https://github.com/puppetlabs/beaker/blob/master/beaker.gemspec#L51

Change

s.add_runtime_dependency 'nokogiri', '~> 1.5.10'

to

platform ||= RUBY_PLATFORM[/java/] || 'ruby'
s.add_runtime_dependency 'nokogiri', '~> 1.5.10' if platform.to_s == 'ruby'

You can see a more complete example of the use of platform specific dependencies here:
https://github.com/apache/buildr/blob/7760bcfb73afb59e7db5e4aaf35ee881aeec449f/buildr.gemspec

I don't have the cycles to verify this now @Aethylred , but perhaps you could build the gem locally and try to install it with those changes.

@anodelman
Copy link
Contributor

Last comment from @Iristyle quite a while back.

Please re-open if you need further help.

@rilindo
Copy link

rilindo commented Dec 24, 2014

In case people get to this page when searching for a solution to install Beaker on Windows:

I was able to install beaker on Windows. For me, I installed current Ruby release (2.1.5) AND devkit and with those two, I was able to install beaker. So this issue appears to be at least resolved from that aspect.

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

No branches or pull requests

5 participants