Skip to content

failure to build gd Hackage library in nix develop shell #1865

Closed
@peterbecich

Description

@peterbecich

Describe the bug

This haskell.nix project https://github.com/peterbecich/haskell-nix-gd-issue depends on an old library gd: https://hackage.haskell.org/package/gd-3000.7.3

nix build succeeds.

In the nix develop shell, cabal build fails.

The important errors appear to be:

error: /nix/store/...-binutils-2.39/bin/ld: warning: libXpm.so.4, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libX11.so.6, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libtiff.so.6, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libwebp.so.7, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libsharpyuv.so.0, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libavif.so.15, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libpthread.so.0, needed by /nix/store/....-gd-2.3.3/lib/libgd.so, not found (try using -rpath or -rpath-link)
/nix/store/...-binutils-2.39/bin/ld: warning: libbz2.so.1, needed by /nix/store/...-fontconfig-2.14.0-lib/lib/libfontconfig.so, not found (try using -rpath or -rpath-link)
...

gd-3000.7.3.log

I have provided many/all of the dependencies of gd:
https://github.com/peterbecich/haskell-nix-gd-issue/blob/2fa3144a80fd445efef64f798f9bf92334994070/flake.nix#L33-L36

Not included in the commit, I have set LD_LIBRARY_PATH in the dev shell, which produces a different error:

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;

Can someone point me in the right direction?

  • Build system: x86_64-linux
  • GHC version: 9.2.5
  • Haskell.nix version (or commit) used: today's version

Steps To Reproduce

Expected behavior

cabal build succeeds

Additional context

I am attempting to use haskell.nix to provide a Flake for hackage-server, which depends on gd: haskell/hackage-server#1154

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions