You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm going wrong about this, please let me know (how otherwise).
tl;dr the proposed PR #219 solves my problem, basically enables running Vagrant from master (in/from kitchen off course 😉) on Windows.
Problem:
Due to dependencies I was forced to upgrade to Vagrant >= 1.8.
Vagrant 1.8 (msi/installer) introduces Ruby 2.2, which does not support the (msi) bundled Nokogiri, thereby making Vagrant >= 1.8 inoperable for me
This has been fixed on master (details: hashicorp/vagrant#6848)
Solution attempt 2, binstubs
To use very latest Vagrant master, the wiki explains how to do this: https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-Source#use-dev-version.
Basically Bundler creates a binstub vagrant, which is a ruby file (shebang). Fail
These shebang files do not work on Windows (cmd/PowerShell). (Just calling the file doesn't work. Calling ruby <vagrant_stub> does work)
Solution attempt 2.1, Cygwin using the binstub
When using Cygwin or mingw, the shebang works, and the latest development version of Vagrant is available when called directly from a bash shell. Fail
But kitchen-vagrant uses Mixlib::ShellOut, which does not use the shell it originated from but uses Win32API which is somewhat equivalent to the default shell, cmd, where the shebang binstubs don't work.
Solution attempt 2.2, cmd file using the binstub
Considering the fact that the binstubs do work in native Windows when using ruby <full path to the binstub>, I created a vagrant.cmd file with content: ruby c:\dev\vagrant\exec\vagrant %*, and put that in my path.
Thereby from cmd or PowerShell able to use e.g vagrant --version. Fail
But kitchen-vagrant uses Mixlib::ShellOut, which requires that exact command (vagrant), or command.EXE (vagrant.exe) to exist, and does not pick up vagrant.cmd
Solution attempt 2.2.1, code patch using cmd file using the binstub
To be able to make attempt 2.2 work, I would need to change the kitchen-vagrant code, like follows:
from
With PR #219, I have made vagrant a parameter, which could be for example vagrant.cmd, but can also be something like ruby c:\dev\vagrant\exec\vagrant (both work).
The text was updated successfully, but these errors were encountered:
If I'm going wrong about this, please let me know (how otherwise).
tl;dr the proposed PR #219 solves my problem, basically enables running Vagrant from master (in/from kitchen off course 😉) on Windows.
Problem:
Due to dependencies I was forced to upgrade to Vagrant >= 1.8.
Vagrant 1.8 (msi/installer) introduces Ruby 2.2, which does not support the (msi) bundled Nokogiri, thereby making Vagrant >= 1.8 inoperable for me
This has been fixed on master (details: hashicorp/vagrant#6848)
Solution attempt 1, bundle
Including Vagrant (master) in my bundler config (gem via github)
Fail
This does not work as kitchen calls
vagrant
usingMixlib::ShellOut
: https://github.com/test-kitchen/test-kitchen/blob/master/lib/kitchen/shell_out.rb#L67Bundler does not pick this up, resulting in a Vagrant not found error.
Solution attempt 2, binstubs
To use very latest Vagrant master, the wiki explains how to do this: https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-Source#use-dev-version.
Basically Bundler creates a binstub
vagrant
, which is a ruby file (shebang).Fail
These shebang files do not work on Windows (cmd/PowerShell). (Just calling the file doesn't work. Calling
ruby <vagrant_stub>
does work)Solution attempt 2.1, Cygwin using the binstub
When using Cygwin or mingw, the shebang works, and the latest development version of Vagrant is available when called directly from a bash shell.
Fail
But kitchen-vagrant uses
Mixlib::ShellOut
, which does not use the shell it originated from but uses Win32API which is somewhat equivalent to the default shell,cmd
, where the shebang binstubs don't work.Solution attempt 2.2, cmd file using the binstub
Considering the fact that the binstubs do work in native Windows when using
ruby <full path to the binstub>
, I created avagrant.cmd
file with content:ruby c:\dev\vagrant\exec\vagrant %*
, and put that in my path.Thereby from cmd or PowerShell able to use e.g
vagrant --version
.Fail
But kitchen-vagrant uses
Mixlib::ShellOut
, which requires that exact command (vagrant
), or command.EXE (vagrant.exe
) to exist, and does not pick upvagrant.cmd
Solution attempt 2.2.1, code patch using cmd file using the binstub
To be able to make attempt 2.2 work, I would need to change the kitchen-vagrant code, like follows:
from
to
Success!
With PR #219, I have made
vagrant
a parameter, which could be for examplevagrant.cmd
, but can also be something likeruby c:\dev\vagrant\exec\vagrant
(both work).The text was updated successfully, but these errors were encountered: