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.
Change the behavior of `revng daemon` to avoid a crash at shutdown
caused by `rp_shutdown` not being called due to the pointer of
`rp_manager` not being freed.
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.
* Let GraphQL accept zero or more parameters for analyses
* Handle the general case of analyses using zero or more containers with
a variable ammount of targets
Rework the startup code used to boot starlette, this allows removing the
use of all globals, moreover it allow dropping the ManagerMiddleware
class as it is no longer needed.
This change fixes the pipeline behavior when producing targets:
* produce and extract now return rp_buffer, which has a start pointer
and size
* the python api `revng.api` will return on produce/extract either str
or bytes depending on the mime type of the container
* the GraphQL api will encode bytes in base64
rp_shutdown must be called after all the owning pointers given by
PipelineC are freed, in order to guarantee this easily, the python
ApiWrapper will use an atomic counter, which when shutdown has been
signaled and counter reaches zero will automatically call rp_shutdown
Rework both classes in schema_generator.py, main changes:
* Drop manager.pipeline_artifact_structure as it was used exclusively
by SchemaGenerator and is no longer needed
* Rename SchemaGen and BindableGen to SchemaGenerator and
DynamicBindableGenerator to better express their role, add
docstrings that explain what they do
* Decouple Artifacts and Analyses discovery, since a step can have
analyses and no artifacts (and vice-versa)
A step's artifacts now include singleTargetFilename, which gives a
suggested filename to use when a single element is extracted from the
underlying container.
When requesting a produce for multiple targets the result will be a
dictionary mapping "<target>:<result>". This also changes the GraphQL
API where a json-serialized string is returned.
In typical scenarios most PipelineC calls block for too long, this is
debilitating to the GraphQL API since coroutines are run
cooperatively. This commit moves all PipelineC calls in a separate
thread.
Add the possibility of passing a list of FIFOs to `revng daemon`. These
can be used to notify an external program when a non-reproducible change
(binary, context) has occurred.
Splits the module in 2:
* static_handlers: as the name suggests this is where handlers for
static endpoints (e.g. not dependent on the pipeline) are implemented
* schema_generator: this is where the schema is generated from a
manager's pipeline definition, together with the handler for the
autogenerated endpoint
This commit introduces some changes to how the revng pipeline handles
serializing to disk. Specificaly:
* Pipeline globals (specifically model.yml) are better handled if they
are in a subdirectory. They are now saved in the "context"
subdirectory.
* In python:revng.api the pipeline is serialized whenever there is a
non-reproducible change to the state (e.g. binary upload or model
change).
In the case of analyses this is done conservatively by checking that
the diff produced is not empty.
* The logic for computing a step's subdirectory has been moved to the
pipeline runner, consequently if a step is asked to serialize it
will not create any subdirectories.
* Functionality for saving a single step/context has been exposed in
Pipeline C.
* Finally, all path concatenations are now handled by
llvm::sys::path::append, for extra os-agnosticism.