volta
volta copied to clipboard
Replace Windows symlinks with `volta run` scripts
trafficstars
Closes #1397
Info
- Huge kudos to @rcsilva83 and @Xstoudi for a bunch of iteration in #1552 on removing symlinks for Windows, to allow dropping the requirement for Developer Mode.
- Based on discussions in that PR, we had a new idea for replacing symlink shims on Windows by using scripts that call
volta run <package>. - This is a first-pass implementation of creating simple script-based shims for executing 3rd-party binaries on Windows.
- This should be a no-op for Unix.
Changes
- Used
junctionto create NTFS junctions instead of directory symlinks (this part is directly copied from #1552) - Updated the
shimmodule to have different implementations ofcreatefor Unix and Windows.- The Unix implementation is the same as it was before.
- The Windows implementation creates a very simple
.cmdscript that callsvolta runfor the shim. It also continues to create a custom Git Bash script, though that script is updated to now callvolta rundirectly, instead of calling the existing shim viacmd.exe
- Create a new
v4layout since the shim file on Windows is now<binary>.cmdinstead of<binary>.exe. - Created a migration to
v4that removes and regenerates the shims, making sure that the old symlinks are removed. The migration also updates any existing directory symlinks to use junctions as well.
Tested
- Installed packages using the current Volta version (i.e. with symlinks).
- Installed a new version of Volta based on these changes.
- Verified that running the existing packages still works and that the shims were properly migrated.
- Turned off developer mode.
- Verified that even without developer mode, I could install and run new packages 🎉
Notes
- I still need to do some performance testing to see how this change affects performance. I would expect it to be roughly equivalent to the old approach, but want to test that to be sure.