Does rust work in Cygwin? If so, how can I get it working?

#1

Hello,
I was wondering if you could run Rust in Cygwin (without installing it in windows and calling that windows binary), is it possible or supported?

#2

In theory it should be possible to port Rust to Cygwin, but nobody has done it yet it seems:

There’s the MinGW one, or you could install the Linux ones in WSL.

1 Like
#3

Out of curiosity, what would the benefit of a fully Cygwin version be? (Note that you can install both the MSYS/MinGW version and the MSVC version side by side, and access both from Cygwin.)

#4

Theoretically, Rust for Cygwin would allow you to use fork and similar APIs and still produce executables running on Windows.

1 Like
#5

Rust and cygwin “work”, for some definition of work. But there will always be inconsistencies to varying degrees unless one builds a Rust distribution that uses the cygwin POSIX layer. A notable example of such an inconsistency is path handling. If you’re using a Rust application within cygwin, it will work, to an extent, until you start needing features that rely on cygwin’s path translation.

I wrote at length about this here: https://github.com/BurntSushi/ripgrep/issues/269#issuecomment-439734719