{"id":613,"date":"2017-06-11T01:21:54","date_gmt":"2017-06-11T01:21:54","guid":{"rendered":"http:\/\/www.vidarholen.net\/contents\/blog\/?p=613"},"modified":"2017-06-11T01:21:54","modified_gmt":"2017-06-11T01:21:54","slug":"compiling-haskell-for-windows-on-travis-ci","status":"publish","type":"post","link":"https:\/\/www.vidarholen.net\/contents\/blog\/?p=613","title":{"rendered":"Compiling Haskell for Windows on Travis CI"},"content":{"rendered":"<p>or: How I finally came around and started appreciating Docker.<\/p>\n<p><strong>tl;dr<\/strong>: ShellCheck is now automatically compiled for Windows using Wine+GHC in Docker, without any need for additional Windows CI.<\/p>\n<p>I don&#8217;t know what initially surprised me more: that people were building ShellCheck on Windows before and without WSL, or that it actually worked.<\/p>\n<p>Unless you&#8217;re a fan of the language, chances are that if you run any Haskell software at all, it&#8217;s one of pandoc, xmonad, or shellcheck. Unlike GCC, Haskell build tools are not something you ever just happen to have lying around.<\/p>\n<p>While Haskell is an amazing language, it doesn&#8217;t come cheap. At 550 MB, GHC, the Haskell Compiler, is the single largest package on my Debian system. On Windows, the Haskell Platform &#8212; GHC plus standard tools and libraries &#8212; weighs in at 4,200 MB.<\/p>\n<p>If you need to build your own software from source, 4 GB of build dependencies unique to a single application is enough to make you reconsider. This is especially true on Windows where you can&#8217;t just close your eyes and hit &#8220;yes&#8221; in your package manager.<\/p>\n<p>Thanks to the awesome individuals who package ShellCheck for various distros, most people have no idea. To them, ShellCheck is just a 5 MB download without external dependencies.<\/p>\n<p>Starting today, this includes Windows users!<\/p>\n<p>This is obviously great for them, but the more interesting story is how this happens.<\/p>\n<p>There&#8217;s no parallel integration with yet another CI system like Appveyor, eating the cost of Windows licenses in the hopes of future business. There&#8217;s not been a rise of a much-needed de facto standard package manager, with generous individuals donating their time. <\/p>\n<p>It&#8217;s also not me booting Windows at home to manually compile executables on every release, nor a series of patches trying to convince GHC to target Windows from GNU\/Linux.<\/p>\n<p><em>It&#8217;s a Docker container with GHC and Cabal running in Wine. <\/em><\/p>\n<p>Ugly? Yes. Does it matter? No. The gory details are all hidden away by Docker.<\/p>\n<p>Anyone, including Travis CI, can now easily and automatically compile ShellCheck (or any other Haskell project for that matter) for Windows in two lines, without a Windows license.<\/p>\n<p>If you want ShellCheck binaries for Windows, they&#8217;re linked to on the <a href=\"https:\/\/github.com\/koalaman\/shellcheck\/\">ShellCheck github repo<\/a>. If you want to take a look at the Docker image, there&#8217;s a <a href=\"https:\/\/github.com\/koalaman\/winghc\">repo for that too<\/a>.<\/p>\n<p>ShellCheck has had an official Docker build for quite a while, but it was contribution (thanks, Nikyle!). I never really had any feelings for Docker, one way or the other. <\/p>\n<p>Consider me converted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>or: How I finally came around and started appreciating Docker. tl;dr: ShellCheck is now automatically compiled for Windows using Wine+GHC in Docker, without any need for additional Windows CI. I don&#8217;t know what initially surprised me more: that people were building ShellCheck on Windows before and without WSL, or that it actually worked. Unless you&#8217;re &hellip; <a href=\"https:\/\/www.vidarholen.net\/contents\/blog\/?p=613\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Compiling Haskell for Windows on Travis CI&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5,4,23,43],"tags":[],"class_list":["post-613","post","type-post","status-publish","format-standard","hentry","category-advanced-linux","category-linux","category-programming","category-windows"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/posts\/613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=613"}],"version-history":[{"count":16,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions"}],"predecessor-version":[{"id":629,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions\/629"}],"wp:attachment":[{"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vidarholen.net\/contents\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}