Skip to content

unix-compat does not build because of strangeness in GHC's header files.

I have build 7.0.3 from source and then tried building unix-compat library. The library failed to build because it could not find libutil.h.

Digging a bit deeper I found the following:

unix-compat includes among other things header files from GHC.

  1. /libraries/unix/include/HsUnixConfig.h has this in it:
  /* Define to 1 if you have the <libutil.h> header file. */
  #define HAVE_LIBUTIL_H 0

However, ./libraries/unix/include/HsUnix.h has this:

  #ifdef HAVE_LIBUTIL_H
  #include <libutil.h>
  #endif

Naturally, it has tried to include the non-existing libutil.h. Even though HAVE_LIBUTIL_H is zero, it is still considered to be defined.

After removing this line:

  #define HAVE_LIBUTIL_H 0

unix-compat has been successfully built.

Edited by Simon Marlow
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information