tools.vpm: fix windows install of already existing module #19761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The permission issue with
rmdir
is actually a real problem on Windows. Currently, usingv install
for an already existent module can run into the permission issue not just during testing.The issue causes that most contents of the directory of the module that should have been installed will be removed. In my tests, all except the
.git
directory - With this discovery it looks like the permission issue withrmdir_all
on Windows might be related to hidden files. After this error it becomes impossible to install the module without manually removing it from the.vmodules
directory, because vpm recognizes a.git
directory and tries to unsuccessfully update it, which is also something that should be improved separately.I think until the rmdir issue is fixed, this is an important workaround to make VPM work on Windows. That said, the rmdir issue should be addressed asap, because executing the system command for removal increases the likelihood of the V executable triggering Windows defender.
🤖 Generated by Copilot at bccf63e
This pull request fixes a bug that prevented vpm from installing modules on Windows, and enables a previously skipped test for vpm install. The bug is fixed by using a different command to remove existing modules, and the test is updated to run on all platforms.
🤖 Generated by Copilot at bccf63e