Skip to content

attempting to use module ‘gi-gtk-3.0.41-inplace:GI.Gtk.Objects.IconFactory’ (./GI/Gtk/Objects/IconFactory.hs) which is not loaded

Summary

When building gi-gtk-3.0.41 with ghc 9.6.1 and -j2 (or above) we get:

[220 of 708] Compiling GI.Gtk.Objects.Settings ( GI/Gtk/Objects/Settings.hs, /run/user/1004/tmp.Gox7zEaBXe/gi-gtk-3.0.41/dist-newstyle/build/x86_64-linux/ghc-9.6.1/gi-gtk-3.0.41/build/GI/Gtk/Objects/Settings.o, /run/user/1004/tmp.Gox7zEaBXe/gi-gtk-3.0.41/dist-newstyle/build/x86_64-linux/ghc-9.6.1/gi-gtk-3.0.41/build/GI/Gtk/Objects/Settings.dyn_o )

<no location info>: error:
    attempting to use module ‘gi-gtk-3.0.41-inplace:GI.Gtk.Objects.IconFactory’ (./GI/Gtk/Objects/IconFactory.hs) which is not loaded

Steps to reproduce

Install ghc 9.6.1, cabal and gtk+ 3 then run

cabal unpack gi-gtk-3.0.41
cd gi-gtk-3.0.41
cabal build --ghc-options=-j2

Expected behavior

The code should compile with -j2 (since it does with -j1).

Environment

I used the following nix-shell to get ghc, cabal and gtk.

$ nix-shell -E '((import (builtins.fetchGit { url="https://github.com/input-output-hk/haskell.nix"; rev = "55702bf3f287c381edd8a8b1ba49b9ab29be7bb0"; }) {}).pkgs-unstable.haskell-nix.hackage-project { compiler-nix-name = "ghc961"; name = "gi-gtk"; version = "3.0.41"; }).shellFor { tools.cabal = {}; }'
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.1

$ cabal --version
cabal-install version 3.10.1.0
compiled using version 3.10.1.0 of the Cabal library

$ pkg-config --modversion gtk+-3.0
3.24.37
  • Operating System: linux
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information