!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

660 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://nixos.org/manual/nixpkgs/unstable/#haskell | Current PR: https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates | Maintainer Docs: https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org | Merger Schedule: https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa/dayGridMonth/now | Join #haskell.nix:libera.chat for question about the alternative haskell.nix infrastructure132 Servers

Load older messages


SenderMessageTime
22 Jun 2025
@ners:nixos.devnersThat may be so, but I'd still like to understand why it's not finding the libs I'm giving it.19:51:30
@ners:nixos.devners *

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full.dev)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

       > Error: Setup: Missing dependencies on foreign libraries:
       > * Missing (or bad) C libraries: avutil, avformat, avcodec, swscale, avdevice,
       > swresample
19:51:35
@ners:nixos.devners *

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full)
  (addPkgconfigDepend prev.ffmpeg-full.dev)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

       > Error: Setup: Missing dependencies on foreign libraries:
       > * Missing (or bad) C libraries: avutil, avformat, avcodec, swscale, avdevice,
       > swresample
19:54:00
@emilazy:matrix.orgemilyyou're not giving it an ancient FFmpeg is probably at least part of it19:54:45
@emilazy:matrix.orgemilywe're on FFmpeg 719:55:00
@ners:nixos.devnersBut how is its ancientness encoded in cabal?19:55:00
@ners:nixos.devnersI don't see the ffmpeg version encoded in the cabal file. It's asking for a certain set of pkgconfig libs, I'm giving it those libs.19:55:21
@ners:nixos.devnersI don't see any version checks.19:55:25
@ners:nixos.devners

Here's what the cabal wants:

  pkgconfig-depends:   libavutil, libavformat, libavcodec, libswscale, libavdevice,
                       libswresample

Here's what ffmpeg-full.dev has:

 /nix/store/7v77gvdjk8410qzrpkhymihgijf5s990-ffmpeg-full-7.1.1-dev/lib
└──  pkgconfig
    ├──  libavcodec.pc
    ├──  libavdevice.pc
    ├──  libavfilter.pc
    ├──  libavformat.pc
    ├──  libavutil.pc
    ├──  libpostproc.pc
    ├──  libswresample.pc
    └──  libswscale.pc

19:56:37
@ners:nixos.devners* I don't see any version checks or reasons why a newer version wouldn't work.19:57:03
@emilazy:matrix.orgemily not sure. other than the missing lib prefixes in the error maybe. 19:57:54
@sasha:the-apothecary.clubSashanoraa.gay (she/her, ze/zir) joined the room.20:27:10
@sasha:the-apothecary.clubSashanoraa.gay (she/her, ze/zir)Heya, a while ago I wrote a program that uses the punycode package, which is marked as broken in nixpkgs. I'm trying to figure out why but have gotten nowhere, any suggestions?20:28:32
@sasha:the-apothecary.clubSashanoraa.gay (she/her, ze/zir)* Heya, a while ago I wrote a program that uses the punycode Haskell package, which is marked as broken in nixpkgs. I'm trying to figure out why but have gotten nowhere, any suggestions?20:29:43
@maralorn:maralorn.demaralorn
In reply to @sasha:the-apothecary.club
Heya, a while ago I wrote a program that uses the punycode package, which is marked as broken in nixpkgs. I'm trying to figure out why but have gotten nowhere, any suggestions?
Have you looked for a "broken.yaml" file in nixpkgs and read the line in the corresponding comment?
20:47:48
@maralorn:maralorn.demaralornAlso have you tried just building it by overriding/ignoring the broken flag?20:48:25
@sasha:the-apothecary.clubSashanoraa.gay (she/her, ze/zir)
In reply to @maralorn:maralorn.de
Have you looked for a "broken.yaml" file in nixpkgs and read the line in the corresponding comment?
I did not because I didn't know that existed. Thx!
20:49:58
23 Jun 2025
@artem.types:matrix.orgArtem

Hey all! I'm routinely getting strange "missing dependencies" errors when trying to build with cabal on my NixOS machine. Never happens on non-NixOS. I must be missing something? E.g.:

Failed to build unix-2.8.6.0. The failure occurred during the configure step.
Build log (
/home/artem/.cache/cabal/logs/ghc-9.10.1/unix-2.8.6.0-7e70e93a018fa3cd3eeee6c9345819b76e60434f053c8d02acdb7ab743ba3a2a.log
):
Configuring unix-2.8.6.0...
Error: [Cabal-8010]
Encountered missing or private dependencies:
    tasty, tasty-hunit, tasty-quickcheck

happens to various dependencies when building various packages...

17:51:06
@artem.types:matrix.orgArtemI saw reports like that on Discourse but none of the suggestions looked particularly relevant...17:51:35
@alex:tunstall.xyzAlex
In reply to @artem.types:matrix.org

Hey all! I'm routinely getting strange "missing dependencies" errors when trying to build with cabal on my NixOS machine. Never happens on non-NixOS. I must be missing something? E.g.:

Failed to build unix-2.8.6.0. The failure occurred during the configure step.
Build log (
/home/artem/.cache/cabal/logs/ghc-9.10.1/unix-2.8.6.0-7e70e93a018fa3cd3eeee6c9345819b76e60434f053c8d02acdb7ab743ba3a2a.log
):
Configuring unix-2.8.6.0...
Error: [Cabal-8010]
Encountered missing or private dependencies:
    tasty, tasty-hunit, tasty-quickcheck

happens to various dependencies when building various packages...

Are you trying to override the unix package?

Boot libraries have special handling and cannot be overridden in the usual way.
For example:

nix-repl> haskellPackages.unix
null
18:52:14
@artem.types:matrix.orgArtem @alex:tunstall.xyz: I'm building with cabal, not nix, so, I'm not sure I understand your question but no, I'm not doing anything special I just do `cabal build` 19:53:48
@maralorn:maralorn.demaralorn @artem.types:matrix.org 1. Did you run cabal update? 2. Try reseting by removing dist-newstyle. 19:58:09
@alex:tunstall.xyzAlex
In reply to @artem.types:matrix.org
@alex:tunstall.xyz: I'm building with cabal, not nix, so, I'm not sure I understand your question but no, I'm not doing anything special I just do `cabal build`

If you don't understand the question, the answer is "probably not".

Then you might have version constraints in your package that cause Cabal to reject the version installed with the GHC provided by Nix.
Can you try deleting the local copy of the package index? (I can't remember where in ~ cabal puts it.)

19:58:31
@alex:tunstall.xyzAlex Running cabal update produces a local package index that Cabal may try to use to build packages.
When using Nix, you typically don't want the file to exist.
20:00:14
@maralorn:maralorn.demaralornRedacted or Malformed Event20:18:43
@maralorn:maralorn.demaralornWell with cabal update it should work, even though it is not a very typical workflow.20:20:48
@alex:tunstall.xyzAlex Ah, that's not a workflow I'm familiar with and I vaguely recall it being a problem in the past...
Let's see whether any of our ideas help.
20:22:41
@maralorn:maralorn.demaralorn Alex: It has the advantage of not needing overrides as long as there is any valid build plan cabal can find on hackage. It has the disadvantage that you get no caching for dependencies and the problem that you get no automatic installation of system dependencies. So traditionally this breaks when you have e.g. zlib in your closure. 20:24:53
@maralorn:maralorn.demaralorn(I guess you know that, but that is probably the problem you remember.)20:25:22
@alex:tunstall.xyzAlex Given that GHC 9.10 is being used, cabal update may be easier than jailbreaking and patching various packages.
I haven't tried upgrading beyond the default GHC lately, but when I do it has always involved Nix overrides...
20:28:34

Show newer messages


Back to Room ListRoom Version: 6