AdaCore / RecordFlux

Formal specification and generation of verifiable binary parsers, message generators and protocol state machines
Apache License 2.0
104 stars 6 forks source link

Allow updating of generated files #1275

Closed treiher closed 1 year ago

treiher commented 1 year ago

Context and Problem Statement

Two consecutive runs of rflx generate with the same input files lead to an error, as rflx generate refuses to overwrite existing files to ensure not creating conflicts with existing files (see #993). The need to explicitly clean the target directory can be annoying while working on a specification.

Considered Options

O1 Add CLI option

Add a CLI option (e.g., --clean) which, leads to removal of all files in the target directory before generation.

+ Simple User action necessary

O2 Do not show error if all existing files are overwritten

+ In many cases, no additional user action necessary In some cases, e.g., after renaming a message type, manual cleaning of target directory is still necessary

O3 Store metadata to track dependencies of generated files

By tracking the dependencies between generated files, it could be possible to ensure that no partial updates are performed and no files, that are not required anymore, are left over.

+ No user action necessary Possibly complex corner cases

Decision Outcome

O2

treiher commented 1 year ago

The behavior is changed in RecordFlux 0.10.0.