Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Feature request: support including third-party (opam or elsewhere) dependencies on jengaroot #24

Open
chenglou opened this issue May 25, 2016 · 5 comments

Comments

@chenglou
Copy link

I'd like to be able to use e.g. YoJson in my jengaroot. Some of our metadata files are in json.

cc @diml

@ghost
Copy link

ghost commented May 26, 2016

We are currently looking at this as we are looking into building our public packages with jenga. In the meantine a workaround is to rebuild jenga with an embed YoJson; you can do that by adding yojson there and there.

@vramana
Copy link

vramana commented Sep 5, 2016

I have tried this workaround about but stuck with this error

*** jenga: [11392] root=/home/vramana/Documents/reasonml/exampleProject, sys=Linux, j=7, f=2 (NO_VERSION_UTIL)
*** jenga: reading node_modules/rebel/jenga.conf (rebel)
*** jenga: ERROR: Plugin failed: (src/ocaml_dynloader.ml.Dynlink_error
 "error loading shared library: /tmp/ocaml_plugin_0cf334.build/m_dyn_0_.cmxs: undefined symbol: camlYojson") 
*** jenga: ERROR: .jengaroot: User-code load failed
*** jenga: (src/ocaml_dynloader.ml.Dynlink_error"error loading shared library: /tmp/ocaml_plugin_0cf334.build/m_dyn_0_.cmxs: undefined symbol: camlYojson")
*** jenga: 0/2 targets are up to date
*** jenga: failed (#1, 0ms, heap=204.312m, stat=35, digest=1, ls=1, db-save=0)
*** jenga: todo: 0 (0 / 2) !1 ~1 j=0+0 con=2 save=0 act=0, finished
*** jenga: ERROR: (summary) .jengaroot: User-code load failed
*** jenga: (src/ocaml_dynloader.ml.Dynlink_error"error loading shared library: /tmp/ocaml_plugin_0cf334.build/m_dyn_0_.cmxs: undefined symbol: camlYojson")
*** jenga: build finished; not in polling mode so quitting
*** jenga: Quit; exit_code = 1

@ghost
Copy link

ghost commented Sep 5, 2016

I don't have much time to debug this at the moment, but one another approach you could try is to build a jenga with the rules statically linked in. We have an example with the Jane Street rules here.

Essentially you need to write a .ml file containing:

open Core.Std
module J = Jenga_lib

let root_markers =
  [ ".git"
  ; ".hg"
  ]
  |> List.map ~f:J.Path.Rel.create

let () =
  J.Cli.main () ~run:(fun config ->
    let root_dir =
      J.Special_paths.find_ancestor_directory_containing
        ~one_of:root_markers
      |> ok_exn
    in
    J.Run.main' ~root_dir (Env Jenga_rules.Root.setup) config)

and compile it as a normal program. Jenga_rules.Root is the module containing the rules.

@vramana
Copy link

vramana commented Sep 5, 2016

Thanks for the quick reply. I can understand the above code snippet but I don't know how I can use it with https://github.com/reasonml/rebel I will try to think some more about it.

Documenation around jenga is extremely scarce. If I have more questions, where I can ask them?

@ghost
Copy link

ghost commented Sep 5, 2016

I guess you would need to replace Jenga_rules.Root by Rebel and link the Rebel module in.

You can ask jenga questions on the jenga project on github or on the ocaml-core@googlegroups.com mailing list

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants