paleozogt / MSVCDocker

MSVC via Wine in Docker
121 stars 20 forks source link

Current version of vagrant is running the snapshot batch scripts as powershell scripts instead #17

Closed virtuald closed 3 years ago

virtuald commented 4 years ago

Is this something you've ran into? What versions of vagrant/virtualbox are you using? Alternatively, maybe it makes sense to just convert those into powershell instead.

paleozogt commented 4 years ago

This sure looks like a bug in Vagrant. The version I've been using is v2.2.7 which works. However, when I try out the latest (v2.2.9), it falls down like you describe. The shell provisioner is supposed to know whether to use cmd or PowerShell based on the script extension.

There's a clue in the logs. In v2.2.7 I see this:

 ==> win-msvc15: Running provisioner: shell...
    win-msvc15: Running: vagranttools/snapshot.bat as c:\tmp\vagrant-shell.bat

while with v2.2.9 I see this:

==> win-msvc15: Running provisioner: shell...
    win-msvc15: Running: vagranttools/snapshot.bat as C:\tmp\vagrant-shell.ps1

It seems like vagrant is deliberately changing the script extension to .ps1 (!), so Windows then tries to execute the script with PowerShell. I don't know why Vagrant is doing this-- that's a particularly big change for a point-release update.

I'm going to dig through Vagrant's issues and see if anyone's reported this. In the meantime, can you try v2.2.7? You can get old versions here.

paleozogt commented 4 years ago

@virtuald I've filed an issue with vagrant here.

paleozogt commented 3 years ago

@virtuald Looks like this was fixed in Vagrant 2.2.10. :)