This commit fixes file output `revng.api` in two ways:
* The buffer's size is properly reported in `PipelineC.cpp`
* The function `deserialize_container` in `revng.api.manager` no longer
appends a `\0` to `content`, while avoiding a redundant copy
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
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.
Drop the use of requests in the daemon tests, use aiohttp instead as
it allows the use of unix sockets, which simplifies the creation of
multiple ephimeral daemons
Handle crashes via signal handlers. Switch python's revng.api from
a normal python function to faulthandler, which works also in the
case of harsher interruptions (e.g. SIGABRT).
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
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.