ShabbyX / libpandoc

C bindings to Pandoc, a markup converter library written in Haskell.
88 stars 16 forks source link

Build error - possibly windows only #17

Open RussellTaylor83 opened 5 years ago

RussellTaylor83 commented 5 years ago

Hello,

Firstly, thank you for this repo. When I get it working it'll be a really nice thing to have.

I'm having trouble building under windows, although I'm not sure it's a Windows only issue. I will try on a linux machine tomorrow but I need a dll for windows.

There is a dependency on HSrts, and for the life of me I cannot find it / figure it out. HS means written in C I believe. I have found one google reference to bilding rts yourself but cannot find the source.

Anyone any ideas please?

Thank you

C:\Users\Russ\Documents\src\libpandoc>make
GHC is version 8.6.3
cabal configure
Warning: The configure command is a part of the legacy v1 style of cabal
usage.

Please switch to using either the new project style and the new-configure
command or the legacy v1-configure alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
Configuring libpandoc-0.8...
cabal: Missing dependency on a foreign library:
* Missing (or bad) C library: HSrts
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

make: *** [main] Error 1
ShabbyX commented 5 years ago

Hi,

I don't use windows, so I can hardly tell. But also I have not been working on this project for a few years. I'm sure Pandoc is already way ahead. It looks like cabal is changing too (from your message).

So, first, if you can get things updated (and work on both Linux and windows), please send a PR :)

Regarding HSrts, look inside libpandoc.cabal:

  if !os(windows)
    Ghc-Options:        -dynamic
    extra-libraries:    HSrts-ghc$compiler
  else
    extra-libraries:    HSrts

This commit originally added dynamic linking: 1331f02a39eb4f644c41e8945d71313d7dffb99f. At some point when I tried it on windows, I ended up doing this to fix the build: a9f5ac9d7ac64cb75002a2be1f151f64c859af85. Note that even then I got some nonesense dll related crash when running the test which I never figured out how to resolve.

@toroidal-code what was the original reason for doing this? 1331f02a39eb4f644c41e8945d71313d7dffb99f

RussellTaylor83 commented 5 years ago

Thank you for getting back to me. Sorry it's been so long, I really need to check commit dates etc. :)

I would be very interested to know what HSrts brings to the party.

I think I have a fair bit of learning to do to get this working again, it's a volunteer project so for now I'll just call out to pandoc itself. But it'd be good to figure this out and give something back. Appreciate your time, thanks.

ShabbyX commented 5 years ago

Thank you, looking forwards to learn whatever you find out.