tweag/inline-java

haskell.nix support for `jni` and `jvm` packages

Opened this issue · 4 comments

For use with haskell.nix, which relies on cabal, include .cabal and .h files:

user16332@3fa95fd

the above commit includes fixes for issue 197

Thanks @user16332. Two question about this,

  1. Would it be helpful in any way if I uploaded new versions of jni and jvm packages to hackage?
  2. If jni.h and jni_md.h are included in the jni package, wouldn't this prevent the package from working with jvms and platforms where the header files differ?
  1. Would it be helpful in any way if I uploaded new versions of jni and jvm packages to hackage?

Hackage needs .cabal files just like haskell.nix, that's why it wasn't updated on Hackage since v0.8.0 because that's when the cabal support that was there earlier got dropped. Once you have cabal support you can also update Hackage which would mean the packages would eventually automatically end up in haskell.nix but that's a bonus.

  1. If jni.h and jni_md.h are included in the jni package, wouldn't this prevent the package from working with jvms and platforms where the header files differ?

I guess so. The above Works On My Machine (tm). :D

  • It appears earlier, pre-bazel versions would just assume these files be present on the build system, provided by the OS?
  • The official way would be to use pkg-config, but there is no .pc file for openjdk?

I'm thinking of adding the packages back to hackage for jni, jvm, and inline-java, although with no support to deal with java dependencies.

One bit of tooling to make it smooth is to keep the bazel and the cabal configurations in sync with gazelle_cabal.