Hey Mitchell,
I made some really good progress on finding some workarounds that might be useful for you on trying to figure this issue out on vagrant 1.1.2 running under git bash.
The first issue I ran into was that bsdtar.exe was not in my path, so I was getting a file not found error during a vagrant package or vagrant add command. I saw that you relocated the bsdtar.exe out of the embedded/bin folder, since now there are two under mingw/bin and gnuwin32/bin. I've been using git bash (which is msys32) so I wanted to get mingw/bin into the path. For this I modified the /vagrant/bin/vagrant file (bash file) to include the following lines (this is with vagrant 1.1.2):
starting on line 46
OS=$(uname -o 2>
/dev/null)
if [ -z "${OS}" ];
then
# maybe uname has different options
OS=$(uname -s 2> /dev/null |cut -d _ -f
1)
fi
# Prepend our embedded dir to the PATH so that we call
that preferably
export PATH="${EMBEDDED_DIR}/bin:${PATH}"
# use mingw32 embedded commands
[ "${OS}" = "MINGW32" ]
&& export PATH="${EMBEDDED_DIR}/mingw/bin:${PATH}"
There probably has to be some additional logic for getting this to work in Cygwin so that when OS is Cygwin you use the correct bsdtar.exe (I wasn't sure if this would have been gnuwin32/bin or the mingw/bin). Maybe someone can test it on cygwin....
The second issue I ran into was a windows api issue with win32 api rename not returning a valid error when rename fails due to the destination being on a different file system. After doing some digging into fileutils.rb, I was seeing that it was raising an access denied error on call to File.rename (line 515). After digging around and seeing this article related to emacs explaining the rename issue on windows
http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00579.html, it occurred to me that my .vagrant.d folder that is in the %USERPROFILE% is actually on a different file system than where my %USERPROFILE%/AppData/Local/Temp or %TEMP% folder lives on my system (I use an SSD drive, so I had done some relocation of fatter folders in %USERPROFILE%). rename must be throwing Access Denied error instead of EXDEV so that mv can catch it and do a copy_entry.
After relocating the folders to be on the same filesystem, this solved my vagrant add issue. I suspect using FileUtils.mv without checking for access denied exceptions might not exactly work with Ruby 1.9.2 on windows. I didn't dig around to see if they dealt with the windows issue in newer releases of ruby, but I would suggest that for windows you should probably add a check and use a cp followed by rm instead of mv in box_collection.rb line 155 (there might be others if FileUtils.mv is used alot). For now, if I see the issue again I'll know to look and see if the source and destination folders are on the same file system for windows.
Hope the workaround help you solve some bugs.
Thanks,
Edward