Hi, On Fri, 12 Nov 2021, Adam Dinwoodie wrote: > On Fri, 12 Nov 2021 at 16:01, Junio C Hamano <gitster@xxxxxxxxx> wrote: > > > > Out of curiosity, are the use cases and user base of Cygwin waning, > > or are there still viable cases where Cygwin is a more preferred > > solution over WSL (the question is not limited to use of Git)? > > No formal research here, just impressions as someone who has used > Cygwin for a long time and who hangs out on the Cygwin mailing list: > for a lot of use cases, WSL is at least as good, if not better, than > Cygwin. There are a few areas where Cygwin is still a better solution, > though: > > - WSL requires essentially installing an entire operating system. Disk > space is relatively cheap, so that's not nearly the obstacle it used > to be, but it is an obstacle. This is more relevant for people who > want to distribute packaged installers to Windows users: most > non-technical users won't want to get WSL working, but if you've > written code for *nix and don't want to port it manually to Windows, > it's relatively straightforward to compile it using Cygwin and bundle > the cygwin1.dll file with the installer. That'll mostly get your code > working with a user experience that doesn't differ too much from a > fully native Windows application. (This is essentially what Git for > Windows is doing, albeit with an increasingly distant Cygwin fork.) > > - There are some functions that Cygwin offers that WSL doesn't. The > key one for me is the ability to access Windows network file shares, > which WSL doesn't support (or at least didn't last time I checked). I > expect some of these gaps will disappear as WSL gets more features, > but I expect some of them are fairly fundamental restrictions: Cygwin > applications can have code specifically to handle the fact that > there's a Windows OS there, so they can -- with care -- interact with > the Windows OS directly to (say) use Windows file access APIs or the > Windows clipboard. WSL applications generally don't have that ability; > if I install something from apt on my Debian WSL installation, it'll > pull exactly the same binary as if I'd installed it on a normal Debian > system. I guess in theory people could write code to detect that > they're running in WSL and handle that specially, in the same way that > it's normally possible to detect and handle when you're running in a > VM versus running on bare metal. I expect that'll be much less common, > though, just as Git has code for handling Cygwin specially but doesn't > have code for handling Linux-within-WSL specially, even though both > could be used to access a Git repository stored in the same Windows > NTFS directory. I would like to add two additional scenarios where Cygwin needs to be used instead of WSL: - In order to install WSL, you need to switch your machine to Developer Mode, which requires administrative privileges (which not evey developer enjoys, and given recent and not so recent security news, maybe that's a good thing, too). Cygwin does not require administrative privileges. - There is (finally!) a way to run graphical Linux applications in WSL, but it requires Windows 11. That excludes many existing Windows users. So yeah, I think Cygwin is here to stay. Besides, as long as I don't find any better way to have a POSIX-compliant shell (Git will continue to depend on one for a long, long time, I expect), Git for Windows will indirectly _have_ to depend on Cygwin (Git for Windows bundles a Bash using the MSYS2 runtime, which is a very close fork of the Cygwin runtime). Ciao, Dscho