I have created an app that uses GTK via gi-gtk in Haskell, dependencies managed with stack (lts-9.2). I compiled it successfully on Fedora 26. Then I have successfully executed the binary on other Linux distributions as well.
After a while I wanted to compile the same application on other system (elementary OS). I cloned the repository, called stack setup
in the project directory and then stack build
. It complained about some missing dependencies so I installed them and finally, I got an error from GHC about my own code:
Not in scope: 'GTK.popoverPopdown'
Perhaps you meant one of these:
'GTK.popoverModal' (imported from GI.Gtk)
'GTK.popoverPosition' (imported from GI.Gtk)
Module 'GI.Gtk' does not export 'popoverPopdown'.
Why? As I look at the documentation (https://hackage.haskell.org/package/gi-gtk-3.0.17/docs/GI-Gtk-Objects-Popover.html) there is popoverPopdown
but nothing like popoverModal
or popoverPosition
.
Then I switched to another machine with another Linux distribution (Ubuntu Studio) and got the same error. Finally I took a machine with Fedora 27, did the same and got another error (also inside my app code):
Couldn't match expected type 'Maybe b1'
with actual type 'GTK.Image'
In the second argument of 'GTK.buttonSetImage', namely 'icon'
In a stmt of a 'do' block: btn `GTK.buttonSetImage` icon
Again the documentation (https://hackage.haskell.org/package/gi-gtk-3.0.17/docs/GI-Gtk-Objects-Button.html#g:26) claims something different than GHC. Could somebody explain to me what's going on?
Answering to one of the comments:
Below are what GTK versions are installed in the mentioned systems. Nonetheless GHC complains about Haskell code and I thought all the Haskell code is downloaded from Stackage. Are any dependencies generated locally on my system during stack build
?
- Ubuntu Studio 16.04 LTS: libgtk2.0-0 v2.24.30, libgtk-3-0 v3.18.9
- elementary OS: libgtk2.0-0 v2.24.30, libgtk-3-0 v3.18.9
- Fedora 26: gtk2 v2.24.31, gtk3 v3.22.21
- Fedora 27: gtk2 v2.24.32, gtk3 v3.22.26
buttonSetImage
was changed. Butstack list-dependencies
returnsgi-gtk 3.0.17
. - Adam Głowacki