dbuenzli / vg

Declarative 2D vector graphics for OCaml
http://erratique.ch/software/vg
ISC License
86 stars 12 forks source link

jsoo 3.0 #16

Closed meadofpoetry closed 6 years ago

meadofpoetry commented 6 years ago

As far as I can see js_of_ocaml, js_of_ocaml-ocamlbuild and js_of_ocaml-ppx are sufficient for successful building.

dbuenzli commented 6 years ago

This doesn't work here. It seems they renamed js_of_ocaml to js_of_ocaml.exe (!?). But somehow the ocamlbuild plugin was not updated.

> topkg build 
ocamlfind ocamlopt -shared -linkall -package gg -package bytes -package uchar -package result -I src src/vg.cmxa -o src/vg.cmxs
ocamlfind ocamlopt -shared -linkall -package gg -package bytes -package uchar -package result -I src src/vgr_svg.cmxa -o src/vgr_svg.cmxs
ocamlfind ocamlopt -shared -linkall -package uutf -package otfm -package gg -package bytes -package uchar -package result -I src src/vgr_pdf.cmxa -o src/vgr_pdf.cmxs
ocamlfind ocamlopt -shared -linkall -package js_of_ocaml.ppx -package gg -package bytes -package uchar -package result -I src src/vgr_htmlc.cmxa -o src/vgr_htmlc.cmxs
ocamlfind ocamlopt -shared -linkall -package cairo2 -package gg -package bytes -package uchar -package result -I src src/vgr_cairo.cmxa -o src/vgr_cairo.cmxs
js_of_ocaml --no-runtime --pretty --debug-info --source-map +js_of_ocaml-compiler/runtime.js -o test/min_htmlc.js test/min_htmlc.byte
+ js_of_ocaml --no-runtime --pretty --debug-info --source-map +js_of_ocaml-compiler/runtime.js -o test/min_htmlc.js test/min_htmlc.byte
/bin/sh: js_of_ocaml: command not found
Command exited with code 127.
pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
     '-build-dir' '_build' '-plugin-tag' 'package(js_of_ocaml.ocamlbuild)'
     'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md' 'README.md' 'src/vg.a'
     'src/vg.cmxs' 'src/vg.cmxa' 'src/vg.cma' 'src/vg.cmx' 'src/vg.cmi'
     'src/vg.mli' 'src/vgr_svg.a' 'src/vgr_svg.cmxs' 'src/vgr_svg.cmxa'
     'src/vgr_svg.cma' 'src/vgr_svg.cmx' 'src/vgr_svg.cmi' 'src/vgr_svg.mli'
     'src/vgr_pdf.a' 'src/vgr_pdf.cmxs' 'src/vgr_pdf.cmxa' 'src/vgr_pdf.cma'
     'src/vgr_pdf.cmx' 'src/vgr_pdf.cmi' 'src/vgr_pdf.mli' 'src/vgr_htmlc.a'
     'src/vgr_htmlc.cmxs' 'src/vgr_htmlc.cmxa' 'src/vgr_htmlc.cma'
     'src/vgr_htmlc.cmx' 'src/vgr_htmlc.cmi' 'src/vgr_htmlc.mli'
     'src/vgr_cairo.a' 'src/vgr_cairo.cmxs' 'src/vgr_cairo.cmxa'
     'src/vgr_cairo.cma' 'src/vgr_cairo.cmx' 'src/vgr_cairo.cmi'
     'src/vgr_cairo.mli' 'test/vecho.native' 'test/examples.ml'
     'test/min_htmlc.html' 'test/min_htmlc.ml' 'test/min_pdf.ml'
     'test/min_svg.ml' 'test/min_cairo_png.ml' 'test/min_cairo_mem.ml'
     'test/fglyphs.ml' 'test/vecho.ml' 'test/min_svg.native'
     'test/min_pdf.native' 'test/min_cairo_png.native'
     'test/min_cairo_mem.native' 'test/rsvg.native' 'test/rpdf.native'
     'test/rcairo.native' 'test/examples.native' 'fglyphs.native'
     'test/min_htmlc.html' 'test/min_htmlc.js' 'test/sqc.html' 'test/sqc.js'
     'test/rhtmlc.html' 'test/rhtmlc.js']: exited with 10
dbuenzli commented 6 years ago

Thanks for you help @Freyr666.

Note that if this manages to get fixed upstream then it seems we don't need to make a new release. We should simply update the constraints in the opam-repository. But please keep this open for now.

meadofpoetry commented 6 years ago

@dbuenzli

It seems they renamed js_of_ocaml to js_of_ocaml.exe (!?). But somehow the ocamlbuild plugin was not updated.

Ah, I see. It seems we also need js_of_ocaml-compiler package. At least I have js_of_ocaml binary along with the js_of_ocaml.exe, and vg compiles just fine. I've added js_of_ocaml-compiler in deps, does it work now?

dbuenzli commented 6 years ago

This doesn't work here the build fails as above with:

> opam list | grep js_of_ocaml 
js_of_ocaml             3.0           Compiler from OCaml bytecode to Javascript
js_of_ocaml-compiler    3.0           Compiler from OCaml bytecode to Javascript
js_of_ocaml-ocamlbuild  3.0           Compiler from OCaml bytecode to Javascript
js_of_ocaml-ppx         3.0           Compiler from OCaml bytecode to Javascript

on which platform are you ?

meadofpoetry commented 6 years ago

on which platform are you ?

fedora 26, amd64. That is strange since

$ which js_of_ocaml
~/.opam/main/bin/js_of_ocaml
$ js_of_ocaml --version
3.0
$ opam list | grep js_of_ocaml 
js_of_ocaml             3.0               Compiler from OCaml bytecode to Javascript
js_of_ocaml-compiler    3.0               Compiler from OCaml bytecode to Javascript
js_of_ocaml-ocamlbuild  3.0               Compiler from OCaml bytecode to Javascript
js_of_ocaml-ppx         3.0               Compiler from OCaml bytecode to Javascript
js_of_ocaml-tyxml       3.0               Compiler from OCaml bytecode to Javascrip
dbuenzli commented 6 years ago

Thanks I now understand the issue, see the monologue here https://github.com/ocsigen/js_of_ocaml/issues/613. In any case your constraints are in as 29277f4db8524234b177f504dea7f2 and I submited https://github.com/ocaml/opam-repository/pull/10056 on the opam repo to make vg.0.9.0. use jsoo 3.0. Thanks for the help.