taffybar / gtk-sni-tray

A StatusNotifierHost widget written using the gtk+3 bindings for haskell provided by gi-gtk.
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

compilation error String vs Text #2

Closed kpbochenek closed 6 years ago

kpbochenek commented 6 years ago

I am hitting compilation error:

gtk-sni-tray/src/StatusNotifier/Tray.hs:72:37: error:
    • Couldn't match expected type ‘[Char]’ with actual type ‘T.Text’
    • In the first argument of ‘pixbufNewFromFile’, namely ‘name’
      In the second argument of ‘(<$>)’, namely ‘pixbufNewFromFile name’
      In the expression: Just <$> pixbufNewFromFile name
   |           
72 |     then Just <$> pixbufNewFromFile name
   |                                     ^^^^

Tried with OverloadedStrings but suprisingly didn't help, any idea what could cause that?

kpbochenek commented 6 years ago

Changing to then Just <$> pixbufNewFromFile (T.unpack name) solves issue for me, but does current version on master compiles for you?

colonelpanic8 commented 6 years ago

Current version definitely compiles for me, and if you look at the docs, they indicate that the correct type is T.text (see https://hackage.haskell.org/package/gi-gdkpixbuf-2.0.15/docs/GI-GdkPixbuf-Objects-Pixbuf.html#v:pixbufNewFromFile). A lot of people do seem to be having this issue (See #1). I believe @dongcarl is also seeing this.

@garetxe Might be able to help. You can usually reach him in the gitter haskell-gi chat.

My understanding of all of this is not super solid, but there are three possible causes of this that I can think of:

  1. The haskell-gi build tool that you have installed is too old (or something else is going on with the haskell-gi version)
  2. The actual gir files (gtk/gdk version) that you have on your machine are somehow outdated haskell-gi uses these to generate the code for the relevant libs
  3. The version of gi-gdkpixbuf is cached in your .stack-work as an older version, and needs to be rebuilt.
colonelpanic8 commented 6 years ago

@kpbochenek You should join https://gitter.im/taffybar/Lobby because discussion about this is ongiong there.