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

Builderror with gdkpixbuf 2.0.26 #24

Closed maralorn closed 3 years ago

maralorn commented 3 years ago

Hey there. While packaging for nixpkgs I encountered this build error, which I assume is related to our gdkpixbuf bump.

Building library for gtk-sni-tray-0.1.6.0..
[1 of 3] Compiling Paths_gtk_sni_tray ( dist/build/autogen/Paths_gtk_sni_tray.hs, dist/build/Paths_gtk_sni_tray.o, dist/build/Paths_gtk_sni_tray.dyn_o )
[2 of 3] Compiling StatusNotifier.TransparentWindow ( src/StatusNotifier/TransparentWindow.hs, dist/build/StatusNotifier/TransparentWindow.o, dist/build/StatusNotifier/TransparentWindow.dyn_o )
[3 of 3] Compiling StatusNotifier.Tray ( src/StatusNotifier/Tray.hs, dist/build/StatusNotifier/Tray.o, dist/build/StatusNotifier/Tray.dyn_o )

src/StatusNotifier/Tray.hs:125:5: error:
    • Couldn't match type ‘Maybe Pixbuf’ with ‘Pixbuf’
      Expected type: IO (Maybe Pixbuf)
        Actual type: IO (Maybe (Maybe Pixbuf))
    • In a stmt of a 'do' block:
        sequenceA $ pixbufNewFromFile <$> maybeFile
      In the expression:
        do trayLogger DEBUG
             $ printf "Trying to load icon %s as filepath" name
           let nameString = T.unpack name
           fileExists <- doesFileExist nameString
           maybeFile <- if fileExists then
                            return $ Just nameString
                        else
                            fmap join
                              $ sequenceA $ getIconPathFromThemePath nameString <$> themePath
           ....
      In a stmt of a 'do' block:
        if hasIcon || hasPanelIcon then
            do let targetName = ...
               trayLogger DEBUG $ printf "Found icon %s in theme" name
               iconThemeLoadIcon themeForIcon targetName size themeLoadFlags
        else
            do trayLogger DEBUG
                 $ printf "Trying to load icon %s as filepath" name
               let nameString = ...
               fileExists <- doesFileExist nameString
               ....
    |
125 |     sequenceA $ pixbufNewFromFile <$> maybeFile
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
colonelpanic8 commented 3 years ago

Thanks for the heads up. I'll try to make a fix soon.

colonelpanic8 commented 3 years ago

@maralorn Is there some way I can reproduce the exact environment of the upgrade. Which version of gdkpixbuf is causing the issue?

maralorn commented 3 years ago

Oh, I am sorry. This happened with version 2.0.26.

You can see the build log here. https://hydra.nixos.org/build/142721509/nixlog/1

If you use nix, you can reproduce this by building nix-build -A haskellPackages.gtk-sni-tray in the root of nixpkgs.

But I guess this will also happen with cabal.

Note: That there is no stackage release with haskell-gi 0.25 yet, so if you use that you might just wanna wait.