cdepillabout / termonad

Terminal emulator configurable in Haskell.
https://hackage.haskell.org/package/termonad
BSD 3-Clause "New" or "Revised" License
401 stars 49 forks source link

The NixOS package is broken, I think... #243

Closed refaelsh closed 10 months ago

refaelsh commented 11 months ago

I am using Termonad in NixOS, and here is the error I get when I am doing the usual sudo -i nixos-rebuild switch --upgrade:

GI/Vte/Objects/Terminal.hs:1910:1: error:
    Could not load module ‘GI.Cairo.Structs.FontOptions’
    It is a member of the hidden package ‘gi-cairo-1.0.29’.
    Perhaps you need to add ‘gi-cairo’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
     |
1910 | import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: builder for '/nix/store/flnw7ghv78pffcvrrvbjbc6c6pbxx221-gi-vte-2.91.31.drv' failed with exit code 1
cdepillabout commented 11 months ago

Thanks for reporting this. And keep in mind you can always report in the Nixpkgs issue tracker as well, if this is a problem with Termonad in Nixpkgs (and remember to ping me).

What NixOS channel / commit are you on?

refaelsh commented 11 months ago

And keep in mind you can always report in the Nixpkgs issue tracker as well

I can't discern where the problem: is it on Termonad's side or on NixOS's side. I took a guess it's on Termonad's side :-)

What NixOS channel / commit are you on?

I am on unstable channel in NixOS. I am not really sure what you mean by "commit" in this context.

cdepillabout commented 11 months ago

I can't discern where the problem: is it on Termonad's side or on NixOS's side.

Ah, I see. In general I always try to keep Termonad working in NixOS, so if you get Termonad from NixOS and it is not compiling, I'd say it is a Nixpkgs problem, and you should feel free to report to NixOS.

However, if you actually aren't using Termonad from Nixpkgs, and instead just pulling it in from this repo, then you're correct to just report here (since it likely doesn't affect people getting Termonad from Nixpkgs).

I am on unstable channel in NixOS. I am not really sure what you mean by "commit" in this context.

Every release of a NixOS channel is associated with a single Nixpkgs commit.

You can see the most up-to-date commit for each channel on the following site: https://status.nixos.org/

You can find what commit your current system uses a couple of different ways:

  1. Use the repl:

    $ nix repl '<nixpkgs>'
    $ lib.version
    "23.11.1234.8b8c940784"

    The last part of this version string ("8b8c940784") is a Git commit hash.

  2. You can look directly at the metadata for channels you have available:

    $ echo $NIX_PATH
    /home/me/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channel
    $ cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision
    8b8c9407844599546393146bfac901290e0ab96b

I just tried building Termonad on the latest nixpkgs-unstable (commit 0bd59c54ef06bc34ec), and it does appear that gi-vte is broken.

Let me try to figure out what is going on.

cdepillabout commented 11 months ago

I sent a PR trying to fix gi-vte here: https://github.com/haskell-gi/haskell-gi/pull/420.

It appears that this breakage has also made its way into nixos-23.11, so I'll have to send a fix separately for that.

refaelsh commented 11 months ago

Here is what it says for me:

🏠 
λ nix repl '<nixpkgs>'
warning: future versions of Nix will require using `--file` to load a file
Welcome to Nix 2.18.1. Type :? for help.

Loading installable ''...
Added 19742 variables.
nix-repl> lib.version
"24.05pre552293.5a09cb4b393d"

nix-repl> 

I just tried building Termonad on the latest nixpkgs-unstable

What? I don't understand. Can you please explain? This sounds interesting.

cdepillabout commented 11 months ago

What? I don't understand. Can you please explain? This sounds interesting.

Ah, I just mean that I cloned Nixpkgs, then checked out the nixpkgs-unstable branch (which corresponds to the nixpkgs-unstable channel on https://status.nixos.org/):

$ git clone git@github.com:NixOS/nixpkgs.git
$ cd nixpkgs
$ git checkout nixpkgs-unstable
$ git rev-parse HEAD
0bd59c54ef06bc34ec

And then I built Termonad from here:

$ nix-build -A termonad

When building Termonad, I was able to reproduce your problem. gi-vte was failing to build.

dnstzk commented 11 months ago

Hi, is there a workaround or do we have to wait until your PR has gone through?

cdepillabout commented 11 months ago

@dnstzk I don't have a workaround ready-to-go, but it should be relatively easy to patch the .cabal file that gets downloaded from hackage to add the gi-cairo dependency, if you wanted to do so locally.

If you wanted to send that workaround to Nixpkgs, I would merge it in, at least until gi-vte is fixed on Hackage.

dnstzk commented 11 months ago

Hm, I'm relatively new to Haskell, cabal/stack, but I'll give it a try.

refaelsh commented 10 months ago

@cdepillabout I am unable to run the usual sudo -i nixos-rebuild switch --upgrade on my machine for several weeks now due to this issue. Is there some kind of workaround that can be done locally on a user's machine?

cdepillabout commented 10 months ago

Sorry for keeping you waiting! I've fixed gi-vte (and transitively termonad) on haskell-updates, so this should be available in nixpkgs-unstable as soon as this PR is merged in: https://github.com/NixOS/nixpkgs/pull/272097.

I've also backported to 23.11: https://github.com/NixOS/nixpkgs/pull/277011

So this should be available as soon as the PR makes it to the channels: https://nixpk.gs/pr-tracker.html?pr=277011