Tests are not supposed to write outside of their working space, so dune
should not use a cache in the home directory: because of this, OCaml
tests currently fail when the Secure Control Plane is enabled. Disable
the Dune Cache to avoid this.
This is a requirement following making Lankit nodes, analysis units and
tokens Truffle objects (and depending at runtime on the 'truffle-api'
module).
Including 'truffle-api' in a shaded JAR breaks its compatibility with
the 'native-image' tool, causing tests to fail. We now package Java
bindings dependencies in the '<build_dir>/java/target/lib' directory.
This solution is currently the one used by the Langkit generic LSP and
LKQL JIT.
Now that the Python DSL is retired, it no longer makes any sense to call
`langkit.diagnostics.extract_location_from_traceback`, as no traceback
frame will even contain location information that is meaningful for the
DSL. Replace it with explicit `location` constructor arguments instead.
Remove the `lexer` and `grammar` arguments for `CompileCtx.__init__` as
well as the `types_from_lkt` config setting, and make the `lkt_spec`
config entry mandatory: all aspects of language specs now have to come
from Lkt source code.
For some commands, like "lkm setenv" or "lkm run", it is not possible to
determine whether direct access to C headers will be needed eventually,
so unconditionally give access to them. Since the only C header present
in the generated sources is the language-specific header, this should
not be a problem in practice.
This new command line tool has the same CLI as current manage.py
scripts, but automatically loads "langkit.yaml" files configurations, so
that language specs do not have to write Python code to subclass
ManageScript.
The root directory is always supposed to be inferred from the context
(where manage.py or langkit.yaml files are located): do not allow the
YAML configuration to initialize it.
Also rework lkt_compile and lkt_build_and_run test drivers so that the
language spec configuration bits are stored in the testcase's test.yaml
file directly: no need to add glue code in various places (test driver,
lkt_compile.py/lkt_build_and_run.py scripts) to support a new kind of
language spec configuration.
Replace the messy collection of arguments for CompileCtx.__init__ and
CompileCtx.create_all_passes with better organized dataclasses in the
new langkit.config module. Update the codebase to use these data
structures.
Add a --charset argument that the unparse main uses to decode the source
files to reformat, and to encode the reformatted content. Also enhance
the lkt_build_and_run driver so that it can run mains with heterogeneous
encodings (one that outputs UTF-8 and another that outputs ISO-8859-1,
for instance).
Rework the formatting for the listing of optional passes, refactor the
handling of --pass-on/--pass-off (to enable/disable optional passes), fix
a couple of crashes and add a testcase to exercise this little used part
of Langkit.
Whether or not case insensitivity should be enabled is tied to the
language itself, so this setting belongs to the language specification
better than to a CompileCtx argument.