Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Windows symlinks with volta run scripts #1755

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

charlespierce
Copy link
Contributor

Closes #1397

Info

  • Huge kudos to @rcsilva83 and @Xstoudi for a bunch of iteration in No more symlinks on Windows #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 junction to create NTFS junctions instead of directory symlinks (this part is directly copied from No more symlinks on Windows #1552)
  • Updated the shim module to have different implementations of create for Unix and Windows.
    • The Unix implementation is the same as it was before.
    • The Windows implementation creates a very simple .cmd script that calls volta run for the shim. It also continues to create a custom Git Bash script, though that script is updated to now call volta run directly, instead of calling the existing shim via cmd.exe
  • Create a new v4 layout since the shim file on Windows is now <binary>.cmd instead of <binary>.exe.
  • Created a migration to v4 that 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.

Using symlinks on Windows requires that our users enable Developer
mode, which isn't always possible. For directory links, there is an
easy solution: NTFS Junctions. These work the same as symlinks but
do not require administrator privileges nor developer mode.
Rather than using symlinks, which require administrator privileges
or developer mode on Windows, we can instead use small scripts that
call out to 'volta run' to actually handle the execution of 3rd
party binaries.

This also adds a migration to a new v4 layout, which allows Windows
installs to migrate immediately to using the script-based shims.
@Xstoudi
Copy link

Xstoudi commented Jun 5, 2024

Hey @charlespierce, great work!

Did you find time to check how it affects performance?
How much time do you think is needed to merge/release? Tbh this is somehow a go/no-go to use Volta in entreprise-grade Windows environment.

I'd be happy to help if some more work is needed to go forward with it, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dismiss the use of symlinks on Windows
2 participants