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

Jbuilder #565

Merged
merged 7 commits into from Mar 29, 2017
Merged

Jbuilder #565

merged 7 commits into from Mar 29, 2017

Conversation

hhugo
Copy link
Member

@hhugo hhugo commented Mar 10, 2017

This is a work in progress, resurrection of #565,
making use of jbuilder, ocaml-migrate-parsetree, ppx_tools_versionned.

Js_of_ocaml is now split as follow

  • js_of_ocaml-compiler: compiler & runtime
  • js_of_ocaml-camlp4: camlp4 syntaxes (pa_js, pa_deriving)
  • js_of_ocaml-ppx: ppx syntaxes (ppx_js, ppx_deriving_json)
  • js_of_ocaml-ocamlbuild: ocamlbuild plugin
  • js_of_ocaml-toplevel: jsoo_mkcmis, jsoo_mktop, js_of_ocaml.toplevel
  • js_of_ocaml: js_of_ocaml lib with no dep on lwt, tyxml, ...
  • js_of_ocaml-lwt: lwt support (Lwt_js, Lwt_events_js, ..), graphics, lwt-logger
  • js_of_ocaml-tyxml: support for tyxml

Async and ppx_driver support have disappeared and are/will be maintained by Janestreet (cc @diml)

TODO

  • compile the toplevel example
  • compile other examples
  • generate the doc
  • run tests
  • fix META with compatibility layer (how much compat do we want to provide ?)

WAITING

NEXT

Should address the following issues
fix #265
fix #360
fix #566
fix #545
fix #543
fix #523

@Drup
Copy link
Member

Drup commented Mar 10, 2017

IIUC, this is a reboot of #541 using jbuilder ? Interesting. Can you give a quick rundown of what us non-janstreetians need to know after this transition (from a practical point of view) ?

@hhugo
Copy link
Member Author

hhugo commented Mar 10, 2017

The janestreetness does not really matter here ;)

You will be able to start using jbuilder with

opam install jbuilder
jbuilder external-lib-deps --missing @install
# install missing deps with opam
jbuilder build @install

It builds fast and support incremental build. which works well for development

time jbuilder build @install -j 16
real	0m8.900s
user	0m41.739s
sys	0m7.069s

time jbuilder build @install -j 16
real	0m0.287s
user	0m0.089s
sys	0m0.062s

Using jbuilder makes managing multiple opam package for js_of_ocaml very easy.

jbuilder build @install --only js_of_ocaml-compiler
jbuilder install js_of_ocaml-compiler

Still need more work to fully replace the current build system.
I'll see if I can combine the two to support

  • ocamldoc
  • examples
  • toplevel

It is also super convenient to tests multiple ocaml version / opam switch at once.
The following will build js_of_ocaml for both ocaml 4.03 and ocaml 4.04

cat jbuild-workspace.dev 
;; Install the following opam switches, copy this file as
;; jbuild-workspace and run:
;;
;; $ jbuilder build @install
;;
;; This will build js_of_ocaml against all these version of OCaml

;;(context ((switch 4.02.3)))
;;(context ((switch 4.03.0+32bit))
(context ((switch 4.03.0)))
(context ((switch 4.04.0)))
;;(context ((switch 4.05.0+beta2)))
;;(context ((switch 4.06.0+trunk)))
jbuilder build @install --workspace jbuild-workspace.dev

Note this PR also adds a dependency on ocaml-migrate-parsetree and ppx_tools_versioned.

@Drup
Copy link
Member

Drup commented Mar 10, 2017

That's the summary I was hoping for. Thanks! This looks really nice.

@hhugo hhugo merged commit b584934 into master Mar 29, 2017
@hhugo hhugo deleted the jbuilder branch March 29, 2017 00:40
@hhugo hhugo mentioned this pull request Mar 29, 2017
@rgrinberg
Copy link
Contributor

yay @hhugo 💯 🎖️

@Drup
Copy link
Member

Drup commented Mar 30, 2017

@hhugo I don't understand how ppx tests are run, if they are run at all. Did you ported that ?

@hhugo
Copy link
Member Author

hhugo commented Mar 30, 2017

Tests have not been fully ported yet.

)

package "log" (
requires = "js_of_ocaml-ppx.log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

js_of_ocaml-ppx.log doesn't exist. Require js_of_ocaml-lwt.logger, or remove js_of_ocaml.log altogether?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a typo. It should be js_of_ocaml-lwt.log

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants