Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ghc to invoke javac #282

Closed
facundominguez opened this issue May 29, 2018 · 1 comment
Closed

Allow ghc to invoke javac #282

facundominguez opened this issue May 29, 2018 · 1 comment

Comments

@facundominguez
Copy link
Member

facundominguez commented May 29, 2018

inline-java invokes javac in a GHC Core plugin in order to compile generated java stubs. The bytecode is then embedded in the object file of the module.

Bazel, however, requires all inputs to be declared to a rule, or the inputs won't be visible to the compiler. In particular, we would need to somehow say that javac is an input to the rule, or the GHC plugin won't be able to invoke it.

I believe that, currently, there is no way to specify programs as inputs to the haskell build rules, so this issue would be about implementing some way to allow it.

sparkle and jvm-batching used to build with rules_haskell at commit 23d8b0f, probably because of a bug in rules_haskell. But this is no longer the case (fcef649). If we can't find a good way to declare javac an input to the build rules, it may worth investigating how it did work before and attempting a hack, but I'd prefer not to start like that.

@facundominguez
Copy link
Member Author

After some discussion with @mrkkrp we are heading for adding a new extra_binaries attribute to the haskell_toolchain rule that gets a list of labels. Here we should list javac, which then will be included in the folder visible-binaries.

facundominguez added a commit that referenced this issue Jun 7, 2018
Now we can make javac visible to ghc to build packages which use
inline-java.

Closes #282.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant