update rfc to follow changes

This commit is contained in:
damirka 2021-07-20 18:04:42 +03:00
parent 9facd3e984
commit d986621e1b

View File

@ -25,9 +25,7 @@ that we suggest few changes to Leo CLI and Manifest:
- allow custom names for imports to manually resolve name conflicts; - allow custom names for imports to manually resolve name conflicts;
- add "curve" and "proving system" sections to the Manifest; - add "curve" and "proving system" sections to the Manifest;
- add "include" and "exclude" parameters for "proving system" and "curve"; - add "include" and "exclude" parameters for "proving system" and "curve";
- add a lock file which would store imported dependencies and their relations;
Later this solution can be improved by adding a lock-file which would lock
imported packages based on both their contents and version.
# Motivation # Motivation
@ -109,12 +107,7 @@ To support updated Manifest new command should be added to Leo CLI.
```bash ```bash
# pull imports # pull imports
leo install leo fetch
```
Alternatively it can be called `pull`.
```
leo pull
``` ```
## Imports Restructurization ## Imports Restructurization
@ -155,6 +148,44 @@ first-program => author1-program@0.1.0
second-program => author2-program2@1.0.4 second-program => author2-program2@1.0.4
``` ```
## Leo.lock
For imports map to be generated and read by the Leo binary and then by the Leo compiler,
lock file needs to be created. Lock file should be generated by the `leo fetch` command
which will pull the dependencies, process their manifests and put the required information
to the file in the root directory of the program called `Leo.lock`.
Suggested structure of this file is similar to the Cargo.lock file:
```
[[package]]
name = "suit-mk2"
version = "0.2.0"
author = "ironman"
import_name = "suit-mk2"
[package.dependencies]
garbage = "ironman-suit@0.1.0"
[[package]]
name = "suit"
version = "0.1.0"
author = "ironman"
import_name = "garbage"
```
In the example above you can see that all program dependencies are defined as an
array called `package`, and each of the dependencies contains main information about
it, including the `import_name` field which is the name of the imported package in
the Leo program. Also, it stores relationships between these dependencies in the
field `dependencies`.
Format described here allows the Leo binary to form an imports map which can be
passed to the compiler.
It is important to note that Leo.lock file is created only when package has dependencies.
For programs with no dependencies lock file is not required and not created.
## Recursive Dependencies ## Recursive Dependencies
This improvement introduces recursive dependencies. To solve this case preemptively This improvement introduces recursive dependencies. To solve this case preemptively