Conversation
Since we install a package update over existing package installations, we need to be more cautious about keeping any file handlers open and recovering when we find we may still have some open.
When attempting to delete the package in our current directory on windows, PPM must move out of the directory prior to deletion, otherwise windows will report the resource is busy, with us in it
This `.git` file proved to contain numerous incompatibilities with Windows. Despite many different attempts and techniques there was something in there that would still cause Windows to be unable to handle this file. Completely recreating it on modern git, on windows, with the same exact repo contents got everything working just fine.
DeeDeeG
left a comment
There was a problem hiding this comment.
I'd like to take a slow/careful look at the src/ changes, but the whole PR looks extremely promising to me.
The diff is quite a small one, easily a price I'd pay for something as monumental as "passing tests on Windows" (!!!!!!).
Truly I'm in disbelief to see this.
FWIW I get the same number of specs, all passing, before/after this PR on my macOS machine. So, this really seems to have no adverse consequences for other platforms either, at least within our spec coverage.
Wowowow!
Hope to be back with a full approve in not too too long.
Thank you so much for doing this!!!!!! 😮
|
|
||
| - if: "!contains(matrix.os, 'windows')" | ||
| name: Run tests 👩🏾💻 | ||
| - name: Run tests 👩🏾💻 |
|
So this supersedes #170 if I understand correctly? |
|
My other question is: when exactly should |
|
@2colours You are correct that this is the clean commit history version of #170 As for Since if we call Although, there is zero harm in calling it as soon as we are done collecting information with the |
There was a problem hiding this comment.
Looks good to me!
I may be taking a break from reviewing/activity in the project for a few days (potentially?) so I didn't want to leave this un-approved.
One day it will be good to run CI at Pulsar core repo with these ppm changes, but I don't have time at the moment. Such checks will happen anyway if we PR this update over to core repo, so that can wait until then.
Not meaning to bury or override @2colours' feedback, that feedback can also be considered, and this Approve review can be considered to apply either way.
Thanks again for fixing the specs on Windows!!! Truly amazing IMO. 🎉
After my work over on #170 I was able to finally figure out the changes needed to get all of PPMs specs working on Windows (for the first time since GHAs was introduced in APM!)
Below I'll break down the changes, but also feel free to read my commit messages:
git-test-repo.git: This fixture was introduced in 2016, and seemingly has some massive incompatibilities with Windows. Despite my and @DeeDeeG's best efforts we couldn't get this file to work properly on Windows. So instead of continually fighting the slight gains we were making, I opted to create a fresh repo on modern git and manually add all the files that should be within this fixture. After doing this and updating the commit SHA's expected of some tests, it works perfectly.ppm upgradespecs we opened agit-utilsfile handler that was never released and would cause the upgrade to fail on Windows. Callingrepo.release()resolves this.ppm uninstall .Windows would fail to uninstall as we are currently within the directory we are trying to uninstall (the.) so I've added a check to see if we are on Windows and if our current working directory is the same as the package directory, if so we move the current working directory up one dir and continue the file deletion.git-utilsfile handle created that needed to be cleaned up withrepo.release(), and during installation I've added a check to see if we are failing to uninstall because of any open file handles. In which case we log and attempt again with native NodeJSfs.cpSync()with the force option.It took some time, but with just these changes we've got everything working, and can proceed to make further development within PPM easier for any Windows developers (me lol). Sorry the diff is a tad large, but the majority of that is just the update in the fixture.