Commit Graph

433 Commits

Author SHA1 Message Date
Alessandro Di Federico bce32d9669 Default to --emit-hex-constant-literals-from=4096 2025-11-28 11:21:18 +01:00
Giacomo Vercesi 681e9543cf LocalStorageProvider: use table for model_paths
When running `invalidate`, use a temporary table to store the
invalidated model paths that need to be used. This saves to template
them into the query and allows them to be recycled later when the
`dependency` table needs to be cleaned up.
2025-11-26 16:13:28 +01:00
Giacomo Vercesi b1b5778822 Add infrastructure for custom invalidation
Add infrastructure to pypeline to allow for pipes to provide custom
invalidation, by implementing an `invalidate` function.
2025-11-26 16:13:28 +01:00
Giacomo Vercesi 8cff10e13b Introduce analyses that manipulate the model
Add 4 analyses to the pipebox that allow setting and verifying the model
and its diffs.
2025-11-26 16:13:28 +01:00
Giacomo Vercesi a821c0c268 pipeline yaml: allow specifying pure analyses
Some analyses do not require any container to run, these can be now
specified as a standalone array.
2025-11-26 16:13:28 +01:00
Giacomo Vercesi 2f7a055121 pypeline: convert pipe names to kebab-case 2025-11-26 16:13:28 +01:00
Giacomo Vercesi e3a47de0f1 Analysis: drop name argument in constructor
In the same vein as the `Pipe`'s counterpart, this feature is unused,
drop it for now.
2025-11-26 16:13:28 +01:00
Giacomo Vercesi 4a1edec018 get_registry: use name for selected classes
Use the `name` class attribute to build the registry when discovering
subclasses of `Pipe`, `Analysis` and `Container`.
2025-11-26 14:59:43 +01:00
Giacomo Vercesi 5e9bfa1d45 Artifact: fix typo in write_to_disk
Fix a typo in `write_to_disk` where the file open mode was set to `rb`
when it should have been `wb`.
2025-11-26 14:59:43 +01:00
Tommaso Fontana b7cf7d3266 Pypeline: add pype tests
Add some basic tests for the pype CLI command.
2025-11-24 16:41:15 +01:00
Tommaso Fontana 4e73bc05f3 Pypeline: fix pipebox args usage string on cli
The usage strings didn't always show '-- [PYPEBOX ARGS...]' or didn't
show it at the end of the usage string. This commit fixes it.
2025-11-24 16:41:15 +01:00
Tommaso Fontana 91299b0c18 Pypeline: change daemon pipeline format
Now the dameon's pipeline endpoint doesn't return just the parsed yaml
but it returns a format that's easier to use for the UI.
2025-11-24 16:41:15 +01:00
Tommaso Fontana 9f5ca81401 Pypeline: introduce analysis lists
Now in the pipeline.yml you can specify lists of analysis that are run
sequentially.
2025-11-24 16:41:15 +01:00
Tommaso Fontana fe3a5b6287 Pypeline: add --tar, --yaml to pype commands
Now commands 'pype project artifact' and 'pype pipeline run_pipe' now
accepts --format to specify in which format to serialize the resulting
container, and have --tar and --yaml shortcuts. Moreover, these commands
and 'pipe pipeline run_analysis' can automatically figure out the format
of containers so the user won't have to specify them most of the time.
2025-11-24 16:41:15 +01:00
Tommaso Fontana 4d25ba057d Pypeline: add yaml and tar format for containers
Now containers can be dump and loaded in both yaml and tar. Also the
container can automatically try to figure out the format of the
container. Moreover, now containers have to_bytes and from_bytes.
2025-11-24 16:41:15 +01:00
Giacomo Vercesi ca3c5113d9 Add recompile-isolated to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 8f5e7feb4f Add recompile savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 159ca6b965 Add LinkForTranslation to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi af4b447f89 Add CompileRootModule to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 7462c2daeb Add LinkSupport to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi d5aeb306f6 Add YieldAssembly to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi a834f874c9 Add ProcessAssembly to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 080c5017f1 Add HexDump to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi b77833d2bf Add enforce-abi savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 77f925c792 Add PromoteCSVs to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi a685cd1055 Add EnforceABI to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 9f46ddac6b Add isolate savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 0758a95110 Add AttachDebugInfo to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 0df05f97b7 Add Isolate to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 819538a5df Add CollectCFG to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi cf52901d6d Add GenerateModelTypeDefinition to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi ddb36fc70f Add ModelToHeader to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi fe9dda7a13 Add lifted savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 95365c1fb9 Add PureLLVMPasses{Root,}Pipe to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 97b471c888 Add Lift to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 25d3541864 Add ImportFiles to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 3a5b5de96b ImportFiles: fix returned dependencies
Also return a dependency on the `/Binaries` vector, so that if an
element is added it also invalidates.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi 1c07656448 pipebox.py: add initialize function
Add the `initialize` function to `pipebox.py`. This allows passing
command-line arguments to the pipebox.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 000d75dbb7 pypeline: add check_precondition to Pipe
Add the `check_precondition` function to the `Pipe` class. This will be
run before the actual schedule creates containers and runs itself
proper.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 38921a182c Pipe: drop incorrect assertion
In `prerequisites_for`, if a pipe has a container in `READ` then it
needs to be forwarded backward, not asserted on.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 5a530e66dc Savepoint: optimize run function
Optimize the `run` function to skip objects that have just been
serialized when deserializing objects for outgoing requests. For
example, previously if a schedule had for a savepoint:

```yaml
incoming: ["/binary"]
outgoing: ["/binary"]
```

then the `Savepoint.run` function would have first serialized the object
into storage and then deserialized it right after, instead with the new
function the object is only serialized.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 94e9712927 Requests: add overloaded get
Overload the `get` function of `Requests` so that, in addition to the
usual `Mapping` behavior, will return an empty `ObjectSet` if no default
is specified.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi a3a3967625 Pipeline: fix graph function
Fix a few bugs present in the `Pipeline.graph` function which lead to
the graph being completely unconnected.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 437d86d8cb Pipeline: improve schedule
Improve the `schedule` in the `Pipeline` class by introducing two
optimizations:
* Prune all the `ContainerDeclarations` that are not actually used.
* Skip all tasks that have no outgoing elements that would have been
  written by them.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 2875565b9f Pipeline: show minimized request on assertion
When asserting that a request should be empty, show a minimized version
with all the empty members removed, for ease of reading.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 964abca598 pypeline: allow multiple root nodes
Change the `Pipeline` class and `pypeline_parser.py` to allow multiple
root nodes to be specified when creating a `Pipeline` object.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi d42cd5aeab pypeline: allow arbitrary config objects
Allow the `configuration` field of a pipe in a pipeline yaml file to be
of any type. When constructing the pipe object, the object will be
re-serialized via `yaml.dump` before being passed to the constructor.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi c0e35d080e ContainerDeclaration: enable order
`ContainerDeclaration` needs to be orderable (e.g. have `__lt__`) to
allow `deterministic_sort_key` to work.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi 824ec6194a PipelineNode: improve __repr__ function 2025-11-17 10:04:12 +01:00
Giacomo Vercesi d90f6ff0f5 revng2: use cache_directory from support 2025-11-17 10:04:12 +01:00