1

From inside nix-shell, I run cabal build (after running cabal update) and I get the following error:

Failed to build libsystemd-journal-1.4.5.0.0.0.0.1.
Build log (
/home/eric/.cabal/logs/ghc-8.10.7/libsystemd-journal-1.4.5.0.0.0.0.1-e4cc9aa62753db444ead5dccd6f07aebc3786f63add34b8c61c50f4e70371832.log
):
Configuring library for libsystemd-journal-1.4.5.0.0.0.0.1..
Preprocessing library for libsystemd-journal-1.4.5.0.0.0.0.1..
compiling dist/build/Systemd/Journal_hsc_make.c failed (exit code 1)
rsp file was: "dist/build/Systemd/hsc2hscall112768-0.rsp"
command was: /nix/store/k6yka69n28j47wjhm14h41r2kbv262y6-gcc-wrapper-11.3.0/bin/gcc -c dist/build/Systemd/Journal_hsc_make.c -o dist/build/Systemd/Journal_hsc_make.o -D__GLASGOW_HASKELL__=810 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Idist/build/autogen -Idist/build/global-autogen -include dist/build/autogen/cabal_macros.h -I/nix/store/rqggdpw465knwysk8nc8hs5w1dljkkln-vector-lib-vector-0.12.3.1/lib/x86_64-linux-ghc-8.10.7/vector-0.12.3.1-AounQdOy6Wd4pDDridaQzb/include -I/nix/store/yfdgpr8ivjzprxg8z4g3prmyqk21n7yv-primitive-lib-primitive-0.7.4.0/lib/x86_64-linux-ghc-8.10.7/primitive-0.7.4.0-5BIOLYRlNGvJcfQVHFW6fv/include -I/nix/store/qj45sjydypxwnrnbskzqf6m6ss190sy2-unix-lib-unix-2.7.2.2/lib/x86_64-linux-ghc-8.10.7/unix-2.7.2.2-ETifA5smZTZIWkxyIZe1zI/include -I/nix/store/jzmvd2ckp1hdvbrasqi6mfi8dl1vyc9d-time-lib-time-1.9.3/lib/x86_64-linux-ghc-8.10.7/time-1.9.3-AAq60BtyTvLBxnbhpLzOg0/include -I/nix/store/qbkv38qlsv0yxjk2rwq0zn5l7k00z5m8-bytestring-lib-bytestring-0.10.12.0/lib/x86_64-linux-ghc-8.10.7/bytestring-0.10.12.0-BvIZHiOJL8O7XxUygqQkmw/include -I/nix/store/x2kp6b7xwngvfzrh6pip3did10i08la4-ghc-8.10.7/lib/ghc-8.10.7/base-4.14.3.0/include -I/nix/store/xcrs6mk16vkxlzxginbjmcvi3c0my99w-gmp-with-cxx-6.2.1-dev/include -I/nix/store/x2kp6b7xwngvfzrh6pip3did10i08la4-ghc-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/include -I/nix/store/c6sr4xl1qnr69d849wm4p34a0z5bikym-numactl-2.0.14/include -I/nix/store/x2kp6b7xwngvfzrh6pip3did10i08la4-ghc-8.10.7/lib/ghc-8.10.7/include -I/nix/store/5yzcy5fglpifxs34n7afzpg7wk8sjfvb-libffi-3.4.2-dev/include -I/nix/store/x2kp6b7xwngvfzrh6pip3did10i08la4-ghc-8.10.7/lib/ghc-8.10.7/include/
error: Journal.hsc:1:10: fatal error: systemd/sd-journal.h: No such file or directory
compilation terminated.

cabal: Failed to build libsystemd-journal-1.4.5.0.0.0.0.1 (which is required
by academy-project-0.0.0). See the build log above for details.

Can anyone help?

(Is there perhaps a C library that needs to be installed (due to systemd/sd-journal.h: No such file or directory) but isn't the whole point of Nix that it takes care of that sort of thing automatically?)

1 Answer 1

0

You probably need to install libsystemd-dev.

2
  • I have installed libsystemd-dev but I still get the same error.
    – Eric
    Commented Sep 19, 2023 at 12:01
  • What does find / -name sd-journal.h say? Commented Sep 19, 2023 at 20:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.