sandstorm-io / vagrant-spk

Packaging tool for Sandstorm, a self-hosting platform for web apps!
Apache License 2.0
55 stars 29 forks source link

Protocol Error when symlinking in the app folder on Windows #294

Open ocdtrekkie opened 3 years ago

ocdtrekkie commented 3 years ago

So, this particularly seems to happen if I try to work with anything Node-based, but whenever a script attempts to symlink in the directory shared with the host machine, if the host machine is a Windows box, it fails with a Protocol Error, presumably because Windows doesn't support symlinks.

I am not sure how best to solve this, but arguably everything that works in vagrant-spk should theoretically work in vagrant-spk on any platform, as that's largely the goal of it supporting multiple platforms in the first place.

zenhack commented 3 years ago

Maybe we could tweak the node stack to try to dodge this somehow, but I don't see a great way out of this in general. Note that there are also other possible pitfalls due to filesystem semantic differences: Anything that cares a lot about unix permissions and/or the executable bit is going to be thrown by being on a windows filesystem also (since it doesn't have that metadata), and Linux filesystems are case-sensitive, whereas Windows (and MacOS by default) filesystems are not -- the latter bit me once when trying to build davros.

So my general posture on this is, I'm willing to merge patches that make stuff work, but unless we ditch the shared filesystem approach there's always going to be a hazard of this kind of thing.

ocdtrekkie commented 3 years ago

FWIW, dodging this just for the Node stack would not have saved me last night... powerbox-http-proxy uses Node to build.

I am wondering if we should look at what tricks WSL uses, and whether or not there's anything in the Windows codebase we could tap into there... presumably symlinks work on WSL, but I think it uses the normal Windows file system still?

ocdtrekkie commented 3 years ago

Apparently there's ways to deal with this, that involve running VirtualBox as admin in Windows or granting the user the right to create symlinks, which is restricted, and also a VirtualBox setting to enable symlinks from guest OSes.

https://www.speich.net/articles/en/2018/12/24/virtualbox-6-how-to-enable-symlinks-in-a-linux-guest-os/ https://bealers.com/fix-virtualbox-symlinks-in-guest-share-on-windows-host/