Nix/NixOS users have been complaining that the taffybar haskell package seems to be broken in the latest versions of nixpkgs. It seems that this breakage is due to the fact that old versions of haskell-gi and packages generated from it are on old versions.
I've written an overlay, that bumps the relevant packages to the versions needed to make everything work here:
What needs to be done to bump the versions of those packages in haskellPackages. @peti
Nixpkgs follows the version recommendations from LTS Haskell 13.x [1]. Ignoring those recommendations to fix taffybar
may have the unintended consequence of breaking (possibly many) other packages that rely on this environment. The list of changes taffybar seems to need looks substantial. I don't think we can realistically update all those packages. IMHO, the best solution would be if taffybar
would be a part of the LTS package set -- then it would be pretty much guaranteed that it compiles in Nixpkgs (and many others that rely on LTS). I'm not sure how to go forward with this. I suppose we could add an overrideScope
for taffybar
specifically that contains those version in a local build scope. It's vetry unpleasant (and brittle) to maintain that kind of override, but it would probably work.
@peti How are versions for hackage packages that do not appear in stackage selected?Is the latest version simply always used?
Seems like a good possible short term solution might be to simply use a slightly older version of taffybar (e.g. 3.1.2) which did seem to work with the previous package set.
We would need to do the same with a few broken haskell-gi packages. I imagine that this won't work if there is no way to use older versions of packages that are outside of stackage.
How are versions for hackage packages that do not appear in stackage selected?Is the latest version simply always used?
Yes. The latest version is always included in Nixpkgs, and for non-Stackage packages that is also the default version.
Seems like a good possible short term solution might be to simply use a slightly older version of taffybar (e.g. 3.1.2) which did seem to work with the previous package set.
Yes, that seems like a good idea.
Yes. The latest version is always included in Nixpkgs, and for non-Stackage packages that is also the default version.
Yes, that seems like a good idea.
It's not clear to me from this comment whether it is possible/normal to use an old version of a package (not included in stackage) in nixpkgs because the first comment seems to indicate that the answer is no but the second seems to indicate the answer is yes. Can you clarify?
In any case, I have opened https://github.com/commercialhaskell/stackage/pull/4630 to get taffybar in to stackage, but that will only work once stackage moves their the version of haskell-gi to 0.22.6 in lts which is likely to be a while, I think.
That is obviously the long term fix, but I would like to resolve this before then because this breakage seems to be causing quite a bit of confusion.
I suppose we could add an
overrideScope
fortaffybar
specifically that contains those version in a local build scope. It's very unpleasant (and brittle) to maintain that kind of override, but it would probably work.
I am also open to volunteer to help maintain this, though as I understand it all of the haskell stuff goes through you so I might not be able to actually do all that much.
I am already maintaining the an overlay over the current nixpkgs that does work though, so you should be able to lift all the version numbers from there if we do go that route https://github.com/taffybar/taffybar/blob/b3ca25b0f6656f2da97c8701247519f9300a28c3/environment.nix#L17
It's not clear to me from this comment whether it is possible/normal to use an old version of a package (not included in stackage) in nixpkgs because the first comment seems to indicate that the answer is no but the second seems to indicate the answer is yes.
Yes, of course it is possible. Just add the appropriate version spec to https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-hackage2nix.yaml#L45.
Closed in #79735
Seems like it's broken again, because gi-pango fails to build (see here - possibly due to harfbuzz updates). Upgrading gi-pango to the version based on haskell-gi-base 0.24 fixes it, but it needs a whole load of other stuff to change too; my overlay:
self: super:
{
haskellPackages = with self.haskell.lib; super.haskellPackages.extend (hself: hsuper: {
gi-atk = hself.gi-atk_2_0_22;
gi-cairo = hself.gi-cairo_1_0_24;
gi-cairo-render = overrideCabal (hsuper.gi-cairo-render) (drv: {
src = self.fetchFromGitHub {
owner = "thestr4ng3r";
repo = "gi-cairo-render";
rev = "8727c43cdf91aeedffc9cb4c5575f56660a86399";
sha256 = "16kqh2ck0dad1l4m6q9xs5jqj9q0vgpqrzb2dc90jk8xwslmmhxd";
};
editedCabalFile = null;
postUnpack = ''
mv source all
mv all/gi-cairo-render source
'';
});
gi-dbusmenu = hself.gi-dbusmenu_0_4_8;
gi-dbusmenugtk3 = hself.gi-dbusmenugtk3_0_4_9;
gi-gdk = overrideSrc hsuper.gi-gdk {
src = self.fetchurl {
url = "https://hackage.haskell.org/package/gi-gdk-3.0.23/gi-gdk-3.0.23.tar.gz";
sha256 = "18v3kb6kmryymmrz0d88nf25priwyh3yzh7raghc5ph2rv7n4w8m";
};
version = "3.0.23";
};
gi-gdkpixbuf = hself.gi-gdkpixbuf_2_0_24;
gi-gdkx11 = overrideSrc hsuper.gi-gdkx11 {
src = self.fetchurl {
url = "https://hackage.haskell.org/package/gi-gdkx11-3.0.10/gi-gdkx11-3.0.10.tar.gz";
sha256 = "0kfn4l5jqhllz514zw5cxf7181ybb5c11r680nwhr99b97yy0q9f";
};
version = "3.0.10";
};
gi-gio = hself.gi-gio_2_0_27;
gi-glib = hself.gi-glib_2_0_24;
gi-gobject = hself.gi-gobject_2_0_24;
gi-gtk = overrideSrc hsuper.gi-gtk {
src = self.fetchurl {
url = "https://hackage.haskell.org/package/gi-gtk-3.0.36/gi-gtk-3.0.36.tar.gz";
sha256 = "0bzb3xrax5k5r5fd6vv4by6hprmk77qrqr9mqn3dxqm6an8jwjn9";
};
version = "3.0.36";
};
gi-gtk-hs = hself.gi-gtk-hs_0_3_9;
gi-harfbuzz = markUnbroken hsuper.gi-harfbuzz;
gi-pango = hself.gi-pango_1_0_23;
gi-xlib = hself.gi-xlib_2_0_9;
haskell-gi = hself.haskell-gi_0_24_3;
haskell-gi-base = addBuildDepend hself.haskell-gi-base_0_24_2 self.gobject-introspection;
taffybar = appendPatch hsuper.taffybar (self.fetchpatch {
url = "https://github.com/taffybar/taffybar/pull/494/commits/a7443324a549617f04d49c6dfeaf53f945dc2b98.patch";
sha256 = "0prskimfpapgncwc8si51lf0zxkkdghn33y3ysjky9a82dsbhcqi";
});
});
}
By the way, both times when I've had to bump haskell package versions, say for a package X
from version 0.1.1 to 0.1.2, I end up in a situation where there's nix expression X
and X_0_1_2
, and X_0_1_2
actually doesn't build because none of its dependencies are up-to-date, and I have to manually go up the dependency tree to bump versions too (like here). It seems to be possible in principle to avoid this when generating hackage-packages.nix.
The expression for gi-cairo-render
could probably be made neater with some form of appendPatch
/overrideCabal
, but overrideCabal
complains if you set patchFlags
(necessary because the repository https://github.com/taffybar/gi-cairo-render/ contains two packages, and the patch https://github.com/taffybar/gi-cairo-render/pull/1 is relative to this directory) - actually, this patch doesn't apply cleanly to master anyway...
I can confirm this issue. The overlay pasted above solves the problem for me too.
@maralorn merged a PR that gets gi-pango working (along with a bunch of related gi-* packages):
https://github.com/NixOS/nixpkgs/pull/95434/files
It may be easier to get Taffybar working now with this PR merged in.
Also, note that the branch off date for 20.09 is approaching, so if you're interested in Taffybar working in the next release, I'd recommend sending a PR for this over the next week or two:
Well, I profited mainly from the work done in this issue. I guess for taffybar to work there would only be 2 or 3 overrides missing. I only didn’t just include them because they were using source overrides were I would prefer an upstream fix/patch. But for getting it into 20.09 I would encourage a pragmatic solution over no solution.
New overlay in light of recent merges:
self: super:
{
haskellPackages = with self.haskell.lib; super.haskellPackages.extend (hself: hsuper: {
gi-cairo-render = overrideCabal (hsuper.gi-cairo-render) (drv: {
src = self.fetchFromGitHub {
owner = "thestr4ng3r";
repo = "gi-cairo-render";
rev = "8727c43cdf91aeedffc9cb4c5575f56660a86399";
sha256 = "16kqh2ck0dad1l4m6q9xs5jqj9q0vgpqrzb2dc90jk8xwslmmhxd";
};
editedCabalFile = null;
postUnpack = ''
mv source all
mv all/gi-cairo-render source
'';
});
gi-dbusmenu = hself.gi-dbusmenu_0_4_8;
gi-dbusmenugtk3 = hself.gi-dbusmenugtk3_0_4_9;
gi-gdk = hself.gi-gdk_3_0_23;
gi-gdkx11 = overrideSrc hsuper.gi-gdkx11 {
src = self.fetchurl {
url = "https://hackage.haskell.org/package/gi-gdkx11-3.0.10/gi-gdkx11-3.0.10.tar.gz";
sha256 = "0kfn4l5jqhllz514zw5cxf7181ybb5c11r680nwhr99b97yy0q9f";
};
version = "3.0.10";
};
gi-gtk-hs = hself.gi-gtk-hs_0_3_9;
gi-xlib = hself.gi-xlib_2_0_9;
gtk-sni-tray = markUnbroken (hsuper.gtk-sni-tray);
gtk-strut = markUnbroken (hsuper.gtk-strut);
taffybar = markUnbroken (appendPatch hsuper.taffybar (self.fetchpatch {
url = "https://github.com/taffybar/taffybar/pull/494/commits/a7443324a549617f04d49c6dfeaf53f945dc2b98.patch";
sha256 = "0prskimfpapgncwc8si51lf0zxkkdghn33y3ysjky9a82dsbhcqi";
}));
});
}
So what needs to be done for this to make it into 20.09?
I pulled some changes from @meck, and am able to build, but am still encountering issues with my xmonad-contrib override, and would love to see this fixed in-tree.
Thanks guys!
@evanjs a new version of gi-cairo-connector is needed
Here's my latest version of the overlay I'm using. It's basically the same as the last one, only a few more things get markUnbroken
:
self: super:
{
haskellPackages = with self.haskell.lib; super.haskellPackages.extend (hself: hsuper: {
gi-cairo-connector = markUnbroken (hsuper.gi-cairo-connector);
gi-cairo-render = markUnbroken (overrideCabal (hsuper.gi-cairo-render) (drv: {
src = self.fetchFromGitHub {
owner = "thestr4ng3r";
repo = "gi-cairo-render";
rev = "8727c43cdf91aeedffc9cb4c5575f56660a86399";
sha256 = "16kqh2ck0dad1l4m6q9xs5jqj9q0vgpqrzb2dc90jk8xwslmmhxd";
};
editedCabalFile = null;
postUnpack = ''
mv source all
mv all/gi-cairo-render source
'';
}));
gi-dbusmenu = markUnbroken (hself.gi-dbusmenu_0_4_8);
gi-dbusmenugtk3 = markUnbroken (hself.gi-dbusmenugtk3_0_4_9);
gi-gdk = hself.gi-gdk_3_0_23;
gi-gdkx11 = markUnbroken (overrideSrc hsuper.gi-gdkx11 {
src = self.fetchurl {
url = "https://hackage.haskell.org/package/gi-gdkx11-3.0.10/gi-gdkx11-3.0.10.tar.gz";
sha256 = "0kfn4l5jqhllz514zw5cxf7181ybb5c11r680nwhr99b97yy0q9f";
};
version = "3.0.10";
});
gi-gtk-hs = markUnbroken (hself.gi-gtk-hs_0_3_9);
gi-xlib = markUnbroken (hself.gi-xlib_2_0_9);
taffybar = markUnbroken (appendPatch hsuper.taffybar (self.fetchpatch {
url = "https://github.com/taffybar/taffybar/pull/494/commits/a7443324a549617f04d49c6dfeaf53f945dc2b98.patch";
sha256 = "0prskimfpapgncwc8si51lf0zxkkdghn33y3ysjky9a82dsbhcqi";
}));
gtk-sni-tray = markUnbroken (hsuper.gtk-sni-tray);
gtk-strut = markUnbroken (hsuper.gtk-strut);
});
}
With respect to fixing this in-tree, I think https://github.com/taffybar/taffybar/pull/494 and https://github.com/taffybar/gi-cairo-render/pull/1 need to be merged (cc @IvanMalison) - those are the patches that I apply in this overlay
Just wanted to share my config which is basically the same same with the following exceptions:
I'm currently using gi-cairo-render
and gi-cairo-connector
from the original repo, which was recently updated. I think the upstream https://github.com/cohomology/gi-cairo-render should probably be merged into the (AFAIK) hackage maintained https://github.com/taffybar/gi-cairo-render. Or probably as the upstream seems to be maintained again, use the original repo as hackage source?
Here are the different packages (gi-cairo-render
and gi-cairo-connector
) compared to @NickHu s config:
let
gi-cairo-render-src = self.fetchFromGitHub {
owner = "cohomology";
repo = "gi-cairo-render";
rev = "051de28ff092e0be0dc28612c6acb715a8bca846";
sha256 = "1v9kdycc91hh5s41n2i1dw2x6lxp9s1lnnb3qj6vy107qv8i4p6s";
};
in
{
gi-cairo-render = markUnbroken (overrideCabal (hsuper.gi-cairo-render)
(drv: {
src = gi-cairo-render-src;
editedCabalFile = null;
postUnpack = ''
mv source all
mv all/gi-cairo-render source
'';
}));
gi-cairo-connector = markUnbroken
(overrideCabal (hsuper.gi-cairo-connector) (drv: {
src = gi-cairo-render-src;
editedCabalFile = null;
postUnpack = ''
mv source all
mv all/gi-cairo-connector source
'';
}));
}
@Philipp-M @cohomology has been given access to the hackage package and has already done what you suggest, I believe.
I think that repository will become the canonical one moving forward.
I recently merged a pull request from @thestr4ng3r, which makes gi-cairo-render
buildable with haskell-gi >=0.24
. The new version 0.1.0
of both gi-cairo-render
and gi-cairo-connector
are on hackage.
@peti @cohomology I can't build taffybar, but its dependencies built for me in my local overlay with:
gi-xlib = assert osuper.gi-xlib.version == "2.0.8";
markUnbroken osuper.gi-xlib_2_0_9;
gi-gdkx11 =
addBuildDepends (oself.callHackage "gi-gdkx11" "3.0.10" {}) [ self.gtk3 ];
gi-dbusmenu = assert osuper.gi-dbusmenu.version == "0.4.7";
markUnbroken osuper.gi-dbusmenu_0_4_8;
gi-dbusmenugtk3 = assert osuper.gi-dbusmenugtk3.version == "0.4.8";
markUnbroken osuper.gi-dbusmenugtk3_0_4_9;
The `gi-gtkx11.3.0.10" could be included in place of the gi-gtkx11_4_0_2 version which is dependent on gtk4. Is anyone experimenting with that here?
Although taffybar still has build errors, it would let me build my own set of gtk programs.
Although stackage lts-16.xx
is still on the old haskell-gi
setup, the newer nightly builds use haskell-gi-0.24.5
and they are probably just waiting
for the ghc-9.x.x release and lts-16.xx is truely obsolete, and everything gets broken again. :-|
@barryfm
Although stackage lts-16.xx is still on the old haskell-gi setup, the newer nightly builds use haskell-gi-0.24.5
We had to make this change because nixpkgs started packaging a newer pango
, so it was the only way to get our haskell-gi
packages working again: https://github.com/NixOS/nixpkgs/pull/95434
The `gi-gtkx11.3.0.10" could be included in place of the gi-gtkx11_4_0_2 version which is dependent on gtk4. Is anyone experimenting with that here?
That sounds like a good idea to me, and it goes along with the similar override for gi-gdkx11
. Please feel free to send a PR implementing this.
btw. lts-16.x.x contains ghc 8.8. I don‘t see what that has to do with ghc-9.x.x.? Although you are right, next lts release will probably happen in the next 3 months.
Taffybar
won't builld without a custom overlays in nixos-20.09
? Is that correct ?
I have had a go with "https://releases.nixos.org/nixos/20.09/nixos-20.09beta992.7badbf18c45/nixos-minimal-20.09beta992.7badbf18c45-x86_64-linux.iso"
and I had the following compilation error:
Preprocessing library for gi-cairo-render-0.0.1..
copying path '/nix/store/2z25awbvfzkqn3bslvrnjsfjplmrkl4a-dbus-hslogger-0.1.0.1' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/p3iq7w4m9yxpq9972vwvrbflhbhnmrmr-gi-atk-2.0.22-doc' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/nr4dv8nl2hp6p7x2jc2yly3iq4g5nsvb-gi-gio-2.0.27-doc' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/yk1zy8d56gzyr6b9ar7qphn7qc3y2wng-gi-harfbuzz-0.0.3-doc' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/8wgy3nrfhrik4xfggmbixrv2b331a4cp-status-notifier-item-0.3.0.5-doc' from 'https://repository.irisnet.be/artifactory/nix'...
Building library for gi-cairo-render-0.0.1..
copying path '/nix/store/4b0x1p2qhr89x0m6z0lpg358mixjlhqw-gi-pango-1.0.23-doc' from 'https://repository.irisnet.be/artifactory/nix'...
[ 1 of 18] Compiling GI.Cairo.Render.Matrix ( dist/build/GI/Cairo/Render/Matrix.hs, dist/build/GI/Cairo/Render/Matrix.o )
copying path '/nix/store/c4sk82czg9q2f6xhs6pgg5883pz8nvgp-status-notifier-item-0.3.0.5' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/l7niw1xc59y478ry1hbj02z63i3bsimj-xmonad-extras-0.15.2' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/8dgg1iap35pwmmjl036296jny5r3azrh-gi-cairo-1.0.24' from 'https://repository.irisnet.be/artifactory/nix'...
copying path '/nix/store/dczg9i0mvg0m38r6ia8zynbnsdja83hv-gi-glib-2.0.24' from 'https://repository.irisnet.be/artifactory/nix'...
building '/nix/store/bpbalfcxggr82jds87rn3apygljl58zq-gi-xlib-2.0.8.drv'...
copying path '/nix/store/bhsx4a7p65380478g0rlxb1zv0424871-gi-gdkpixbuf-2.0.24-doc' from 'https://repository.irisnet.be/artifactory/nix'...
[ 2 of 18] Compiling GI.Cairo.Render.Types ( dist/build/GI/Cairo/Render/Types.hs, dist/build/GI/Cairo/Render/Types.o )
GI/Cairo/Render/Types.chs:68:34: error:
Module ‘Data.GI.Base’ does not export ‘BoxedObject(..)’
|
68 | import Data.GI.Base (ManagedPtr, BoxedObject(..), GType(..))
| ^^^^^^^^^^^^^^^
I guess this is a known issue but a quick confirmation would be appreciated.
Yes, Taffybar is marked as broken on 20.09.
Although since this seems to affect quite a lot of users, I would be highly in favor of someone upstreaming their overlay.
It wouldn‘t need to be pretty. The stable branch has a lot less moving parts so we can get away with a lot more workarounds.
Also you get a PR for your Hacktoberfest count!
I fixed the release-20.09 version in #103898 (hi @PierreR) but actually am quite keen on getting a working taffybar in nixos-unstable. I'm not quite sure what it needs to be fixed. Do we need to wait for a new stackage LTS or GHC version?
@rvl This PR needs to get through stackage:
https://github.com/commercialhaskell/stackage/pull/5653
This will require some changes to taffybar itself, where the version of some gi packages need to be bumped, and some small code changes need to be made. If you make the relevant code changes I can definitely merge and release a new version of taffybar quickly.
@IvanMalison isn't https://github.com/taffybar/taffybar/pull/494 the only code change to taffybar required? I haven't exactly been keeping up but my overlay from https://github.com/NixOS/nixpkgs/issues/63500#issuecomment-692207172 is still working for me
@rvl We just this friday decided to switch from stackage-lts to stackage-nightly. That should mean that getting taffybar to run should be easier now, because we won‘t have old gi-packages from stackage holding us back. (Of course this is only true after the initial ironing out of new build failures we got because of the switch, but trying getting taffybar to work would help with that, too.)
If one or two patches from upstream are required and upstream is slow to merge them, we can apply them in nixpkgs.
What I want to stress: Don‘t try to fix this against master, you should work with a very recent haskell-updates branch.
Thanks for the info - don't stress - I didn't have the appetite to attempt fixing this on master anyway. But I did find that @NickHu's overlay works for me (for the time being).
@rvl Thanks so much for the fix in 20.09 stable. I will give it a go soonish.
Most helpful comment
New overlay in light of recent merges: