Commit Graph

182 Commits

Author SHA1 Message Date
Louis Gesbert
1412e76938 Clerk: fix OCaml linking options to allow inlining
Fixes occurences of `Warning 58 [no-cmx-file]: no cmx file was found in path for
module` during builds.
2024-04-23 16:01:23 +02:00
Louis Gesbert
96ea034839 Clerk: clean up CATALA_* variables on tests 2024-04-19 16:50:36 +02:00
Louis Gesbert
1de18f0e04 Preserve the capitalisation of module filenames
Module names must be capitalised (start with a capital letter), and the name of
the file on disk must match ; however, matching up to capitalisation is allowed,
i.e. the file on disk can start with a lowercase letter.

A mismatch between Clerk assuming generated module artifacts would match the
capitalised module name, and `catala depends` matching the names of files on
disk (because it would otherwise mean treating dependencies differently
depending on if they originate from modules or not) was causing "file not found"
errors later on in the compilation chain.

This patch enforces that the capitalisation of the original file name on
disk (which is always known) takes precedence in Clerk, matching the behaviour
of `catala depends` and fixing the issue. It's also actually a small
simplification in Clerk code.
2024-04-15 23:00:56 +02:00
Louis Gesbert
98fc97a241 Rewriting message calls to use the new intf 2024-04-10 19:26:23 +02:00
Louis Gesbert
c9dca1fc6d Fix multi-repo compilation and the 'make alltest' target 2024-03-20 14:41:10 +01:00
Louis Gesbert
1a17098297 Move file functions that were in Cli to File
it's now possible because Globals where moved away
2024-03-19 15:26:32 +01:00
Louis Gesbert
0908ed85c3 Clerk: generate all .mli files as well 2024-03-19 15:26:32 +01:00
Louis Gesbert
4cec981f62 Move global options of Cli to their own module
This resolves a dependency cycle that would forbid `Cli` from using the modue
`File`, which was annoying.
2024-03-19 15:18:35 +01:00
Louis Gesbert
77ba1b8b38 Clerk: split OCaml compiler & link rules
and fix call to `catala depends` for OCaml linking
2024-03-14 14:04:52 +01:00
Louis Gesbert
ff06ddf40c Fixing linking across modules for backends
- This adds a `catala depends` command that recursively tracks module dependency.
It can then be used by Clerk for linking.

- Generation of cmo object files are added for OCaml (we only built native
objects, but jsoo requires bytecode).

- Some fixes to the generation of value embed/deembed shims (related to types
coming from different modules ; add support for options ; etc.)
2024-03-08 17:36:00 +01:00
Louis Gesbert
70cbfdb9ac Add a CATALA_INCLUDE env variable
It'll help while we wait for the implementation of project-wide specifications.
2024-03-08 17:36:00 +01:00
Louis Gesbert
bc3add57ec Fix plugins lookup dir when Catala is installed to PATH 2024-03-08 17:36:00 +01:00
Louis Gesbert
c1cd32a8f8 Clerk: skip unchanged tests when running with '--test-flags'
To avoid duplicating runs of identical tests: other tests are unaffected by the
flags.

Also tweak the Makefile to avoid multiple dune runs
2024-02-26 14:56:43 +01:00
Louis Gesbert
b43cc04e16 Clerk tests: use separate dirs for different flags, to preserve caching
The default output remains at the top of _build if no specific flags have been
given, the others are in `_build/test<flags>`
2024-02-26 14:56:43 +01:00
Louis Gesbert
20c1dee5cb Tests: add catala test-scope pseudo-command for inline tests 2024-02-26 14:56:43 +01:00
Louis Gesbert
e0928677b1 Small ocaml/js output rehaul
Print to json directly rather than depend on yojson and a ppx.

Note: this should be tested with the website in order to validate that the Json
output is 1-to-1.
(a second step could be to simplify this output, now that it's manual)
2024-02-21 11:28:56 +01:00
Louis Gesbert
98ad084062 Clerk: add python targets 2024-02-19 10:44:20 +01:00
Louis Gesbert
eb4ba114d2 Add test for literate LaTeX output 2024-02-15 14:53:26 +01:00
Louis Gesbert
9c84457c36 Clerk: improve progress messages 2024-02-12 18:00:27 +01:00
Louis Gesbert
f7672857a7 Formatting 2024-02-09 18:36:12 +01:00
Louis Gesbert
82fb66daef Clerk: fix options passed to catala in out-test mode 2024-02-09 10:54:58 +01:00
Louis Gesbert
34ae4f6156 Clerk: fix sometimes not rebuilding cmxs files 2024-02-05 16:28:56 +01:00
Denis Merigoux
d7e71885c1
Formatting 2024-02-01 17:22:42 +01:00
Louis Gesbert
54ca62a78e Fix definition and usage of the C backend test
(including fix of Clerk about "legacy tests")
2024-02-01 15:59:45 +01:00
Louis Gesbert
d9a17db4c0 Fix running inline tests
Warning: one of them is broken and was disabled
2024-01-18 16:14:27 +01:00
Louis Gesbert
fcb7ef61ff Clerk: fix @post file popping in src dirs 2024-01-16 18:07:31 +01:00
Louis Gesbert
538e97dfd3 Install Python and R runtimes
Runtimes for the various backends are expected to be made available from their
own ecosystem. However, for convenience and to help with development
settings (where the runtime might change), as part of installing catala they are
put, in source form, into `<prefix>/lib/catala/runtime_LANG`.

When using a dev version of Catala, and using Python, one would then just have
to do `pip install <prefix>/lib/catala/runtime_python` within their venv to be
able to run their python programs.
2024-01-16 11:54:28 +01:00
Louis Gesbert
ce812a6685 ninja_utils has been moved away 2024-01-16 11:54:28 +01:00
Louis Gesbert
acdaf7c57d Remove french_law, examples, merge clerk into catala package 2024-01-16 11:54:23 +01:00
Louis Gesbert
5b1462d529 Clerk: allow to include non-yet-existing directories
Useful when you have wide `-I` options that not all targets may depend on.
2023-12-08 13:56:31 +01:00
Louis Gesbert
7160093682 Allow scope execution in compiled ocaml executables 2023-12-06 11:06:54 +01:00
Louis Gesbert
54d956823b Some module fixes 2023-12-06 11:06:54 +01:00
Louis Gesbert
9a255522be Document and first test for externals
Also some fixes for Clerk to properly support them
2023-12-06 11:06:54 +01:00
Louis Gesbert
1ae955b504 Reformat 2023-11-30 23:53:38 +01:00
Louis Gesbert
8df49dcea2 More tests and some fixes 2023-11-30 23:49:19 +01:00
Louis Gesbert
3649f92975 Rework resolution of module elements
This changes the `decl_ctx` to be toplevel only, with flattened references to
uids for most elements. The module hierarchy, which is still useful in a few
places, is kept separately.

Module names are also changed to UIDs early on, and support for module aliases
has been added (needs testing).

This resolves some issues with lookup, and should be much more robust, as well
as more convenient for most lookups.

The `decl_ctx` was also extended for string ident lookups, which avoids having
to keep the desugared resolution structure available throughout the compilation
chain.
2023-11-30 21:14:12 +01:00
Louis Gesbert
86b7f80e90 Clerk improvements
- Add a `-I` option that allows defined modules to be available from other
  directories

- Add reporting of the number of successful / failed tests

- Locate the project root, and always run the commands from there
2023-11-30 21:14:12 +01:00
Louis Gesbert
c019d1568f Clerk: fix handling of dependency on the catala exec 2023-11-30 17:46:38 +01:00
Louis Gesbert
d4198f52b4 Reformat 2023-11-28 17:22:46 +01:00
Louis Gesbert
5b5790b95b Fix compilation of the clerk opam package 2023-11-28 15:33:30 +01:00
Louis Gesbert
fca3221b78 Ensure dune exec -- clerk ... runs an up-to-date catala exec 2023-11-27 11:09:08 +01:00
Louis Gesbert
4f22f412d2 Clerk: fix catala lookup function again 2023-10-11 13:47:37 +02:00
Louis Gesbert
186e2dfa64 Clerk: fix lookup of 'catala' command in PATH 2023-10-11 12:03:10 +02:00
Denis Merigoux
24e43861f8
Fix wrongly located catala runtime library 2023-10-10 14:11:53 +02:00
Louis Gesbert
a9dc1f46b4 Clerk: ensure error messages are printed properly 2023-10-09 11:23:50 +02:00
Louis Gesbert
2708fa53b2 Reformat 2023-10-03 18:50:18 +02:00
Louis Gesbert
22045a2f06 Tests and fixes on structures across modules 2023-10-03 18:43:14 +02:00
Louis Gesbert
e9a028c5f2 Clerk: use tag suffixes rather than prefixes
Clerk always generates parent dirs so using prefixes resulted in empty
`test@foo/bar` directories getting created
2023-10-02 18:24:24 +02:00
Louis Gesbert
cc7c3fc18c Clerk: add more tests, and small fixes 2023-10-02 17:51:16 +02:00
Louis Gesbert
a79acd1fa8 Reformat 2023-09-27 13:19:04 +02:00