Open octogonz opened 1 month ago
@dmichon-msft said:
I used rush on WSL for quite a while; I only stopped due to migration to GitHub codespaces
The main guidance I would give for WSL is that the only path that should resolve from /mnt is code; everything else needs to resolve from the WSL installation or you are completely undoing any benefits of WSL
i.e. your Git enlistment itself needs to not be in /mnt, etc.
The Stack Overflow article above talks about issues with inconsistent casing of filenames, which result in git status
printing an empty output.
Cheers, @octogonz, thank you for the debugging session 😁
I'll just explain, for posterity, the original issue that I've encountered.
I had no special setup in my WSL and I tried to separate it from the host as much as possible (e.g. I had my code the /home
, I have appendWindowsPath=false
in /etc/wsl.conf
, so this definitely has nothing to do with me accidentally exececuting git-for-windows from my WSL.
After some investigation, we found that nothing is mysteriously wrong with Git, but the issue is actually a race condition in https://github.com/microsoft/rushstack/blob/main/libraries/package-deps-hash/src/getRepoState.ts : spawnGitAsync
The function sets up data
event handlers for stdout
and stderr
, but it then only awaits the exit
event on the process itself. It is possible for the data
and close
events of the streams to arrive after the exit
event (a late buffer flush, I assume). However, in that case the function will have already returned the empty string that the stdout
variable is intialized to.
@akres - The WSL issue should be fixed in Rush v5.124.7
Confirmed 🙂 I've just done the same test on the same repo and it works fine now.
Relatively few people are using Windows Subsystem for Linux (WSL) with Rush.
In a recent Zulip thread, @Akres encountered some problems where Rush's incremental builds were not calculated correctly:
Reply to this thread with any wisdom, recommendations, or workarounds for WSL+Rush. Then we can write up a website documentation page providing guidance for best practices with WSL.