Hey all,

I've been following the gtk2hs mailing lists closely for the last few weeks regarding building gtk2hs from darcs against gtk+2.18+ libraries, and with a few alterations and tweaks here and there, have multiple times successfully compiled working versions of gtk2hs for GHC 6.10.4 and 6.12.1 on Windows.

Using these compiled gtk2hs libraries, I have been able to build my own project which runs without issue using win32 gtk+ libraries provided by the official gtk release group. So there's no problem there. (Note: for those having issues building on Windows, feel free to ask me for details)

What I have found however, is that the resulting executable sizes produced by the new gtk2hs bindings produce significantly larger binaries - sometimes between 2 to 5 times larger. (!!!)

I tried the following combinations:
  - ghc 6.10.4  vs  ghc 6.12.1
  - cabalised gtk2hs  vs  non-cabalised gtk2hs (prior to darcs repo rollback)
  - against gtk+ 2.16  vs  against gtk+2.18

Nothing came close to matching the binary size of gtk2hs 0.10.1 (official installer) with ghc-6.10.4.

To give you a rough idea of the resulting sizes I observed (I didn't keep all the binaries, so some of these are from memory):

ghc-6.10.4, gtk2hs-0.10.1 (official), gtk+-2.14: ~4.2mb (original)

ghc-6.10.4, gtk2hs-0.10.1 (non-cabal), gtk+-2.16 & gtk+-2.18: ~4.5mb
ghc-6.10.4, gtk2hs-0.10.5 (cabal), gtk+-2.16 & gtk+-2.18: ~11.8mb

ghc-6.12.1, gtk2hs-0.10.1 (non-cabal), gtk+-2.16 & gtk+-2.18: ~19.1mb
ghc-6.12.1, gtk2hs-0.10.5 (cabal), gtk+-2.16: ~14mb

As you can see, the executable size has increased significantly, and is unreasonably large for my simple project.

Now, preliminary Googling reveals that ghc-6.12.1 does produce significantly larger binaries due to linking of all shared objects and so on (which I do not have any detailed knowledge about. See: http://hackage.haskell.org/trac/ghc/ticket/3840)
I accept this fact, so I have decided to use ghc-6.10.4 instead. However, the executable size increase going from gtk2hs (non-cabal) to gtk2hs (cabal) has stumped me and is, IMO, something I need to see resolved before I release the next version of my project.

Could anyone shed some light as to what might have caused this unreasonable increase in binary size going from non-cabalised to cabalised gtk2hs? Or why the binary size moved in the opposite direction using ghc-6.12.1?
I am happy to continue testing the above configurations (and any other ones) in order to provided more accurate information.