Commit Graph

261 Commits

Author SHA1 Message Date
Louis Gesbert
583e80993a Remove the with-exceptions backend
*Disclaimer*: This is intended for discussion

My impression is that the with-exceptions backend is to be superseded by the
without-exception backend, which is more general and more efficient. Therefore,
seeing the added complexity of maintaining the two in parallel, I see no good
reason to keep the with-exceptions version now that the equivalence of their
semantics have been proved.

It will also be nice to reduce divergences between the different backends ; and
this should make further simplifications possible (e.g. some thunkings may no
longer be needed)

Of course I am ready to hear arguments in favor of keeping it, be it in the mid-
or long-term.

This patch removes the `--avoid-exceptions` flag, making it the only option, and
the corresponding `with_exceptions` variant of the dcalc->lcalc translation. It
doesn't do further simplifications.
2024-07-04 15:08:13 +02:00
Louis Gesbert
e78ea378bd Add clerk XML reports to Github 2024-07-04 15:08:13 +02:00
Louis Gesbert
52f1f14a08 Fix for opam 2.1.6
The fix for the annoying bug with --assume-built has not been backported from
the 2.2 branch.
2024-06-26 17:50:04 +02:00
Louis Gesbert
a8a81a199b Makefile: fix annoying leftover .tmp dirs on make alltest 2024-06-21 12:53:53 +02:00
Louis Gesbert
62414562eb Makefile: fix target website-assets.tar 2024-05-15 11:32:01 +02:00
Louis Gesbert
8ad3b68d5f Fix 'make testsuite' return value 2024-05-06 21:39:58 +02:00
Louis Gesbert
a8635f0e61 Simplify unthunking function ; cleanup warnings in 'make testuite' 2024-04-30 17:56:06 +02:00
Louis Gesbert
791ae3229b Messages: adjust to terminal width 2024-04-26 15:40:55 +02:00
Louis Gesbert
aa38d1b2ca Update the syntax cheat-sheet, add a consistency tests
Should now have all latest syntax updates and additions, along with some
reformatting to make it fit.
2024-04-16 23:20:37 +02:00
Louis Gesbert
c9dca1fc6d Fix multi-repo compilation and the 'make alltest' target 2024-03-20 14:41:10 +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
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
cafad727fe Update the generation process of the website assets
Now they're more simply bundled into a `tar` file generated from the `Makefile`.
2024-02-21 11:28:56 +01:00
Louis Gesbert
584ba7dfbc Some fixes to 'make alltest' 2024-02-14 14:57:40 +01:00
Louis Gesbert
b04ee2afd1 Makefile: add convenience rule to simulate CI tests
Run `make alltest` to include catala examples and french-law stuff!
2024-02-12 14:23:49 +01:00
Louis Gesbert
71551ccce8 Makefile: add an 'alltest' convenience rule that tests catala-examples
Convenient before filing a PR
2024-02-12 11:16:04 +01:00
Louis Gesbert
d57eb023dd Skip compiling to js for running the tests
(making iterations quite a bit faster)
2024-02-05 16:28:56 +01:00
Louis Gesbert
13bc62a561 Build: make partial pattern-matchings always fatal
and fix the `make` clean rule
2024-01-26 11:22:12 +01:00
Louis Gesbert
7f6f89c4c4 Build the html manpages as part of the doc target 2024-01-19 16:12:29 +01:00
Louis Gesbert
c006c3343e Rehaul CI to run examples and generate artifacts again
this requires to fetch catala-examples and french-law from their own repos

Restrict static builds and publication to master
2024-01-18 16:14:27 +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
55b69b1e55 promote install 2024-01-16 11:54:28 +01:00
Louis Gesbert
e0c2c58687 Makefile: remove references to the examples 2024-01-16 11:54:28 +01:00
Louis Gesbert
4ff65aa01a Makefile: make install now actually installs 2024-01-16 11:54:28 +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
acdaf7c57d Remove french_law, examples, merge clerk into catala package 2024-01-16 11:54:23 +01:00
Emile Rolley
a809410338 refactor(build): run example.js after compiling french_law.js 2023-12-08 16:10:18 +01:00
Emile Rolley
f320b503b7 fix(build): correctly manage the aides_logement example 2023-12-01 15:06:47 +01:00
Emile Rolley
f81561449a build(assets): remove the ocaml doc generation from website-assets-base 2023-12-01 11:20:47 +01:00
Denis Merigoux
efd175a390 Remove from scripts 2023-09-13 16:16:48 +02:00
Louis Gesbert
b5baa91a2e Add (half-baked) test on module usage
Half-baked because clerk doesn't know to order the tests properly at the moment,
and we spit compiled files into the source test directory.
2023-08-31 18:31:48 +02:00
Louis Gesbert
9bac045d03 Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
Louis Gesbert
0f9ee2c72e Refacter the main Driver module
- Use separate functions for successive passes in module `Driver.Passes`
- Use other functions for end results printing in module `Driver.Commands`

As a consequence, it is much more flexible to use by plugins or libs and we no
longer need the complex polymorphic variant parameter.

This patch leverages previous changes to use Cmdliner subcommands and
effectively specialises the flags of each Catala subcommand.

Other changes include:

- an attempt to normalise the generic options and reduce the number of global
  references. Some are ok, like `debug` ; some would better be further cleaned up,
  e.g. the ones used by Proof backend were moved to a `Proof.globals` module and
  need discussion. The printer no longer relies on the global languages and prints
  money amounts in an agnostic way.
- the plugin directory is automatically guessed and loaded even in dev setups.
  Plugins are shown by the main `catala` command and listed in `catala --help`
- exception catching at the toplevel has been refactored a bit as well; return
  codes are normalised to follow the manpage and avoid codes >= 128 that are
  generally reserved for shells.

Update tests
2023-07-03 16:42:54 +02:00
Denis Merigoux
71ead0c6fa
Remove all mentions 2023-06-19 12:01:06 +02:00
Emile Rolley
1d9388a339 feat(french_law/js): add a ReScript wrapper for french_law.js 2023-05-07 15:13:22 +02:00
Louis Gesbert
ebf957008d Makefile: loading venv is no longer required for most rules 2023-03-14 17:35:22 +01:00
Louis Gesbert
7914d9aaef Build: enforce "release" profile for website-assets
but make sure to keep a consistent dune profile otherwise for `make all`,
avoiding multiple rebuilds.

This saves 30s CPU time on a `make all` that doesn't specify
`DUNE_PROFILE=release`
2023-03-14 13:49:50 +01:00
Denis Merigoux
283d82bfce
French law JS must be created with a dune release profile 2023-03-14 11:53:27 +01:00
Louis Gesbert
2d0019101a Makefile: add shortcut to build the cheat-sheet
useful to avoid having to manually activate the python venv
2023-03-02 16:24:53 +01:00
Louis Gesbert
cf2e80ba51 Refactor Python dependency handling
* Use the newer "pyproject.toml" for syntax highlighters
* Use venv for everything (previously, the pygment lexers were installed
  globally, but more recent Python releases frown upon that. This will probably
  be more stable in the long run...)
* Use one venv at the root of the project (`_python_venv/`) for both
  pygments and the runtime
* Initialise this venv automatically from the Makefile (it should no longer be
  necessary to run scattered `set_up.sh` scripts with mysterious interactions)

On the downsides, though:
* Only tested with Python 3.11 at the moment
* Need to remember to activate the venv (`. _python_venv/bin/activate`) from the
  root for e.g. HTML literate output to work. A more manageable solution could
  be for Catala to provide the lexers on-the-fly when calling `pygmentize`.
2023-03-02 16:24:53 +01:00
Louis Gesbert
c393dfb75e CI improvements attempt
- fix dune compilation options: ensure both no dev failure on warnings and CI
  failure on warnings (the defaults do neither of those things !)

- attempt to publish the build artifacts to github-pages, so that they could be
  made more easily available and we could maybe remove the ones that are still
  there from the main repo
2023-02-28 17:55:34 +01:00
Denis Merigoux
76d5e44685
More man pages 2023-01-04 17:34:09 +01:00
Louis Gesbert
5a553149ff Makefile: ensure compiler is up-to-date when running tests 2022-10-04 14:50:37 +02:00
Denis Merigoux
6e64f769a0
Update assets and rename executable 2022-09-08 15:16:39 +02:00
Denis Merigoux
1990b0b970
Code compiles 2022-09-06 17:25:57 +02:00
Denis Merigoux
5bddde1c68
Fix documentation and test invocation 2022-08-30 13:48:20 +02:00
Denis Merigoux
c71b8e28c6
Moving parameters into property-section of data 2022-08-12 11:16:52 +02:00
Denis Merigoux
da06bedaca
Fix HTML line numbers 2022-08-11 16:15:52 +02:00