stepcut / plugins

Dynamic linking and runtime evaluation of Haskell, and C, including dependency chasing and package resolution.
GNU Lesser General Public License v2.1
51 stars 17 forks source link

Can't build with stack due to missing config.h file #8

Open gpropf opened 5 years ago

gpropf commented 5 years ago

I've been trying to build this package in one of my Haskell projects. I'm using stack and keep getting the errors shown below. I've tried building this on Arch, Linux Mint, and Nixos and with several different versions of stack and ghc. This particular run was with stack 1.9.1, and ghc 8.0.2. I've tried it with stack 1.7.1 and ghc 8.4.4 with the same result. They all produce this same exact error. I've done several searches online and found nothing useful. Any ideas about what's happening and how to fix it?

` checking for a BSD-compatible install... /nix/store/wm8va53fh5158ipi0ic9gir64hrvqv1z-coreutils-8.29/bin/install -c configure: creating ./config.status config.status: creating config.mk config.status: creating testsuite/makewith/io/TestIO.conf config.status: creating testsuite/makewith/unsafeio/Unsafe.conf config.status: creating config.h configure: WARNING: unrecognized options: --with-compiler Preprocessing library for plugins-1.5.7.. Building library for plugins-1.5.7..

/run/user/1000/stack7723/plugins-1.5.7/src/System/Plugins/Consts.hs:24:2: error:
     fatal error: ../../../config.h: No such file or directory

      ^                  
   |
24 | 
   |  ^
compilation terminated.
`cc' failed in phase `C pre-processor'. (Exit code: 1)

`

greati commented 5 years ago

I'm having the same problem, any ideas about that?

stepcut commented 5 years ago

I have no idea how anything works in plugins (I didn't write it). But if someone makes a pull request I'll gladly merge it and release it on hackage.

gpropf commented 5 years ago

I've given up on this. It seems from some other things I read that this is not likely to be the only problem since the package seems to have fallen out of sync with the rest of the Haskell universe. If you look at the commits you'll see most are from 13 or 14 years ago in fact! I briefly tried using the Hint library but it looks like it only does interpreted code. I also found this blog post that might help.

What I really wanted was something like the dynamic module linking of object code that is fairly simple in C and C++. It's a bit sad that there's no easy standard way to do that in Haskell. For my project, the hotloading capability was more of a nice but non-essential feature so I'm scrapping the idea for now and just building all the modules into the main program with a command line switch to select which one.

galenhuntington commented 5 years ago

I have made some progress on this issue in #9. The config.h problem was not that difficult, and a few other changes were needed to build.

I think this package is salvageable. While some commits may be quite old, there have been maintenance updates, and more importantly it seems to basically work, subject to the reservations I noted.

Finally, I agree with the general view that it is a benefit to the Haskell ecosystem to have something like this available.