Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in haskell-gi cause compilation failures #464

Closed
Magicloud opened this issue Jun 11, 2019 · 41 comments
Closed

Changes in haskell-gi cause compilation failures #464

Magicloud opened this issue Jun 11, 2019 · 41 comments
Labels
bug This issue is a bug that results from taffybar code help wanted Help is wanted on this issue
Milestone

Comments

@Magicloud
Copy link

Due to some changes of gtk3 library, haskell-gi was updated. Hence following command cannot build taffybar.

cabal v1-install --constraint='haskell-gi==0.22.3' --constraint='haskell-gi-base==0.22.1' --force-reinstalls

Error:

[28 of 64] Compiling System.Taffybar.Widget.Util ( src/System/Taffybar/Widget/Util.hs, dist/build/System/Taffybar/Widget/Util.o )

src/System/Taffybar/Widget/Util.hs:67:26: error:
    • Couldn't match expected type ‘Window -> IO GType’
                  with actual type ‘IO GType’
    • The function ‘gobjectType’ is applied to one argument,
      but its type ‘IO GType’ has none
      In a stmt of a 'do' block:
        windowGType <- gobjectType (undefined :: Window)
      In the expression:
        do windowGType <- gobjectType (undefined :: Window)
           Just ancestor <- widgetGetAncestor widget windowGType
           castTo Window ancestor
   |
67 |           windowGType <- gobjectType (undefined :: Window)
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@colonelpanic8 colonelpanic8 added bug This issue is a bug that results from taffybar code help wanted Help is wanted on this issue labels Jun 11, 2019
@colonelpanic8 colonelpanic8 added this to the 3.3.0 milestone Jun 11, 2019
@colonelpanic8
Copy link
Member

Well, it's an easy fix... just a one liner. I'm worried though that fixing this for some will break it for others.

is this coming from changes to the gir files?

@Magicloud
Copy link
Author

The upgrading of haskell-gi is due to gir changes. But this part, I am not sure.

@Magicloud
Copy link
Author

And with that fixed, more comes:

[44 of 64] Compiling System.Taffybar.Context ( src/System/Taffybar/Context.hs, dist/build/System/Taffybar/Context.o )

src/System/Taffybar/Context.hs:160:10: error:
    • Required ancestor ‘GdkX11.X11Window’ not found for type ‘GI.Gdk.Window’.
    • In the instance declaration for
        ‘GdkX11.IsX11Window GI.Gdk.Window’
    |
160 | instance GdkX11.IsX11Window GI.Gdk.Window
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/System/Taffybar/Context.hs:202:12: error:
    • Overlapping instances for GdkX11.IsX11Window GI.Gdk.Window
        arising from a use of ‘GdkX11.x11WindowGetXid’
      Matching instances:
        instance (Gtk.GObject o,
                  Data.GI.Base.Overloading.IsDescendantOf GdkX11.X11Window o) =>
                 GdkX11.IsX11Window o
          -- Defined in ‘GI.GdkX11.Objects.X11Window’
        instance GdkX11.IsX11Window GI.Gdk.Window
          -- Defined at src/System/Taffybar/Context.hs:160:10
    • In a stmt of a 'do' block:
        xid <- GdkX11.x11WindowGetXid gdkWindow
      In the second argument of ‘($)’, namely
        ‘do gdkWindow <- MaybeT $ Gtk.widgetGetWindow window
            xid <- GdkX11.x11WindowGetXid gdkWindow
            lift $ doLowerWindow (fromIntegral xid)’
      In the second argument of ‘($)’, namely
        ‘runMaybeT
           $ do gdkWindow <- MaybeT $ Gtk.widgetGetWindow window
                xid <- GdkX11.x11WindowGetXid gdkWindow
                lift $ doLowerWindow (fromIntegral xid)’
    |
202 |     xid <- GdkX11.x11WindowGetXid gdkWindow
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@colonelpanic8 colonelpanic8 changed the title Unbuildable due to library change. GIR changes in GDKX11 cause compilation failures Jun 11, 2019
@colonelpanic8
Copy link
Member

@Magicloud @brecht_serckx_gitlab can you please post the gtk/gdk versions that you are using that are causing these errors?

@colonelpanic8
Copy link
Member

@LeifW Can you confirm this issue?

@BrechtSerckx
Copy link

@Magicloud @brecht_serckx_gitlab can you please post the gtk/gdk versions that you are using that are causing these errors?

I am on gtk 3.24.8 (1:3.24.8+177+gae2ef1472c-1)

@evanjs
Copy link

evanjs commented Jun 15, 2019

Sorry in advance for the extra noise, I was wondering if these errors are in any way related:

building
[ 1 of 12] Compiling GI.Dbusmenu.Constants ( GI/Dbusmenu/Constants.hs, dist/build/GI/Dbusmenu/Constants.o )

GI/Dbusmenu/Constants.hs:87:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
87 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 12] Compiling GI.Dbusmenu.Enums[boot] ( GI/Dbusmenu/Enums.hs-boot, dist/build/GI/Dbusmenu/Enums.o-boot )

GI/Dbusmenu/Enums.hs-boot:12:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
12 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 12] Compiling GI.Dbusmenu.Objects.Client[boot] ( GI/Dbusmenu/Objects/Client.hs-boot, dist/build/GI/Dbusmenu/Objects/Client.o-boot )

GI/Dbusmenu/Objects/Client.hs-boot:12:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
12 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 5 of 12] Compiling GI.Dbusmenu.Objects.Menuitem[boot] ( GI/Dbusmenu/Objects/Menuitem.hs-boot, dist/build/GI/Dbusmenu/Objects/Menuitem.o-boot )

GI/Dbusmenu/Objects/Menuitem.hs-boot:12:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
12 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Preprocessing library for gi-xlib-2.0.4..
Building library for gi-xlib-2.0.4..

stack.yaml

System:

  • system: "x86_64-linux"
  • host os: Linux 5.1.9, NixOS, 19.09pre182717.b58ada326aa (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(root): "nixos-19.09pre182717.b58ada326aa, nixos-unstable-small-19.09pre182734.b6e10d79e96, nixpkgs, nixpkgs-unstable"
  • channels(evanjs): "home-manager"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

@colonelpanic8
Copy link
Member

@evanjs yes those are likely related.

@colonelpanic8
Copy link
Member

seems like its not the gtk vesrion, but something else going on here.

@colonelpanic8
Copy link
Member

@evanjs yeah I'm getting similar errors in gi-xlib:

[ 1 of 14] Compiling GI.Xlib.Functions ( GI/Xlib/Functions.hs, dist/build/GI/Xlib/Functions.o )

GI/Xlib/Functions.hs:32:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
32 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 14] Compiling GI.Xlib.Structs.Display ( GI/Xlib/Structs/Display.hs, dist/build/GI/Xlib/Structs/Display.o )

GI/Xlib/Structs/Display.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 3 of 14] Compiling GI.Xlib.Structs.Screen ( GI/Xlib/Structs/Screen.hs, dist/build/GI/Xlib/Structs/Screen.o )

GI/Xlib/Structs/Screen.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 14] Compiling GI.Xlib.Structs.Visual ( GI/Xlib/Structs/Visual.hs, dist/build/GI/Xlib/Structs/Visual.o )

GI/Xlib/Structs/Visual.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 5 of 14] Compiling GI.Xlib.Structs.XConfigureEvent ( GI/Xlib/Structs/XConfigureEvent.hs, dist/build/GI/Xlib/Structs/XConfigureEvent.o )

GI/Xlib/Structs/XConfigureEvent.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 6 of 14] Compiling GI.Xlib.Structs.XFontStruct ( GI/Xlib/Structs/XFontStruct.hs, dist/build/GI/Xlib/Structs/XFontStruct.o )

GI/Xlib/Structs/XFontStruct.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 7 of 14] Compiling GI.Xlib.Structs.XImage ( GI/Xlib/Structs/XImage.hs, dist/build/GI/Xlib/Structs/XImage.o )

GI/Xlib/Structs/XImage.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 8 of 14] Compiling GI.Xlib.Structs.XTrapezoid ( GI/Xlib/Structs/XTrapezoid.hs, dist/build/GI/Xlib/Structs/XTrapezoid.o )

GI/Xlib/Structs/XTrapezoid.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 9 of 14] Compiling GI.Xlib.Structs.XVisualInfo ( GI/Xlib/Structs/XVisualInfo.hs, dist/build/GI/Xlib/Structs/XVisualInfo.o )

GI/Xlib/Structs/XVisualInfo.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[10 of 14] Compiling GI.Xlib.Structs.XWindowAttributes ( GI/Xlib/Structs/XWindowAttributes.hs, dist/build/GI/Xlib/Structs/XWindowAttributes.o )

GI/Xlib/Structs/XWindowAttributes.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[12 of 14] Compiling GI.Xlib.Unions.XEvent ( GI/Xlib/Unions/XEvent.hs, dist/build/GI/Xlib/Unions/XEvent.o )

GI/Xlib/Unions/XEvent.hs:31:1: error:
    Could not find module ‘Data.GI.Base.GClosure’
    Perhaps you meant
      Data.GI.Base.Closure (from haskell-gi-base-0.21.5)
      Data.GI.Base.GValue (from haskell-gi-base-0.21.5)
    Use -v to see a list of the files searched for.
   |
31 | import qualified Data.GI.Base.GClosure as B.GClosure
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@Magicloud
Copy link
Author

I am having the same GTK3 as @BrechtSerckx .
I think the problem is due to haskell-gi upgrading. Before the issue, due to cairo packages restriction, haskell-gi < 0.21 (or even earlier, I cannot remember) is used. But now GTK3 got upgraded, I have to put constraint on haskell-gi version, then those issues happened.

@colonelpanic8
Copy link
Member

You guys can check out my solution: https://github.com/taffybar/taffybar/tree/newHaskellGI

@colonelpanic8
Copy link
Member

@colonelpanic8
Copy link
Member

had to set up cachix to get a passing build: https://travis-ci.org/taffybar/taffybar/builds/546567320

@colonelpanic8
Copy link
Member

@evanjs Actually was not able to get errors that were similar to the ones you mention there. What exactly did you do to get those?

@colonelpanic8
Copy link
Member

Anyone building with nix should use https://taffy.cachix.org/ to avoid massive build times when building from source.

@colonelpanic8 colonelpanic8 changed the title GIR changes in GDKX11 cause compilation failures Changes in haskell-gi cause compilation failures Jun 17, 2019
@NickHu
Copy link
Contributor

NickHu commented Jun 18, 2019

@IvanMalison Would you provide some information about your nixpkgs revision? I'm not doing anything too funky - just following nixos-unstable - but I routinely have difficulty getting taffybar (or something in its dependency chain) to build

For instance, on a1dd419c1ffacea87eba066a2bb332e03cb68f66 (currently where nixos-unstable points to) I get this mess:

~ ❯ nix-build '<nixpkgs>' -A taffybar
these derivations will be built:
  /nix/store/y1csh13mqa4wbys3s2979qj901wyvqf5-gi-xlib-2.0.6.drv
  /nix/store/g4lx072p0g52xld35d5cd8f1lrib4wnj-gi-gdkx11-3.0.7.drv
  /nix/store/gw13mcac9rjiin62xf21cjqgv4qdr9qn-gi-dbusmenu-0.4.5.drv
  /nix/store/q43ny2qxf7fmxmk4bpfpynl6mj3mgdac-gi-dbusmenugtk3-0.4.6.drv
  /nix/store/rqvi5sv1a290vbb87npdc7ysxhdpcvbx-gtk-sni-tray-0.1.6.0.drv
  /nix/store/amzfk4jnhr795jzaj6n7hgnqi38vwf3a-taffybar-3.2.0.drv
  /nix/store/qg2xk4lfcwmgijhhrpjdsdkh4sx51z48-ghc-8.6.5-with-packages.drv
  /nix/store/vx7x90xk6g5rv6f4xj5nbpinvw8wgs04-taffybar-with-packages-8.6.5.drv
building '/nix/store/gw13mcac9rjiin62xf21cjqgv4qdr9qn-gi-dbusmenu-0.4.5.drv'...
building '/nix/store/y1csh13mqa4wbys3s2979qj901wyvqf5-gi-xlib-2.0.6.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/vbb3m0wzf54gakv6r2xbsd6jh49lsgd3-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/2kbpp4y563x2sidd5rsfh8zd28jpxnm0-gi-dbusmenu-0.4.5.tar.gz
source root is gi-dbusmenu-0.4.5
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file gi-dbusmenu-0.4.5/stack.yaml
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
setupCompilerEnvironmentPhase
Build with /nix/store/vbb3m0wzf54gakv6r2xbsd6jh49lsgd3-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/g9ayn7il2grwmpknc7m92ppbmy6xvq8r-gi-xlib-2.0.6.tar.gz
source root is gi-xlib-2.0.6
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file gi-xlib-2.0.6/xlib.overrides
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/3vz454kd9w9ycxxskidwq0x6rqv70bv8-gi-dbusmenu-0.4.5 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/ca7z2mfmlfpmj1nii222p8rwf07b222q-gi-dbusmenu-0.4.5-doc/share/doc/gi-dbusmenu-0.4.5 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/wl1xil3z3x06pi5xc3r29vzgbfvf5ckj-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/0f1dhbhnxmm6yc2msmxy7bwsyq6xcvvb-libffi-3.2.1/lib --extra-lib-dirs=/nix/store/wdqvks4hvnvrx842rwv4sagx55smy5n1-gmp-6.1.2/lib --extra-include-dirs=/nix/store/dxbi96m44syc1mjmg2bfvyrlzbydk182-libdbusmenu-glib-16.04.0/include --extra-lib-dirs=/nix/store/dxbi96m44syc1mjmg2bfvyrlzbydk182-libdbusmenu-glib-16.04.0/lib --extra-include-dirs=/nix/store/a6vglryqvlx5cy0cqvbf3gkxi5bn8gzc-gobject-introspection-1.60.1-dev/include --extra-lib-dirs=/nix/store/a6vglryqvlx5cy0cqvbf3gkxi5bn8gzc-gobject-introspection-1.60.1-dev/lib --extra-include-dirs=/nix/store/8977h7yhy20ncal4aqh2057n58yndf2n-libffi-3.2.1-dev/include --extra-lib-dirs=/nix/store/8977h7yhy20ncal4aqh2057n58yndf2n-libffi-3.2.1-dev/lib --extra-lib-dirs=/nix/store/0f1dhbhnxmm6yc2msmxy7bwsyq6xcvvb-libffi-3.2.1/lib --extra-include-dirs=/nix/store/z21kf00wgrmrq5511sc9zxq7p6wwf9m6-glib-2.60.3-dev/include --extra-lib-dirs=/nix/store/z21kf00wgrmrq5511sc9zxq7p6wwf9m6-glib-2.60.3-dev/lib --extra-include-dirs=/nix/store/1j4ddkr6gc6jckyg4vnqirs8rh3bl25f-zlib-1.2.11-dev/include --extra-lib-dirs=/nix/store/1j4ddkr6gc6jckyg4vnqirs8rh3bl25f-zlib-1.2.11-dev/lib --extra-lib-dirs=/nix/store/kgh9da41mpy9rlvcn9iglkykcn90cm37-zlib-1.2.11/lib --extra-include-dirs=/nix/store/kv65x8xhs4yrbh1j2shjsn6645av5gc1-gettext-0.19.8.1/include --extra-lib-dirs=/nix/store/kv65x8xhs4yrbh1j2shjsn6645av5gc1-gettext-0.19.8.1/lib --extra-include-dirs=/nix/store/6n7flgivz6gfm3x7nrq92arpbh76gdn8-glibc-iconv-2.27/include --extra-lib-dirs=/nix/store/93l25j35s3j6c0k58aq498yx4rwk1w39-glib-2.60.3/lib --extra-lib-dirs=/nix/store/lzcvc4w2p4qb8qf18kljigdnxg9p0z9b-gobject-introspection-1.60.1/lib
Using Parsec parser
Configuring gi-dbusmenu-0.4.5...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:124:42 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainWithHooks, called at lib/Data/GI/CodeGen/CabalHooks.hs:88:5 in haskell-gi-0.21.5-5kFcjOghmlWKSzdDI68hGW:Data.GI.CodeGen.CabalHooks
Setup: Encountered missing dependencies:
haskell-gi >=0.22.0 && <0.23, haskell-gi-base >=0.22.0 && <0.23

builder for '/nix/store/gw13mcac9rjiin62xf21cjqgv4qdr9qn-gi-dbusmenu-0.4.5.drv' failed with exit code 1
cannot build derivation '/nix/store/qg2xk4lfcwmgijhhrpjdsdkh4sx51z48-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vx7x90xk6g5rv6f4xj5nbpinvw8wgs04-taffybar-with-packages-8.6.5.drv': 1 dependencies couldn't be built
error: build of '/nix/store/vx7x90xk6g5rv6f4xj5nbpinvw8wgs04-taffybar-with-packages-8.6.5.drv' failed

@colonelpanic8
Copy link
Member

colonelpanic8 commented Jun 18, 2019

@NickHu yes, taffybar is broken in nixpkgs unstable right now. The error you are are seeing there is actually in the compilation of gi-dbusmenu, which needs a version of haskell-gi that is newer than what is there.

Recently, I've added/fixed a few nix files to the taffybar repository that should help you get taffybar working with nix/in nixos. I'm planning to continue to maintain these files moving forward together with https://taffy.cachix.org/ (currently, I may be getting control of https://taffybar.cachix.org/ but not sure). The only catch is that they will be set up to work with whatever is in master rather than e.g. the latest release.

Let me explain what each file does:

  • overlay.nix: This is a nixpkgs overlay that overrides the versions of haskell packages to make taffybar builds succeed
  • nixpkgs.nix: This file just provides a pin of nixpkgs to some version
  • default.nix: This will build the taffybar library from the source directory (uses nixpkgs.nix and overlay.nix)
  • shell.nix: This gives you a nix shell that you can use for taffybar development

If you use the nixos module for taffybar to build your taffybar executable, then you should be able to simply add the overlay to your system configuration like:

nixpkgs.overlays = [
   (import ./path/to/overlay/overlay.nix)
];

If you install taffybar as a user package, you'll need to do something simlar in your user level nix config.

If you have a haskell project for your taffybar configuration, you can take a look at what I do:

https://github.com/IvanMalison/dotfiles/blob/master/dotfiles/config/taffybar/default.nix

I don't think you will NEED to pin nixpkgs to any particular version, but you will need to be on a sufficiently new version of nixpkgs for this to work. Also, note that this will likely require quite a lot of recompilation time because we are overriding a ton of haskell-gi libraries. One way to avoid this is to use the cachix instance I have set up at https://taffy.cachix.org/, but that WILL require that you use the version of nixpkgs pinned in nixpkgs.nix.

It occurs to me that it might be valuable to separate the override of taffybar itself from the override of its dependencies in case users want to use the overlay without building from source. I'm going to look in to doing this right now.

UPDATE:

There is now a separate environment.nix file, which you can use to fix all of taffybar's dependencies without overriding the version of taffybar, so that e.g. you can use a stable version if you want.

@colonelpanic8
Copy link
Member

@NickHu Do let me know if you are able to get things working with the overlay. You can reach me on gitter if you need help.

@NickHu
Copy link
Contributor

NickHu commented Jun 19, 2019

Thanks for all your help @IvanMalison, I was able to get it working with home-manager by

  1. cloning taffybar's repo
  2. setting nixpkgs.overlays = [ (import ./path/to/taffybar/overlay.nix) ];

@NickHu yes, taffybar is broken in nixpkgs unstable right now. The error you are are seeing there is actually in the compilation of gi-dbusmenu, which needs a version of haskell-gi that is newer than what is there.

Could you perhaps summarise what's going on with respect to this, Hackage, and nixpkgs? From what I discerned when I was trying to debug this myself, some things in the dependency chain want haskell-gi >= 0.22 (gi-dbusmenu or one of its dependencies being one of them), but gi-cairo-render wants < 0.22 right? There's also a bunch of Haskell nix expressions which are broken, e.g. haskell-gi_0_22_4 (i.e. the newer version) because in the nix expression it depends on haskell-gi-base (< 0.22) instead of haskell-gi-base_0_22_2.

@evanjs
Copy link

evanjs commented Jun 19, 2019

Likewise
My build is finally repeatable (without stack or cabal files)
Thanks, @IvanMalison

@colonelpanic8
Copy link
Member

@NickHu @evanjs Curious whether chachix worked for you or not. Doesn't seem like you pinned nixpks so I'm guessing not. Did you not have massive compile times?

@colonelpanic8
Copy link
Member

colonelpanic8 commented Jun 19, 2019

Could you perhaps summarise what's going on with respect to this, Hackage, and nixpkgs? From what I discerned when I was trying to debug this myself, some things in the dependency chain want haskell-gi >= 0.22 (gi-dbusmenu or one of its dependencies being one of them), but gi-cairo-render wants < 0.22 right? There's also a bunch of Haskell nix expressions which are broken, e.g. haskell-gi_0_22_4 (i.e. the newer version) because in the nix expression it depends on haskell-gi-base (< 0.22) instead of haskell-gi-base_0_22_2

Yeah, that's all roughly correct. The only unsatisfiable depdendency was haskell-gi, but this was fixed easily by simply updating gi-cairo-render's version bound, which was just a cabal file edit.

That's why the overlay has this:

revision = "1";

See NixOS/nixpkgs#63500 for more details. They basically recommend something along the lines of #141, so that this doesn't happen again, but I think that might be quite hard.

@NickHu
Copy link
Contributor

NickHu commented Jun 20, 2019

@NickHu @evanjs Curious whether chachix worked for you or not. Doesn't seem like you pinned nixpks so I'm guessing not. Did you not have massive compile times?

Correct, because I didn't pin nixpkgs, I had to compile everything as expected. The build time wasn't horrible (on my desktop machine) - probably around half an hour but I didn't actually check. If you have money/servers to burn, maybe we could set up a hydra instance to build and push to cachix every time nixos-unstable advances (which doesn't seem to be terribly frequently anyway).

@colonelpanic8
Copy link
Member

If you have money/servers to burn, maybe we could set up a hydra instance to build and push to cachix every time nixos-unstable advances (which doesn't seem to be terribly frequently anyway).

Yeah I don't think that's a particularly great solution because:

  • nixpkgs changes frequently enough that we would be building pretty frequently
  • we'd either have to figure out how to purge things from the cache and say you have to be on the absolute latest from unstable or store tons of stuff in the cache

The build time wasn't horrible (on my desktop machine) - probably around half an hour but I didn't actually check.

Lol. 30 minutes is pretty horrible in my book. That's long enough to be a pretty significant turn off to a lot of people. I think #141 is the long term solution, but at this point I'm just frustrated at how active I have to be in maintaining taffybar. Shit is constantly breaking, and I get the sense that people feel (justifiably) that taffybar offers a really unstable experience on a lot of fronts API/Dependencies/Stability of application itself.

Sorry for the rant, I just hate experiences like that as an end user and I'm frustrated that I can't do better here for reasons beyond my control.

@cjordan
Copy link
Contributor

cjordan commented Jun 20, 2019

FWIW @IvanMalison, I really appreciate and admire the effort you put in! taffybar can be annoying at times, but it's glorious when it all works, and it wouldn't be possible without your frustration.

@NickHu
Copy link
Contributor

NickHu commented Jun 20, 2019

Completely echo @cjordan's comment @IvanMalison, I also really appreciate all the work you put in to taffybar, especially considering that you effectively revived it after it died.

I know that nixpkgs changes very frequently, but nixos-unstable as a channel doesn't advance that often as far as I can see. I would guess it ranges anywhere between 0-4 times a week (depending on how many nixos tests are failing). I'm not too sure what you mean about figuring out how to purge things from the cache. I'd propose something like this: every time nixos-unstable advances, compile both taffybar master and taffybar latest stable release and push to cachix. That way, people who point their system configuration to nixos-unstable can benefit from cachix every time they update, and if they want to do taffybar development or use nixpkgs-unstable then they would probably be expecting to compile a lot of stuff anyway.

@colonelpanic8
Copy link
Member

I'm not too sure what you mean about figuring out how to purge things from the cache. I'd propose something like this: every time nixos-unstable advances, compile both taffybar master and taffybar latest stable release and push to cachix. That way, people who point their system configuration to nixos- unstable can benefit from cachix every time they update, and if they want to do taffybar development or use nixpkgs-unstable then they would probably be expecting to compile a lot of stuff anyway.

I guess you can't see this unless you are an administrator of the cache, but the taffy cachix instance is currently 546MB. If we keep pushing to cachix every time there is a change in nixpkgs I'm pretty sure we will quickly hit some limit. The only solution I can think of is to purge cachix every now and then, but that means we will only be supporting VERY recent versions of nixpkgs, which is fine, I guess, but if the goal is to keep build times down, might not be that useful for people who use taffybar in their system configuration because bumping nixpkgs will probably cause a simlarly long recompilation.

I can try just optimistically pushing to cachix every time the unstable channel changes, but I don't want to be a dick to the cachix people, who have set up something amazing completely free.

@sondr3
Copy link

sondr3 commented Feb 2, 2020

I'm attempting to use the overlay but it's now failing on me because of the check for CI:

sudo nixos-rebuild switch
[sudo] password for sondre: 
building Nix...
building the system configuration...
fatal: '/nix/store/6nzd8hxc170384l68qrf7yqp7x4wkgpg-source' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: program 'git' failed with exit code 128
(use '--show-trace' to show detailed location information)

and I asked on IRC about this and was told that this overlay is not pure and therefore won't be able to build on my machine.

@colonelpanic8
Copy link
Member

@sondr3 Are you sure the overlay is still necessary. I thought haskell-gi had been bumped to a pretty reasonable version quite some time ago.

The overlay was designed to work with a git repository, but it looks like you are trying to use it with some other type of source. All you'll need to do is edit the overlay to make sourceTransformer the identity, i.e. sourceTransformer = x: x and it should work.

@evanjs
Copy link

evanjs commented Feb 3, 2020

@IvanMalison it isn't in my case, at least (here and here)

@sondr3 had mentioned taffybar is marked broken in nixpkgs, but IIRC, this is only the haskellPackages package, not taffybar-with-packages in all-packages.

The only other issue I'm aware of at the moment is NixOS/nixpkgs#77588, which can be worked around (most lazily) by not using the current unstable channel.

@sondr3
Copy link

sondr3 commented Feb 3, 2020

How would I be able to use the taffybar package in haskellPackages for XMonad if it is marked as broken? Or can I just use tell home-manager to use XMonad as my display manager and then configure XMonad through Cabal?

@evanjs
Copy link

evanjs commented Feb 3, 2020

How would I be able to use the taffybar package in haskellPackages for XMonad if it is marked as broken? Or can I just use tell home-manager to use XMonad as my display manager and then configure XMonad through Cabal?

I actually build taffybar via cabal (via nix) and import taffybar (nixos.taffybar-with-packages, not nixos.haskellPackages.taffybar) into home-manager.users.<user>.xsession.windowManager.xmonad.extraPackages here.

@dmvianna
Copy link

I am using overlay.nix and this current master with nixos-20.03, and it still breaks with gi-gdkx11-4.0.1.

@PierreR
Copy link
Contributor

PierreR commented May 27, 2020

For info, what has been working for me, is to use the unstable channel for xmonad & taffybar in my overlays.

@PierreR
Copy link
Contributor

PierreR commented May 27, 2020

@IvanMalison would be nice to have a static binary (as it is the case for dhall for instance) instead of relying on nixpkgs source. I don't think haskellPackages is trying to have a working package set targeted for a nixpkgs stable release.

@colonelpanic8
Copy link
Member

@PierreR taffybar is now in stackage (haskell-gi already was), and nixpkgs uses stackage to form the basis of its package sets. This means that breakage in haskellPackages should not happen anymore.

@colonelpanic8
Copy link
Member

@dmvianna Unfortunately some crucial fixes did not make it in to nixos-20, so taffybar is only fixed in unstable atm (as mentioned by @PierreR)

Furthermore, I changed the overlays to basically be empty because everything is now fixed (the overlays were mainly intended to successfully build in CI).

A version of the overlay that should fix everything can be found here:

addGObjectIntrospection = hpackage: pkgs.haskell.lib.overrideCabal hpackage (current: {

@dmvianna
Copy link

I also had to rename gdk_pixbuf to gdk-pixbuf in that file. Then I got

Setup: Encountered missing dependencies:
haskell-gi >=0.23.0 && <0.24, haskell-gi-base ==0.23.*

@colonelpanic8
Copy link
Member

@dmvianna can you post the exact configuration that you are running?

@colonelpanic8
Copy link
Member

@dmvianna or you know, consider just running unstable (its pretty safe with nixos since you have rollbacks anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug that results from taffybar code help wanted Help is wanted on this issue
Projects
None yet
Development

No branches or pull requests

9 participants