This commit introduces the concept of `Component` to a pipeline step.
This, in turn, can be used by clients to figure out which artifacts are
produced by which revng component.
Additionally, this commit overhauls the `revng daemon-self-test`
command, renaming it to `revng graphql` and adding extra flexibility.
Remove the logic for computing a manager's workdir using the
REVNG_PROJECT_ID environment variable, as it was unused. The
REVNG_DATA_DIR remains to allow persistence across restarts.
Rework how the cache folder for debug information is handled. This
commit introduces an additional environment variable, `REVNG_CACHE_DIR`
that allows overriding where semi-disposable files will be stored.
Some files had discordant executable bit presence and shebang presence.
This commit fixes these occurrences by adding removing the required
feautures where needed.
Add additional config options to the `revng-check-conventions` config to
make mypy work with the revng codebase (mainly related to untyped
functions now causing a warning in mypy).
Refactor the `run` and `try_run` functions in 4 separate functions:
* `try_run`: Run the process and return the exit code
* `run`: Run the process and assert the exit code was 0
* `exec_run`: exec the process, stopping execution of the python
interpreter
* `popen`: Wrapper around `subprocess.Popen`, allows the most
flexibility
Add support for tracing onto the PipelineC. This is done by:
1. Creating wrapper functions for each PipelineC function with the
script in `scripts/PipelineC_add_tracing.py`. These will call a
special function called `wrap` which will ultimately call a method
with a `_` prepended to the name
2. Conversion of all PipelineC methods in `PipelineC.cpp` to `static`
and their rename with a `_` in front, in order for them to work with
the wrapper function in (1)
3. Generation of 2 additional include files, one for types and one for
functions, to be used by users of tracing files in order to have
introspection.
These steps allow the creation of a trace file with the use of the
`REVNG_C_API_TRACE_PATH` environment variable. The traces can then be
used in conjunction with the `revng trace run` and `revng trace
inspect` commands.
This commit does 2 main things:
* Adds PYTHONMALLOC=1 environment variable when `--valgrind` is used
to force python to use normal malloc instead of the custom allocator
python normally uses that's not friendly with valgrind
* Add a suppression file to remove a couple of false-positives that
happen consistently and generate useless noise
If needed, wrap the execution of scripts in `exec` to allow running
them with gdb. This is especially useful for running python scripts
that use cffi and being able to inspect the C/C++ side.
There was a codepath in `revng-check-conventions` that would cause
`fail(e)` to be called twice. This would cause an exception on the
second invocation due to the undelying process being already terminated.
We introduce two paths where we can hard code search prefixes
(`/additional-search-prefixes`) and additional binaries paths
(`/share/revng/additional-bin-paths`).
This enables us to add to `additional-bin-paths` the configure-time
specified path of the preferred LLVM installation, instead of relying on
`PATH` to look up, e.g., `opt` at run-time.
There was a log message that we are creating typedef void* for empty
structs, but we have missed that piece of code. This patch adds that
logic.
In the case of unions, we completely ignored empty ones, and also
there was not handling if the type was generated by ordinal (as
in the case of structs). This patch also fixes it.
This new command will, given an executable, try to produce all
artifacts. By default it will run `revng daemon`, however an external
address can be provided to test remote daemons, e.g. running inside a
container.
Hypercorn is experiencing weird behaviour when running tests and
receiving SIGPIPEs when a couple of F5s are issued from the browser.
The switch to uvicorn fixed these issues.
When revng cli was invoked with a bare namespace, e.g. `revng ptml`
it would produce an ugly exception.
Fix this behavior by instead rerunning the command with `--help`
appended.
This commit introduces some miscellaneous fixes to revng.cli:
* Remove useless subclasses in pipeline_tools.py;
* Improve type annotations in _commands/ptml and fix a help string;
* Add some extra type annotations for `Command`;
* Remove useless namespaces in `commands_registry` and add help text
for the ones in use;