OCamlPro / freeton_wallet

The 'ft' tool is a multi-account terminal wallet for the Free TON blockchain. It is based on the freeton_ocaml_sdk.
https://ocamlpro.github.io/freeton_wallet
Other
14 stars 9 forks source link

Promote pgocaml preprocessed files #21

Closed AltGr closed 3 years ago

AltGr commented 3 years ago

This renames src/freeton_crawler_lib/db.ml to db.pp.ml, and similarly for db_utils, adjusts the dune build rules so that the ppx is run by hand and its results staged (as db.ml, db_utils.ml resp.)

This removes dependencies towards a running and properly configured pgsql instance during compilation as a package, while keeping the current behaviour when building "by hand" in developer mode.

AltGr commented 3 years ago

Ref. https://github.com/ocaml/opam/issues/4674

This is I think the most sane solution to the problem mentioned in that issue, as it effectively makes the package build isolated and independent from a running database server; while not adding too much complexity, and keeping the same flexibility for developers.

NB: don't look at the git diff for .mls, the source files have just been renamed.

AltGr commented 3 years ago

(note: I edited the dune files directly, but you may want to backport this into drom space)

AltGr commented 3 years ago

tests fail because they try to build without pgocaml_ppx; one solution could be to add --ignore-promoted-rules to the CI build to still build using the staged artifacts, another to explicit the dependency of freeton_crawler_lib to pgocaml_ppx so that dune doesn't try to build it if unavailable.