6
  • I have a simple, self contained, open source Haskell app that compiles on a Windows system with cabal build. Let's assume it uses one or two nontrivial C libraries, such as OpenGL.
  • I develop on Linux, with no access to a Windows machine.

Question: How do I compile my app to a simple .exe file that Windows users can download and run without further hassles?

Restrictions:

  • No paid-for build services (e.g. AppVeyor)
  • No usage of non-free software on my part (in particular, I won't install Windows)
  • No installation of a Haskell development environment on the client side
  • If possible, no installation of third party software on the client side (e.g. additional libraries etc.)

Some possible solutions:

  • Cross-compilation
  • A free build service (e.g. like travis-ci, but for Windows)
Turion
  • 5,684
  • 4
  • 26
  • 42
  • You want cross-compile? If not, I don't get what's the problem. Setup Windows, install Haskell, compile your program, copy .exe. – arrowd Dec 10 '17 at 12:21
  • 1
    @arrowd, yes, I want to cross-compile or use a free build service. (Windows is non-free.) – Turion Dec 10 '17 at 12:26
  • 2
    At some point you are going to need to install and test your app on a fresh Windows machine to make sure it works there. – Paul Johnson Dec 10 '17 at 12:52
  • 1
    @PaulJohnson, eventually, yes. Let's say at the moment I'm content with relying on a build service for that, or just trust that whatever method of cross-compilation I'd be using works. – Turion Dec 10 '17 at 12:54
  • You could set up a virtual Linux machine and install the Windows version of GHC under Wine. – Paul Johnson Dec 10 '17 at 13:16
  • @PaulJohnson, that's an interesting idea. What kind of virtual machine would I need? Couldn't I install a windows GHC under Wine directly? – Turion Dec 10 '17 at 13:21
  • 1
    @Turion: I didn't quite get that right. You need to *test* the build on a clean machine. Its easy to fail to include all the libraries you need in your installer. It works fine on the build machine because that already has the necessary libraries, but then fails when you install it on a clean machine. So create a clean VM with Wine installed, and then test your build by cloning the clean VM and installing on that, then destroy the clone. – Paul Johnson Dec 10 '17 at 13:28
  • 1
    @PaulJohnson, in theory, it would work, but in practice, wine crashes all the time. Is there no other way? – Turion Dec 12 '17 at 08:55

0 Answers0