-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
haskell.packages.ghc94.gi-gtk: unbreak dependencies and package #205814
Conversation
I'm somewhat curious here, do you know why this is? I'm surprised something like this isn't picked up automatically by our tooling. |
i will be frank i have no idea, i just tried to use gi-gtk and saw the error was a clear missing x so i tried to add the dependency to see if it would build, and it did. it probably is worth investigating why it has more dependencies or at least why they aren't automatically picked up. |
in which directory is the code for determining the build dependencies of a package? gi graphene is marked broken but the error it gives is similar to this one haskell-gi/haskell-gi#308 and sure enough gi-graphene builds if in configuration we add graphene as a build dependency |
Just wanted to say that I thought we should probably hold off on merging this until we figure this out. It is somewhat concerning that the
The actual derivations for a Haskell package are in https://github.com/NixOS/nixpkgs/blob/db01e7b2207e0de45d9c346036f22322495ab249/pkgs/development/haskell-modules/hackage-packages.nix (and you should be able to grep for things like The You can play around with $ nix-shell -p cabal2nix --command 'cabal2nix cabal://gi-gtk' |
It is possible that no one has added a |
Sorry for taking a while to get back to this. sterni added a workaround for this problem in #214446. Would you be willing to rewrite this PR to use |
yeah no problem. it was really easy the first time so whenever i am free i will do it. please ping me if i take more than 1 week i tend to get hyperfocused in whatever i am currently doing and forget other things. |
ok i took some of my time to work on this and i got almost everything to work, however gi-gdkpixbuf fails due to our version of libdeflate not having a.pc file, there is a pr to bump its version so we need to wait that do i just push my version that should work even if it can't be merged or should i wait that pr to merge to push my changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the workaround for gdkpixbuf should work in the sense that it'll fix itself as soon as the PR arrives in the relevant branch(es).
@@ -203,4 +203,12 @@ in { | |||
fourmolu = overrideCabal (drv: { | |||
libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.file-embed ]; | |||
}) (disableCabalFlag "fixity-th" super.fourmolu); | |||
# haskell-gi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to use __CabalEagerPkgConfigWorkaround
for all of these like this:
nixpkgs/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix
Lines 203 to 210 in d05e672
# Apply workaround for Cabal 3.8 bug https://github.com/haskell/cabal/issues/8455 | |
# by making `pkg-config --static` happy. Note: Cabal 3.9 is also affected, so | |
# the GHC 9.6 configuration may need similar overrides eventually. | |
X11-xft = __CabalEagerPkgConfigWorkaround super.X11-xft; | |
# Jailbreaks for https://github.com/gtk2hs/gtk2hs/issues/323#issuecomment-1416723309 | |
glib = __CabalEagerPkgConfigWorkaround (doJailbreak super.glib); | |
cairo = __CabalEagerPkgConfigWorkaround (doJailbreak super.cairo); | |
pango = __CabalEagerPkgConfigWorkaround (doJailbreak super.pango); |
Also please put your overrides next to those, so they'll be easier to clean up.
277a764
to
cd0bfaf
Compare
ok please review this version, as it is the current one i am working on, no reason to have a wrong version in my pull request i tested and although gi-gtk hasn't built due to gi-gdk failing except for gi-gdk and gi-gdkpixbuf all dependencies build properly |
@@ -485,7 +485,7 @@ rec { | |||
builtins.genericClosure { | |||
startSet = builtins.map (drv: | |||
{ key = drv.outPath; val = drv; } | |||
) drvs; | |||
) (builtins.filter (i: !builtins.isNull i) drvs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, when it receives null it chokes so we need to filter it out, as mentioned in my other comment some derivations like gi-gmodule have a dependency set to null which means this function will error without this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bb62d57 should also fix that – in general it is unlikely that null
ends up in libraryPkgConfigDepends
and it's correct, so keeping it as it was probably will catch similar problems in the future.
gi-gdk_4_0_5 = __CabalEagerPkgConfigWorkaround super.gi-gdk_4_0_5; | ||
gi-gio = __CabalEagerPkgConfigWorkaround super.gi-gio; | ||
gi-glib = __CabalEagerPkgConfigWorkaround super.gi-glib; | ||
gi-gmodule = __CabalEagerPkgConfigWorkaround (overrideCabal (drv: {libraryPkgconfigDepends = [pkgs.glib];}) super.gi-gmodule); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gi-gmodule has the following code
"gi-gmodule" = callPackage
({ mkDerivation, base, bytestring, Cabal, containers, gi-glib
, gmodule, haskell-gi, haskell-gi-base, haskell-gi-overloading
, text, transformers
}:
mkDerivation {
pname = "gi-gmodule";
version = "2.0.3";
sha256 = "043n3nyxy29chzc7xzhinp40yxazlikqcjdbm3pvh344jv7m5xjx";
setupHaskellDepends = [ base Cabal gi-glib haskell-gi ];
libraryHaskellDepends = [
base bytestring containers gi-glib haskell-gi haskell-gi-base
haskell-gi-overloading text transformers
];
libraryPkgconfigDepends = [ gmodule ];
description = "GModule bindings";
license = lib.licenses.lgpl21Only;
}) {gmodule = null;};
because gmodule is null it doesn't find its dependency glib which is necessary for compiling. on second thought it should probably be commented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is easily fixed properly in cabal2nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in bb62d57, you should be able to rebase and simplify this rebase.
@@ -214,4 +214,20 @@ in { | |||
# failing during the Setup.hs phase: https://github.com/gtk2hs/gtk2hs/issues/323. | |||
gtk2hs-buildtools = appendPatch ./patches/gtk2hs-buildtools-fix-ghc-9.4.x.patch super.gtk2hs-buildtools; | |||
|
|||
haskell-gi-base = __CabalEagerPkgConfigWorkaround super.haskell-gi-base; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still should be moved to be grouped with the other __CabalEagerPkgConfigWorkaround
overrides above.
sterni could you make a similar commit for gi-harfbuzz? it receives harfbuzz-gobject as null |
This has been fixed in #240387, except for |
Description of changes
on current nixos-unstable and on haskell-updates the gi-gtk package and some of its dependencies are broken
Things done
for some reason the haskell-gi packages have more dependencies on ghc-9.4 luckily they all are packaged already and it is a single line per package to make them build.
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes