daypack-dev / timere

OCaml date time handling and reasoning suite
MIT License
68 stars 7 forks source link

export scripts using outdated js_of_ocaml #43

Closed glennsl closed 2 years ago

glennsl commented 2 years ago

It's hard to tell which version of js_of_ocaml is targeted since there's no constraints specified for it anywhere that I can find, but I tested with 4.0.0 which resulted in:

File "export-js-tzdb-full/core.ml", line 8, characters 2-19:
8 |   Js.raise_js_error (new%js Js.error_constr (Js.string msg))
      ^^^^^^^^^^^^^^^^^
Alert deprecated: Js_of_ocaml.Js.raise_js_error
[since 4.0] Use [Js_error.raise_] instead.
File "export-js-tzdb-none/core.ml", line 8, characters 2-19:
8 |   Js.raise_js_error (new%js Js.error_constr (Js.string msg))
      ^^^^^^^^^^^^^^^^^
Alert deprecated: Js_of_ocaml.Js.raise_js_error
[since 4.0] Use [Js_error.raise_] instead.
File "export-js-tzdb-full/_unknown_", line 1, characters 0-0:
js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
File "export-js-tzdb-none/_unknown_", line 1, characters 0-0:
js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
make: *** [Makefile:13: all] Error 1   

and 3.11 which resulted in:

js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
File "export-js-tzdb-none/_unknown_", line 1, characters 0-0:
Error: Rule failed to generate the following targets:
- export-js-tzdb-none/export_all.bc.js
js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
File "export-js-tzdb-full/_unknown_", line 1, characters 0-0:
Error: Rule failed to generate the following targets:
- export-js-tzdb-full/export.bc.js
js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
File "export-js-tzdb-none/_unknown_", line 1, characters 0-0:
Error: Rule failed to generate the following targets:
- export-js-tzdb-none/export.bc.js
js_of_ocaml: unknown option `--debug-info'.
Usage: js_of_ocaml link [OPTION]... [JS_FILES]...
Try `js_of_ocaml link --help' or `js_of_ocaml --help' for more information.
File "export-js-tzdb-full/_unknown_", line 1, characters 0-0:
Error: Rule failed to generate the following targets:
- export-js-tzdb-full/export_all.bc.js
make: *** [Makefile:13: all] Error 1   

So I'd guess it's still on 2.x? Assuming js_of_ocaml does semantic versioning at least.

In order to make a tzlocal-js backend I have to make js_of_ocaml an explicit dependency, so it's probably a good time to update this as well.

glennsl commented 2 years ago

--debug-info is still an option in js_of_ocaml, but only for compile, not link

glennsl commented 2 years ago

The flag issue is actually because of dune 3. Not entirely sure why and how to fix it, as the docs seem to suggest flags only apply to compile and there's the separate link_flags stanza for link. But downgrading to 2.9.3 fixed it so :shrug:.

I'll still see about fixing the deprecation warnings though.