Cygwin is evil

August 21, 2009 at 2:06 am (PT) in Programming, Rants/Raves

Cygwin, a port of various Unix utilities to provide a Unix-like environment on Windows, has been around for a long while. It’s well-known; sites such as Lifehacker gives tips about using it. My tip is: avoid Cygwin unless absolutely necessary.

Cygwin-based tools depend on cygwin1.dll, and cygwin1.dll is obnoxious because:

  • It’s DLL-hell squared. You can’t simultaneously use different Cygwin-based tools that depend on different versions of the cygwin1.dll. Normally Windows programs can avoid DLL-hell by storing dependent DLLs in the programs’ own directories, but cygwin1.dll goes out of its way to search for other instances of itself.
  • To avoid that problem, the Cygwin authors discourage developers from bundling cygwin1.dll with their applications and instead want developers to include the Cygwin installer, which automatically fetches the current version from the Internet. Unfortunately, the Cygwin installer is horrible. The UI is non-standard and is completely bewildering. There is no uninstaller. Making end-users download and run the monolithic Cygwin installer just to get a small command-line tool also violates the Unix philosophy of having small tools for specific tasks.
  • The approach of bundling the Cygwin installer is fundamentally flawed anyway. Even if each application includes the installer, there’s no guarantee that the current version of cygwin1.dll is compatible with all of them. Installing one application could break existing ones. Did I mention it being DLL-hell squared?

So what are people to do?

  • If you want common Unix command-line utilities, check UnxUtils first, which is a collection of ones that have been ported to run natively on Windows.
  • If you want to compile a program written for Linux, try using the MinGW compiler first. For command-line programs, there’s a good chance that MinGW can compile it, and the generated binary won’t have any cygwin dependencies. (Yes, Cygwin’s version of gcc has an option to not require cygwin1.dll, but it basically puts it into a MinGW mode anyway.)
  • If you need a full Linux environment, install Linux in a virtual machine (shameless plug) or use andLinux. (andLinux doesn’t support 64-bit versions of Windows yet, however.)
  • If you want an X Server, try Xming.

I should note that Cygwin is still a necessary evil for stable versions of bash and sshd. I don’t know of any good alternative implementations of those.

Newer: Goodbye, Treo. Hello, Pre!
Older: I’m still not meant to play sports

1 Comment »

  1. wow. that’s some passion about cygwin. yeah, it always felt bloated. it used to be one of the first things i installed on any windows machine, but haven’t needed it in a while. i suppose if i needed to grep anything, i have perl and vim. and i downloaded du on its own. anything else i should be using?

    — Ben @ August 21, 2009, 10:22 pm (PT)

RSS feed for comments on this post.

Leave a comment

(will never be displayed)


Allowed HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>