{"id":124,"date":"2009-08-21T02:06:53","date_gmt":"2009-08-21T09:06:53","guid":{"rendered":"\/?p=124"},"modified":"2010-11-24T21:49:19","modified_gmt":"2010-11-25T05:49:19","slug":"cygwin-is-evil","status":"publish","type":"post","link":"https:\/\/www.slimjimmy.com\/weblog\/archives\/2009\/08\/21\/cygwin-is-evil\/","title":{"rendered":"Cygwin is evil"},"content":{"rendered":"<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Cygwin\">Cygwin<\/a>, a port of various Unix utilities to provide a Unix-like environment on Windows, has been around for a long while.  It&#8217;s well-known; sites such as <a href=\"http:\/\/www.lifehacker.com\/\" class=\"unemphasized\">Lifehacker<\/a> gives tips about using it.  My tip is: <strong>avoid Cygwin unless absolutely necessary<\/strong>.<\/p>\n<p>Cygwin-based tools depend on <kbd>cygwin1.dll<\/kbd>, and <kbd>cygwin1.dll<\/kbd> is obnoxious because:<\/p>\n<ul>\n<li><strong>It&#8217;s DLL-hell squared.<\/strong> You can&#8217;t simultaneously use different Cygwin-based tools that depend on different versions of the <kbd>cygwin1.dll<\/kbd>.  Normally Windows programs can avoid DLL-hell by storing dependent DLLs in the programs&#8217; own directories, but <kbd>cygwin1.dll<\/kbd> goes out of its way to search for other instances of itself.<\/li>\n<li>To avoid that problem, the Cygwin authors discourage developers from bundling <kbd>cygwin1.dll<\/kbd> with their applications and instead want developers to include the Cygwin installer, which automatically fetches the current version from the Internet. Unfortunately, <strong>the Cygwin installer is horrible<\/strong>.  The UI is non-standard and is completely bewildering.  <strong>There is no uninstaller.<\/strong>  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.<\/li>\n<li>The approach of bundling the Cygwin installer is fundamentally flawed anyway.  Even if each application includes the installer, there&#8217;s no guarantee that the current version of <kbd>cygwin1.dll<\/kbd> is compatible with all of them.  <strong>Installing one application could break existing ones.<\/strong>  Did I mention it being DLL-hell squared?<\/li>\n<\/ul>\n<p>So what are people to do?<\/p>\n<ul>\n<li>If you want common Unix command-line utilities, check <a href=\"http:\/\/unxutils.sourceforge.net\/\">UnxUtils<\/a> first, which is a collection of ones that have been ported to run natively on Windows.<\/li>\n<li>If you want  to compile a program written for Linux, try using the <a href=\"http:\/\/www.mingw.org\/\">MinGW<\/a> compiler first.  For command-line programs, there&#8217;s a good chance that MinGW can compile it, and the generated binary won&#8217;t have any cygwin dependencies. (Yes, Cygwin&#8217;s version of <kbd>gcc<\/kbd> has an option to not require <kbd>cygwin1.dll<\/kbd>, but it basically puts it into a MinGW mode anyway.)<\/li>\n<li>If you need a full Linux environment, install Linux in a virtual machine (<a href=\"http:\/\/www.vmware.com\/products\/player\/\">shameless plug<\/a>) or use <a href=\"http:\/\/www.andlinux.org\/\">andLinux<\/a>. (andLinux doesn&#8217;t support 64-bit versions of Windows yet, however.)<\/li>\n<li>If you want an X Server, try <a href=\"http:\/\/www.straightrunning.com\/XmingNotes\/\">Xming<\/a>.<\/li>\n<\/ul>\n<p>I should note that Cygwin is still a necessary evil for stable versions of <kbd>bash<\/kbd> and <kbd>sshd<\/kbd>.  I don&#8217;t know of any good alternative implementations of those.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cygwin, a port of various Unix utilities to provide a Unix-like environment on Windows, has been around for a long while. It&#8217;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&#8217;s DLL-hell squared. You can&#8217;t [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,2],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-programming","category-rantsraves"],"_links":{"self":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":0,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.slimjimmy.com\/weblog\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}