From 9cb498eee64196ab4aa3aaa8b5aa1481b8317b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 27 Nov 2017 06:13:12 +0100 Subject: [PATCH] Jbuilder: Move `alpha/genesis/demo` in their own two OPAM packages One package for the embedded version. One for the functorized one. --- jbuild | 4 ++ .../docs/language.md | 0 lib_embedded_protocol_alpha/jbuild | 40 ++++++++++++ .../src}/TEZOS_PROTOCOL | 0 .../src}/amendment.ml | 2 + .../src}/amendment.mli | 0 .../src}/apply.ml | 0 .../src}/baking.ml | 0 .../src}/baking.mli | 0 .../src}/block_header_repr.ml | 0 .../src}/block_header_repr.mli | 0 .../src}/bootstrap_storage.ml | 0 .../src}/bootstrap_storage.mli | 0 .../src}/constants_repr.ml | 0 .../src}/contract_repr.ml | 0 .../src}/contract_repr.mli | 0 .../src}/contract_storage.ml | 0 .../src}/contract_storage.mli | 0 .../src}/cycle_repr.ml | 0 .../src}/cycle_repr.mli | 0 .../src}/fitness_repr.ml | 0 .../src}/fitness_storage.ml | 0 .../src}/init_storage.ml | 0 .../src}/jbuild | 35 ++++------- .../src}/level_repr.ml | 0 .../src}/level_repr.mli | 0 .../src}/level_storage.ml | 0 .../src}/level_storage.mli | 0 .../src}/main.ml | 0 .../src}/main.mli | 0 .../src}/manager_repr.ml | 0 .../src}/manager_repr.mli | 0 .../src}/michelson_v1_primitives.ml | 0 .../src}/michelson_v1_primitives.mli | 0 .../src}/misc.ml | 0 .../src}/misc.mli | 0 .../src}/nonce_storage.ml | 0 .../src}/nonce_storage.mli | 0 .../src}/operation_repr.ml | 0 .../src}/operation_repr.mli | 0 .../src}/period_repr.ml | 0 .../src}/period_repr.mli | 0 .../src}/public_key_storage.ml | 0 .../src}/public_key_storage.mli | 0 .../src}/qty_repr.ml | 0 .../src}/raw_context.ml | 0 .../src}/raw_context.mli | 0 .../src}/raw_level_repr.ml | 0 .../src}/raw_level_repr.mli | 0 .../src}/reward_storage.ml | 0 .../src}/reward_storage.mli | 0 .../src}/roll_repr.ml | 0 .../src}/roll_repr.mli | 0 .../src}/roll_storage.ml | 0 .../src}/roll_storage.mli | 0 .../src}/script_int_repr.ml | 0 .../src}/script_int_repr.mli | 0 .../src}/script_interpreter.ml | 0 .../src}/script_interpreter.mli | 0 .../src}/script_ir_translator.ml | 0 .../src}/script_ir_translator.mli | 0 .../src}/script_repr.ml | 0 .../src}/script_repr.mli | 0 .../src}/script_timestamp_repr.ml | 0 .../src}/script_timestamp_repr.mli | 0 .../src}/script_typed_ir.ml | 0 .../src}/seed_repr.ml | 0 .../src}/seed_repr.mli | 0 .../src}/seed_storage.ml | 0 .../src}/seed_storage.mli | 0 .../src}/services.ml | 0 .../src}/services_registration.ml | 0 .../src}/storage.ml | 0 .../src}/storage.mli | 0 .../src}/storage_functors.ml | 0 .../src}/storage_functors.mli | 0 .../src}/storage_sigs.ml | 0 .../src}/tez_repr.ml | 0 .../src}/tez_repr.mli | 0 .../src}/tezos_context.ml | 0 .../src}/tezos_context.mli | 0 .../src}/tezos_hash.ml | 0 .../src}/time_repr.ml | 0 .../src}/time_repr.mli | 0 .../src}/vote_repr.ml | 0 .../src}/vote_repr.mli | 0 .../src}/vote_storage.ml | 0 .../src}/vote_storage.mli | 0 .../src}/voting_period_repr.ml | 0 .../src}/voting_period_repr.mli | 0 .../tezos-embedded-protocol-alpha.opam | 21 +++++++ .../tezos-protocol-alpha.opam | 21 +++++++ lib_embedded_protocol_demo/jbuild | 40 ++++++++++++ .../src}/TEZOS_PROTOCOL | 0 .../src}/error.ml | 0 lib_embedded_protocol_demo/src/jbuild | 53 ++++++++++++++++ .../src}/main.ml | 0 .../src}/services.ml | 0 .../tezos-embedded-protocol-demo.opam | 21 +++++++ .../tezos-protocol-demo.opam | 21 +++++++ lib_embedded_protocol_genesis/jbuild | 40 ++++++++++++ .../src}/TEZOS_PROTOCOL | 0 .../src}/data.ml | 0 lib_embedded_protocol_genesis/src/jbuild | 53 ++++++++++++++++ .../src}/main.ml | 0 .../src}/services.ml | 0 .../tezos-embedded-protocol-genesis.opam | 21 +++++++ .../tezos-protocol-genesis.opam | 21 +++++++ src/client/embedded/alpha/jbuild | 6 +- src/client/embedded/genesis/jbuild | 9 +-- src/jbuild | 6 +- src/proto/demo/jbuild | 60 ------------------ src/proto/genesis/jbuild | 63 ------------------- src/proto/jbuild | 5 -- test/proto_alpha/jbuild | 2 +- test/shell/jbuild | 6 +- 116 files changed, 384 insertions(+), 166 deletions(-) rename {src/proto/alpha => lib_embedded_protocol_alpha}/docs/language.md (100%) create mode 100644 lib_embedded_protocol_alpha/jbuild rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/TEZOS_PROTOCOL (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/amendment.ml (99%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/amendment.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/apply.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/baking.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/baking.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/block_header_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/block_header_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/bootstrap_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/bootstrap_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/constants_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/contract_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/contract_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/contract_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/contract_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/cycle_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/cycle_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/fitness_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/fitness_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/init_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/jbuild (55%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/level_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/level_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/level_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/level_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/main.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/main.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/manager_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/manager_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/michelson_v1_primitives.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/michelson_v1_primitives.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/misc.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/misc.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/nonce_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/nonce_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/operation_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/operation_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/period_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/period_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/public_key_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/public_key_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/qty_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/raw_context.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/raw_context.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/raw_level_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/raw_level_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/reward_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/reward_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/roll_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/roll_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/roll_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/roll_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_int_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_int_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_interpreter.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_interpreter.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_ir_translator.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_ir_translator.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_timestamp_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_timestamp_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/script_typed_ir.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/seed_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/seed_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/seed_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/seed_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/services.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/services_registration.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/storage_functors.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/storage_functors.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/storage_sigs.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/tez_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/tez_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/tezos_context.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/tezos_context.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/tezos_hash.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/time_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/time_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/vote_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/vote_repr.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/vote_storage.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/vote_storage.mli (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/voting_period_repr.ml (100%) rename {src/proto/alpha => lib_embedded_protocol_alpha/src}/voting_period_repr.mli (100%) create mode 100644 lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam create mode 100644 lib_embedded_protocol_alpha/tezos-protocol-alpha.opam create mode 100644 lib_embedded_protocol_demo/jbuild rename {src/proto/demo => lib_embedded_protocol_demo/src}/TEZOS_PROTOCOL (100%) rename {src/proto/demo => lib_embedded_protocol_demo/src}/error.ml (100%) create mode 100644 lib_embedded_protocol_demo/src/jbuild rename {src/proto/demo => lib_embedded_protocol_demo/src}/main.ml (100%) rename {src/proto/demo => lib_embedded_protocol_demo/src}/services.ml (100%) create mode 100644 lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam create mode 100644 lib_embedded_protocol_demo/tezos-protocol-demo.opam create mode 100644 lib_embedded_protocol_genesis/jbuild rename {src/proto/genesis => lib_embedded_protocol_genesis/src}/TEZOS_PROTOCOL (100%) rename {src/proto/genesis => lib_embedded_protocol_genesis/src}/data.ml (100%) create mode 100644 lib_embedded_protocol_genesis/src/jbuild rename {src/proto/genesis => lib_embedded_protocol_genesis/src}/main.ml (100%) rename {src/proto/genesis => lib_embedded_protocol_genesis/src}/services.ml (100%) create mode 100644 lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam create mode 100644 lib_embedded_protocol_genesis/tezos-protocol-genesis.opam delete mode 100644 src/proto/demo/jbuild delete mode 100644 src/proto/genesis/jbuild delete mode 100644 src/proto/jbuild diff --git a/jbuild b/jbuild index ebd7a0e59..0d9d0539c 100644 --- a/jbuild +++ b/jbuild @@ -3,3 +3,7 @@ (alias ((name runtest) (deps ((alias_rec runtest_indent))))) + +(alias + ((name runtest) + (deps ((alias_rec runtest_sandbox))))) diff --git a/src/proto/alpha/docs/language.md b/lib_embedded_protocol_alpha/docs/language.md similarity index 100% rename from src/proto/alpha/docs/language.md rename to lib_embedded_protocol_alpha/docs/language.md diff --git a/lib_embedded_protocol_alpha/jbuild b/lib_embedded_protocol_alpha/jbuild new file mode 100644 index 000000000..4ec6b3bde --- /dev/null +++ b/lib_embedded_protocol_alpha/jbuild @@ -0,0 +1,40 @@ +(jbuild_version 1) + +;; Build a functorized version of the protocol with the `tezos-protocol-compiler` +;; This is bit hackish... +;; +;; AFAIK the current version of jbuilder (1.0+beta16) does not allow to compile +;; with a custom `rule` the `(modules)` of a library. +;; +;; A trick is to provide the `.cmx` through the `(library_flags)` and to generate +;; a empty `.ml` to correctly handle the dependencies... + +(rule + ((targets (tezos_protocol_alpha.o + tezos_protocol_alpha.cmx + tezos_protocol_alpha.cmi + tezos_protocol_alpha_dummy.ml)) + (deps ((glob_files src/*.ml) + (glob_files src/*.mli) + src/TEZOS_PROTOCOL)) + (action (with-stdout-to ${path-no-dep:tezos_protocol_alpha_dummy.ml} + (chdir ${ROOT} + (run ${bin:tezos-protocol-compiler} -static ${path-no-dep:tezos_protocol_alpha} ${path-no-dep:src})))))) + +(library + ((name tezos_protocol_alpha) + (public_name tezos-protocol-alpha) + (library_flags (:standard -linkall + lib_embedded_protocol_alpha/tezos_protocol_alpha.cmx)) + (wrapped false) + (modes (native)) + (modules (Tezos_protocol_alpha_dummy)))) + +(alias + ((name runtest_sandbox) + (deps (tezos_protocol_alpha.cmx)))) + +(alias + ((name runtest_indent) + (deps ((glob_files src/*.ml) (glob_files src/*.mli))) + (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/alpha/TEZOS_PROTOCOL b/lib_embedded_protocol_alpha/src/TEZOS_PROTOCOL similarity index 100% rename from src/proto/alpha/TEZOS_PROTOCOL rename to lib_embedded_protocol_alpha/src/TEZOS_PROTOCOL diff --git a/src/proto/alpha/amendment.ml b/lib_embedded_protocol_alpha/src/amendment.ml similarity index 99% rename from src/proto/alpha/amendment.ml rename to lib_embedded_protocol_alpha/src/amendment.ml index 543af6e61..2e6378d93 100644 --- a/src/proto/alpha/amendment.ml +++ b/lib_embedded_protocol_alpha/src/amendment.ml @@ -9,6 +9,8 @@ open Tezos_context +let () = () + let select_winning_proposal proposals = let merge proposal vote winners = match winners with diff --git a/src/proto/alpha/amendment.mli b/lib_embedded_protocol_alpha/src/amendment.mli similarity index 100% rename from src/proto/alpha/amendment.mli rename to lib_embedded_protocol_alpha/src/amendment.mli diff --git a/src/proto/alpha/apply.ml b/lib_embedded_protocol_alpha/src/apply.ml similarity index 100% rename from src/proto/alpha/apply.ml rename to lib_embedded_protocol_alpha/src/apply.ml diff --git a/src/proto/alpha/baking.ml b/lib_embedded_protocol_alpha/src/baking.ml similarity index 100% rename from src/proto/alpha/baking.ml rename to lib_embedded_protocol_alpha/src/baking.ml diff --git a/src/proto/alpha/baking.mli b/lib_embedded_protocol_alpha/src/baking.mli similarity index 100% rename from src/proto/alpha/baking.mli rename to lib_embedded_protocol_alpha/src/baking.mli diff --git a/src/proto/alpha/block_header_repr.ml b/lib_embedded_protocol_alpha/src/block_header_repr.ml similarity index 100% rename from src/proto/alpha/block_header_repr.ml rename to lib_embedded_protocol_alpha/src/block_header_repr.ml diff --git a/src/proto/alpha/block_header_repr.mli b/lib_embedded_protocol_alpha/src/block_header_repr.mli similarity index 100% rename from src/proto/alpha/block_header_repr.mli rename to lib_embedded_protocol_alpha/src/block_header_repr.mli diff --git a/src/proto/alpha/bootstrap_storage.ml b/lib_embedded_protocol_alpha/src/bootstrap_storage.ml similarity index 100% rename from src/proto/alpha/bootstrap_storage.ml rename to lib_embedded_protocol_alpha/src/bootstrap_storage.ml diff --git a/src/proto/alpha/bootstrap_storage.mli b/lib_embedded_protocol_alpha/src/bootstrap_storage.mli similarity index 100% rename from src/proto/alpha/bootstrap_storage.mli rename to lib_embedded_protocol_alpha/src/bootstrap_storage.mli diff --git a/src/proto/alpha/constants_repr.ml b/lib_embedded_protocol_alpha/src/constants_repr.ml similarity index 100% rename from src/proto/alpha/constants_repr.ml rename to lib_embedded_protocol_alpha/src/constants_repr.ml diff --git a/src/proto/alpha/contract_repr.ml b/lib_embedded_protocol_alpha/src/contract_repr.ml similarity index 100% rename from src/proto/alpha/contract_repr.ml rename to lib_embedded_protocol_alpha/src/contract_repr.ml diff --git a/src/proto/alpha/contract_repr.mli b/lib_embedded_protocol_alpha/src/contract_repr.mli similarity index 100% rename from src/proto/alpha/contract_repr.mli rename to lib_embedded_protocol_alpha/src/contract_repr.mli diff --git a/src/proto/alpha/contract_storage.ml b/lib_embedded_protocol_alpha/src/contract_storage.ml similarity index 100% rename from src/proto/alpha/contract_storage.ml rename to lib_embedded_protocol_alpha/src/contract_storage.ml diff --git a/src/proto/alpha/contract_storage.mli b/lib_embedded_protocol_alpha/src/contract_storage.mli similarity index 100% rename from src/proto/alpha/contract_storage.mli rename to lib_embedded_protocol_alpha/src/contract_storage.mli diff --git a/src/proto/alpha/cycle_repr.ml b/lib_embedded_protocol_alpha/src/cycle_repr.ml similarity index 100% rename from src/proto/alpha/cycle_repr.ml rename to lib_embedded_protocol_alpha/src/cycle_repr.ml diff --git a/src/proto/alpha/cycle_repr.mli b/lib_embedded_protocol_alpha/src/cycle_repr.mli similarity index 100% rename from src/proto/alpha/cycle_repr.mli rename to lib_embedded_protocol_alpha/src/cycle_repr.mli diff --git a/src/proto/alpha/fitness_repr.ml b/lib_embedded_protocol_alpha/src/fitness_repr.ml similarity index 100% rename from src/proto/alpha/fitness_repr.ml rename to lib_embedded_protocol_alpha/src/fitness_repr.ml diff --git a/src/proto/alpha/fitness_storage.ml b/lib_embedded_protocol_alpha/src/fitness_storage.ml similarity index 100% rename from src/proto/alpha/fitness_storage.ml rename to lib_embedded_protocol_alpha/src/fitness_storage.ml diff --git a/src/proto/alpha/init_storage.ml b/lib_embedded_protocol_alpha/src/init_storage.ml similarity index 100% rename from src/proto/alpha/init_storage.ml rename to lib_embedded_protocol_alpha/src/init_storage.ml diff --git a/src/proto/alpha/jbuild b/lib_embedded_protocol_alpha/src/jbuild similarity index 55% rename from src/proto/alpha/jbuild rename to lib_embedded_protocol_alpha/src/jbuild index f9c020208..f9536a31d 100644 --- a/src/proto/alpha/jbuild +++ b/lib_embedded_protocol_alpha/src/jbuild @@ -13,7 +13,7 @@ " let () = let module Ignored = State.Register_embedded_protocol - (Tezos_protocol_environment_alpha.Environment) + (Tezos_embedded_protocol_environment_alpha.Environment) (Tezos_embedded_raw_protocol_alpha.Main) (struct let hash = @@ -25,21 +25,21 @@ let () = } end) in ()")))) (library - ((name tezos_protocol_environment_alpha) - (public_name tezos.protocol_environment.alpha) - (library_flags (:standard -linkall -w -9 -safe-string)) - (libraries (node_updater)) + ((name tezos_embedded_protocol_environment_alpha) + (public_name tezos-embedded-protocol-alpha.environment) + (library_flags (:standard -linkall)) + (libraries (tezos.node.updater)) (modules (Environment)))) (library ((name tezos_embedded_raw_protocol_alpha) - (public_name tezos.embedded_raw_protocol.alpha) - (libraries (tezos_protocol_environment_alpha)) + (public_name tezos-embedded-protocol-alpha.raw) + (libraries (tezos_embedded_protocol_environment_alpha)) (library_flags (:standard -linkall)) (flags (:standard -nopervasives -nostdlib -safe-string -w +a-4-6-7-9-29-32-40..42-44-45-48 -warn-error -a+8 - -open Tezos_protocol_environment_alpha__Environment + -open Tezos_embedded_protocol_environment_alpha__Environment -open Error_monad -open Hash -open Tezos_data)) @@ -47,20 +47,7 @@ let () = (library ((name tezos_embedded_protocol_alpha) - (public_name tezos.embedded_protocol.alpha) - (library_flags (:standard -linkall -w -9-32 -safe-string)) - (libraries (tezos_embedded_raw_protocol_alpha node_shell)) + (public_name tezos-embedded-protocol-alpha) + (library_flags (:standard -linkall)) + (libraries (tezos_embedded_raw_protocol_alpha tezos.node.shell)) (modules (Registerer)))) - -(alias - ((name runtest_sandboxing) - (deps ((glob_files *.ml) - (glob_files *.mli) - TEZOS_PROTOCOL)) - (action (chdir ${ROOT} - (run ${exe:../../compiler_main.exe} dummy_alpha ${path-no-dep:.}))))) - -(alias - ((name runtest_indent) - (deps ((glob_files *.ml) (glob_files *.mli))) - (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/alpha/level_repr.ml b/lib_embedded_protocol_alpha/src/level_repr.ml similarity index 100% rename from src/proto/alpha/level_repr.ml rename to lib_embedded_protocol_alpha/src/level_repr.ml diff --git a/src/proto/alpha/level_repr.mli b/lib_embedded_protocol_alpha/src/level_repr.mli similarity index 100% rename from src/proto/alpha/level_repr.mli rename to lib_embedded_protocol_alpha/src/level_repr.mli diff --git a/src/proto/alpha/level_storage.ml b/lib_embedded_protocol_alpha/src/level_storage.ml similarity index 100% rename from src/proto/alpha/level_storage.ml rename to lib_embedded_protocol_alpha/src/level_storage.ml diff --git a/src/proto/alpha/level_storage.mli b/lib_embedded_protocol_alpha/src/level_storage.mli similarity index 100% rename from src/proto/alpha/level_storage.mli rename to lib_embedded_protocol_alpha/src/level_storage.mli diff --git a/src/proto/alpha/main.ml b/lib_embedded_protocol_alpha/src/main.ml similarity index 100% rename from src/proto/alpha/main.ml rename to lib_embedded_protocol_alpha/src/main.ml diff --git a/src/proto/alpha/main.mli b/lib_embedded_protocol_alpha/src/main.mli similarity index 100% rename from src/proto/alpha/main.mli rename to lib_embedded_protocol_alpha/src/main.mli diff --git a/src/proto/alpha/manager_repr.ml b/lib_embedded_protocol_alpha/src/manager_repr.ml similarity index 100% rename from src/proto/alpha/manager_repr.ml rename to lib_embedded_protocol_alpha/src/manager_repr.ml diff --git a/src/proto/alpha/manager_repr.mli b/lib_embedded_protocol_alpha/src/manager_repr.mli similarity index 100% rename from src/proto/alpha/manager_repr.mli rename to lib_embedded_protocol_alpha/src/manager_repr.mli diff --git a/src/proto/alpha/michelson_v1_primitives.ml b/lib_embedded_protocol_alpha/src/michelson_v1_primitives.ml similarity index 100% rename from src/proto/alpha/michelson_v1_primitives.ml rename to lib_embedded_protocol_alpha/src/michelson_v1_primitives.ml diff --git a/src/proto/alpha/michelson_v1_primitives.mli b/lib_embedded_protocol_alpha/src/michelson_v1_primitives.mli similarity index 100% rename from src/proto/alpha/michelson_v1_primitives.mli rename to lib_embedded_protocol_alpha/src/michelson_v1_primitives.mli diff --git a/src/proto/alpha/misc.ml b/lib_embedded_protocol_alpha/src/misc.ml similarity index 100% rename from src/proto/alpha/misc.ml rename to lib_embedded_protocol_alpha/src/misc.ml diff --git a/src/proto/alpha/misc.mli b/lib_embedded_protocol_alpha/src/misc.mli similarity index 100% rename from src/proto/alpha/misc.mli rename to lib_embedded_protocol_alpha/src/misc.mli diff --git a/src/proto/alpha/nonce_storage.ml b/lib_embedded_protocol_alpha/src/nonce_storage.ml similarity index 100% rename from src/proto/alpha/nonce_storage.ml rename to lib_embedded_protocol_alpha/src/nonce_storage.ml diff --git a/src/proto/alpha/nonce_storage.mli b/lib_embedded_protocol_alpha/src/nonce_storage.mli similarity index 100% rename from src/proto/alpha/nonce_storage.mli rename to lib_embedded_protocol_alpha/src/nonce_storage.mli diff --git a/src/proto/alpha/operation_repr.ml b/lib_embedded_protocol_alpha/src/operation_repr.ml similarity index 100% rename from src/proto/alpha/operation_repr.ml rename to lib_embedded_protocol_alpha/src/operation_repr.ml diff --git a/src/proto/alpha/operation_repr.mli b/lib_embedded_protocol_alpha/src/operation_repr.mli similarity index 100% rename from src/proto/alpha/operation_repr.mli rename to lib_embedded_protocol_alpha/src/operation_repr.mli diff --git a/src/proto/alpha/period_repr.ml b/lib_embedded_protocol_alpha/src/period_repr.ml similarity index 100% rename from src/proto/alpha/period_repr.ml rename to lib_embedded_protocol_alpha/src/period_repr.ml diff --git a/src/proto/alpha/period_repr.mli b/lib_embedded_protocol_alpha/src/period_repr.mli similarity index 100% rename from src/proto/alpha/period_repr.mli rename to lib_embedded_protocol_alpha/src/period_repr.mli diff --git a/src/proto/alpha/public_key_storage.ml b/lib_embedded_protocol_alpha/src/public_key_storage.ml similarity index 100% rename from src/proto/alpha/public_key_storage.ml rename to lib_embedded_protocol_alpha/src/public_key_storage.ml diff --git a/src/proto/alpha/public_key_storage.mli b/lib_embedded_protocol_alpha/src/public_key_storage.mli similarity index 100% rename from src/proto/alpha/public_key_storage.mli rename to lib_embedded_protocol_alpha/src/public_key_storage.mli diff --git a/src/proto/alpha/qty_repr.ml b/lib_embedded_protocol_alpha/src/qty_repr.ml similarity index 100% rename from src/proto/alpha/qty_repr.ml rename to lib_embedded_protocol_alpha/src/qty_repr.ml diff --git a/src/proto/alpha/raw_context.ml b/lib_embedded_protocol_alpha/src/raw_context.ml similarity index 100% rename from src/proto/alpha/raw_context.ml rename to lib_embedded_protocol_alpha/src/raw_context.ml diff --git a/src/proto/alpha/raw_context.mli b/lib_embedded_protocol_alpha/src/raw_context.mli similarity index 100% rename from src/proto/alpha/raw_context.mli rename to lib_embedded_protocol_alpha/src/raw_context.mli diff --git a/src/proto/alpha/raw_level_repr.ml b/lib_embedded_protocol_alpha/src/raw_level_repr.ml similarity index 100% rename from src/proto/alpha/raw_level_repr.ml rename to lib_embedded_protocol_alpha/src/raw_level_repr.ml diff --git a/src/proto/alpha/raw_level_repr.mli b/lib_embedded_protocol_alpha/src/raw_level_repr.mli similarity index 100% rename from src/proto/alpha/raw_level_repr.mli rename to lib_embedded_protocol_alpha/src/raw_level_repr.mli diff --git a/src/proto/alpha/reward_storage.ml b/lib_embedded_protocol_alpha/src/reward_storage.ml similarity index 100% rename from src/proto/alpha/reward_storage.ml rename to lib_embedded_protocol_alpha/src/reward_storage.ml diff --git a/src/proto/alpha/reward_storage.mli b/lib_embedded_protocol_alpha/src/reward_storage.mli similarity index 100% rename from src/proto/alpha/reward_storage.mli rename to lib_embedded_protocol_alpha/src/reward_storage.mli diff --git a/src/proto/alpha/roll_repr.ml b/lib_embedded_protocol_alpha/src/roll_repr.ml similarity index 100% rename from src/proto/alpha/roll_repr.ml rename to lib_embedded_protocol_alpha/src/roll_repr.ml diff --git a/src/proto/alpha/roll_repr.mli b/lib_embedded_protocol_alpha/src/roll_repr.mli similarity index 100% rename from src/proto/alpha/roll_repr.mli rename to lib_embedded_protocol_alpha/src/roll_repr.mli diff --git a/src/proto/alpha/roll_storage.ml b/lib_embedded_protocol_alpha/src/roll_storage.ml similarity index 100% rename from src/proto/alpha/roll_storage.ml rename to lib_embedded_protocol_alpha/src/roll_storage.ml diff --git a/src/proto/alpha/roll_storage.mli b/lib_embedded_protocol_alpha/src/roll_storage.mli similarity index 100% rename from src/proto/alpha/roll_storage.mli rename to lib_embedded_protocol_alpha/src/roll_storage.mli diff --git a/src/proto/alpha/script_int_repr.ml b/lib_embedded_protocol_alpha/src/script_int_repr.ml similarity index 100% rename from src/proto/alpha/script_int_repr.ml rename to lib_embedded_protocol_alpha/src/script_int_repr.ml diff --git a/src/proto/alpha/script_int_repr.mli b/lib_embedded_protocol_alpha/src/script_int_repr.mli similarity index 100% rename from src/proto/alpha/script_int_repr.mli rename to lib_embedded_protocol_alpha/src/script_int_repr.mli diff --git a/src/proto/alpha/script_interpreter.ml b/lib_embedded_protocol_alpha/src/script_interpreter.ml similarity index 100% rename from src/proto/alpha/script_interpreter.ml rename to lib_embedded_protocol_alpha/src/script_interpreter.ml diff --git a/src/proto/alpha/script_interpreter.mli b/lib_embedded_protocol_alpha/src/script_interpreter.mli similarity index 100% rename from src/proto/alpha/script_interpreter.mli rename to lib_embedded_protocol_alpha/src/script_interpreter.mli diff --git a/src/proto/alpha/script_ir_translator.ml b/lib_embedded_protocol_alpha/src/script_ir_translator.ml similarity index 100% rename from src/proto/alpha/script_ir_translator.ml rename to lib_embedded_protocol_alpha/src/script_ir_translator.ml diff --git a/src/proto/alpha/script_ir_translator.mli b/lib_embedded_protocol_alpha/src/script_ir_translator.mli similarity index 100% rename from src/proto/alpha/script_ir_translator.mli rename to lib_embedded_protocol_alpha/src/script_ir_translator.mli diff --git a/src/proto/alpha/script_repr.ml b/lib_embedded_protocol_alpha/src/script_repr.ml similarity index 100% rename from src/proto/alpha/script_repr.ml rename to lib_embedded_protocol_alpha/src/script_repr.ml diff --git a/src/proto/alpha/script_repr.mli b/lib_embedded_protocol_alpha/src/script_repr.mli similarity index 100% rename from src/proto/alpha/script_repr.mli rename to lib_embedded_protocol_alpha/src/script_repr.mli diff --git a/src/proto/alpha/script_timestamp_repr.ml b/lib_embedded_protocol_alpha/src/script_timestamp_repr.ml similarity index 100% rename from src/proto/alpha/script_timestamp_repr.ml rename to lib_embedded_protocol_alpha/src/script_timestamp_repr.ml diff --git a/src/proto/alpha/script_timestamp_repr.mli b/lib_embedded_protocol_alpha/src/script_timestamp_repr.mli similarity index 100% rename from src/proto/alpha/script_timestamp_repr.mli rename to lib_embedded_protocol_alpha/src/script_timestamp_repr.mli diff --git a/src/proto/alpha/script_typed_ir.ml b/lib_embedded_protocol_alpha/src/script_typed_ir.ml similarity index 100% rename from src/proto/alpha/script_typed_ir.ml rename to lib_embedded_protocol_alpha/src/script_typed_ir.ml diff --git a/src/proto/alpha/seed_repr.ml b/lib_embedded_protocol_alpha/src/seed_repr.ml similarity index 100% rename from src/proto/alpha/seed_repr.ml rename to lib_embedded_protocol_alpha/src/seed_repr.ml diff --git a/src/proto/alpha/seed_repr.mli b/lib_embedded_protocol_alpha/src/seed_repr.mli similarity index 100% rename from src/proto/alpha/seed_repr.mli rename to lib_embedded_protocol_alpha/src/seed_repr.mli diff --git a/src/proto/alpha/seed_storage.ml b/lib_embedded_protocol_alpha/src/seed_storage.ml similarity index 100% rename from src/proto/alpha/seed_storage.ml rename to lib_embedded_protocol_alpha/src/seed_storage.ml diff --git a/src/proto/alpha/seed_storage.mli b/lib_embedded_protocol_alpha/src/seed_storage.mli similarity index 100% rename from src/proto/alpha/seed_storage.mli rename to lib_embedded_protocol_alpha/src/seed_storage.mli diff --git a/src/proto/alpha/services.ml b/lib_embedded_protocol_alpha/src/services.ml similarity index 100% rename from src/proto/alpha/services.ml rename to lib_embedded_protocol_alpha/src/services.ml diff --git a/src/proto/alpha/services_registration.ml b/lib_embedded_protocol_alpha/src/services_registration.ml similarity index 100% rename from src/proto/alpha/services_registration.ml rename to lib_embedded_protocol_alpha/src/services_registration.ml diff --git a/src/proto/alpha/storage.ml b/lib_embedded_protocol_alpha/src/storage.ml similarity index 100% rename from src/proto/alpha/storage.ml rename to lib_embedded_protocol_alpha/src/storage.ml diff --git a/src/proto/alpha/storage.mli b/lib_embedded_protocol_alpha/src/storage.mli similarity index 100% rename from src/proto/alpha/storage.mli rename to lib_embedded_protocol_alpha/src/storage.mli diff --git a/src/proto/alpha/storage_functors.ml b/lib_embedded_protocol_alpha/src/storage_functors.ml similarity index 100% rename from src/proto/alpha/storage_functors.ml rename to lib_embedded_protocol_alpha/src/storage_functors.ml diff --git a/src/proto/alpha/storage_functors.mli b/lib_embedded_protocol_alpha/src/storage_functors.mli similarity index 100% rename from src/proto/alpha/storage_functors.mli rename to lib_embedded_protocol_alpha/src/storage_functors.mli diff --git a/src/proto/alpha/storage_sigs.ml b/lib_embedded_protocol_alpha/src/storage_sigs.ml similarity index 100% rename from src/proto/alpha/storage_sigs.ml rename to lib_embedded_protocol_alpha/src/storage_sigs.ml diff --git a/src/proto/alpha/tez_repr.ml b/lib_embedded_protocol_alpha/src/tez_repr.ml similarity index 100% rename from src/proto/alpha/tez_repr.ml rename to lib_embedded_protocol_alpha/src/tez_repr.ml diff --git a/src/proto/alpha/tez_repr.mli b/lib_embedded_protocol_alpha/src/tez_repr.mli similarity index 100% rename from src/proto/alpha/tez_repr.mli rename to lib_embedded_protocol_alpha/src/tez_repr.mli diff --git a/src/proto/alpha/tezos_context.ml b/lib_embedded_protocol_alpha/src/tezos_context.ml similarity index 100% rename from src/proto/alpha/tezos_context.ml rename to lib_embedded_protocol_alpha/src/tezos_context.ml diff --git a/src/proto/alpha/tezos_context.mli b/lib_embedded_protocol_alpha/src/tezos_context.mli similarity index 100% rename from src/proto/alpha/tezos_context.mli rename to lib_embedded_protocol_alpha/src/tezos_context.mli diff --git a/src/proto/alpha/tezos_hash.ml b/lib_embedded_protocol_alpha/src/tezos_hash.ml similarity index 100% rename from src/proto/alpha/tezos_hash.ml rename to lib_embedded_protocol_alpha/src/tezos_hash.ml diff --git a/src/proto/alpha/time_repr.ml b/lib_embedded_protocol_alpha/src/time_repr.ml similarity index 100% rename from src/proto/alpha/time_repr.ml rename to lib_embedded_protocol_alpha/src/time_repr.ml diff --git a/src/proto/alpha/time_repr.mli b/lib_embedded_protocol_alpha/src/time_repr.mli similarity index 100% rename from src/proto/alpha/time_repr.mli rename to lib_embedded_protocol_alpha/src/time_repr.mli diff --git a/src/proto/alpha/vote_repr.ml b/lib_embedded_protocol_alpha/src/vote_repr.ml similarity index 100% rename from src/proto/alpha/vote_repr.ml rename to lib_embedded_protocol_alpha/src/vote_repr.ml diff --git a/src/proto/alpha/vote_repr.mli b/lib_embedded_protocol_alpha/src/vote_repr.mli similarity index 100% rename from src/proto/alpha/vote_repr.mli rename to lib_embedded_protocol_alpha/src/vote_repr.mli diff --git a/src/proto/alpha/vote_storage.ml b/lib_embedded_protocol_alpha/src/vote_storage.ml similarity index 100% rename from src/proto/alpha/vote_storage.ml rename to lib_embedded_protocol_alpha/src/vote_storage.ml diff --git a/src/proto/alpha/vote_storage.mli b/lib_embedded_protocol_alpha/src/vote_storage.mli similarity index 100% rename from src/proto/alpha/vote_storage.mli rename to lib_embedded_protocol_alpha/src/vote_storage.mli diff --git a/src/proto/alpha/voting_period_repr.ml b/lib_embedded_protocol_alpha/src/voting_period_repr.ml similarity index 100% rename from src/proto/alpha/voting_period_repr.ml rename to lib_embedded_protocol_alpha/src/voting_period_repr.ml diff --git a/src/proto/alpha/voting_period_repr.mli b/lib_embedded_protocol_alpha/src/voting_period_repr.mli similarity index 100% rename from src/proto/alpha/voting_period_repr.mli rename to lib_embedded_protocol_alpha/src/voting_period_repr.mli diff --git a/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam b/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_alpha/tezos-embedded-protocol-alpha.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam b/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_alpha/tezos-protocol-alpha.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/lib_embedded_protocol_demo/jbuild b/lib_embedded_protocol_demo/jbuild new file mode 100644 index 000000000..11c514931 --- /dev/null +++ b/lib_embedded_protocol_demo/jbuild @@ -0,0 +1,40 @@ +(jbuild_version 1) + +;; Build a functorized version of the protocol with the `tezos-protocol-compiler` +;; This is bit hackish... +;; +;; AFAIK the current version of jbuilder (1.0+beta16) does not allow to compile +;; with a custom `rule` the `(modules)` of a library. +;; +;; A trick is to provide the `.cmx` through the `(library_flags)` and to generate +;; a empty `.ml` to correctly handle the dependencies... + +(rule + ((targets (tezos_protocol_demo.o + tezos_protocol_demo.cmx + tezos_protocol_demo.cmi + tezos_protocol_demo_dummy.ml)) + (deps ((glob_files src/*.ml) + (glob_files src/*.mli) + src/TEZOS_PROTOCOL)) + (action (with-stdout-to ${path-no-dep:tezos_protocol_demo_dummy.ml} + (chdir ${ROOT} + (run ${bin:tezos-protocol-compiler} -static ${path-no-dep:tezos_protocol_demo} ${path-no-dep:src})))))) + +(library + ((name tezos_protocol_demo) + (public_name tezos-protocol-demo) + (library_flags (:standard -linkall + lib_embedded_protocol_demo/tezos_protocol_demo.cmx)) + (wrapped false) + (modes (native)) + (modules (Tezos_protocol_demo_dummy)))) + +(alias + ((name runtest_sandbox) + (deps (tezos_protocol_demo.cmx)))) + +(alias + ((name runtest_indent) + (deps ((glob_files src/*.ml) (glob_files src/*.mli))) + (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/demo/TEZOS_PROTOCOL b/lib_embedded_protocol_demo/src/TEZOS_PROTOCOL similarity index 100% rename from src/proto/demo/TEZOS_PROTOCOL rename to lib_embedded_protocol_demo/src/TEZOS_PROTOCOL diff --git a/src/proto/demo/error.ml b/lib_embedded_protocol_demo/src/error.ml similarity index 100% rename from src/proto/demo/error.ml rename to lib_embedded_protocol_demo/src/error.ml diff --git a/lib_embedded_protocol_demo/src/jbuild b/lib_embedded_protocol_demo/src/jbuild new file mode 100644 index 000000000..91b7df82e --- /dev/null +++ b/lib_embedded_protocol_demo/src/jbuild @@ -0,0 +1,53 @@ +(jbuild_version 1) + +(rule + ((targets (environment.ml)) + (action + (write-file ${@} + "include Tezos_protocol_environment.Make(struct let name = \"demo\" end)()")))) + +(rule + ((targets (registerer.ml)) + (action + (write-file ${@} + " +let () = + let module Ignored = State.Register_embedded_protocol + (Tezos_embedded_protocol_environment_demo.Environment) + (Tezos_embedded_raw_protocol_demo.Main) + (struct + let hash = + Some (Tezos_crypto.Protocol_hash.of_b58check_exn + \"ProtoDemoDemoDemoDemoDemoDemoDemoDemoDemoDemoD3c8k9\") + let sources = Tezos_base.Protocol.{ + expected_env = V1 ; + components = [(* FIXME ?? *)] ; + } end) in ()")))) + +(library + ((name tezos_embedded_protocol_environment_demo) + (public_name tezos-embedded-protocol-demo.environment) + (library_flags (:standard -linkall)) + (libraries (tezos.node.updater)) + (modules (Environment)))) + +(library + ((name tezos_embedded_raw_protocol_demo) + (public_name tezos-embedded-protocol-demo.raw) + (libraries (tezos_embedded_protocol_environment_demo)) + (library_flags (:standard -linkall)) + (flags (:standard -nopervasives -nostdlib -safe-string + -w +a-4-6-7-9-29-32-40..42-44-45-48 + -warn-error -a+8 + -open Tezos_embedded_protocol_environment_demo__Environment + -open Error_monad + -open Hash + -open Tezos_data)) + (modules (:standard \ Environment Registerer)))) + +(library + ((name tezos_embedded_protocol_demo) + (public_name tezos-embedded-protocol-demo) + (library_flags (:standard -linkall)) + (libraries (tezos_embedded_raw_protocol_demo tezos.node.shell)) + (modules (Registerer)))) diff --git a/src/proto/demo/main.ml b/lib_embedded_protocol_demo/src/main.ml similarity index 100% rename from src/proto/demo/main.ml rename to lib_embedded_protocol_demo/src/main.ml diff --git a/src/proto/demo/services.ml b/lib_embedded_protocol_demo/src/services.ml similarity index 100% rename from src/proto/demo/services.ml rename to lib_embedded_protocol_demo/src/services.ml diff --git a/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam b/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_demo/tezos-embedded-protocol-demo.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/lib_embedded_protocol_demo/tezos-protocol-demo.opam b/lib_embedded_protocol_demo/tezos-protocol-demo.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_demo/tezos-protocol-demo.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/lib_embedded_protocol_genesis/jbuild b/lib_embedded_protocol_genesis/jbuild new file mode 100644 index 000000000..83de72399 --- /dev/null +++ b/lib_embedded_protocol_genesis/jbuild @@ -0,0 +1,40 @@ +(jbuild_version 1) + +;; Build a functorized version of the protocol with the `tezos-protocol-compiler` +;; This is bit hackish... +;; +;; AFAIK the current version of jbuilder (1.0+beta16) does not allow to compile +;; with a custom `rule` the `(modules)` of a library. +;; +;; A trick is to provide the `.cmx` through the `(library_flags)` and to generate +;; a empty `.ml` to correctly handle the dependencies... + +(rule + ((targets (tezos_protocol_genesis.o + tezos_protocol_genesis.cmx + tezos_protocol_genesis.cmi + tezos_protocol_genesis_dummy.ml)) + (deps ((glob_files src/*.ml) + (glob_files src/*.mli) + src/TEZOS_PROTOCOL)) + (action (with-stdout-to ${path-no-dep:tezos_protocol_genesis_dummy.ml} + (chdir ${ROOT} + (run ${bin:tezos-protocol-compiler} -static ${path-no-dep:tezos_protocol_genesis} ${path-no-dep:src})))))) + +(library + ((name tezos_protocol_genesis) + (public_name tezos-protocol-genesis) + (library_flags (:standard -linkall + lib_embedded_protocol_genesis/tezos_protocol_genesis.cmx)) + (wrapped false) + (modes (native)) + (modules (Tezos_protocol_genesis_dummy)))) + +(alias + ((name runtest_sandbox) + (deps (tezos_protocol_genesis.cmx)))) + +(alias + ((name runtest_indent) + (deps ((glob_files src/*.ml) (glob_files src/*.mli))) + (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/genesis/TEZOS_PROTOCOL b/lib_embedded_protocol_genesis/src/TEZOS_PROTOCOL similarity index 100% rename from src/proto/genesis/TEZOS_PROTOCOL rename to lib_embedded_protocol_genesis/src/TEZOS_PROTOCOL diff --git a/src/proto/genesis/data.ml b/lib_embedded_protocol_genesis/src/data.ml similarity index 100% rename from src/proto/genesis/data.ml rename to lib_embedded_protocol_genesis/src/data.ml diff --git a/lib_embedded_protocol_genesis/src/jbuild b/lib_embedded_protocol_genesis/src/jbuild new file mode 100644 index 000000000..6f35b90ed --- /dev/null +++ b/lib_embedded_protocol_genesis/src/jbuild @@ -0,0 +1,53 @@ +(jbuild_version 1) + +(rule + ((targets (environment.ml)) + (action + (write-file ${@} + "include Tezos_protocol_environment.Make(struct let name = \"genesis\" end)()")))) + +(rule + ((targets (registerer.ml)) + (action + (write-file ${@} + " +let () = + let module Ignored = State.Register_embedded_protocol + (Tezos_embedded_protocol_environment_genesis.Environment) + (Tezos_embedded_raw_protocol_genesis.Main) + (struct + let hash = + Some (Tezos_crypto.Protocol_hash.of_b58check_exn + \"ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im\") + let sources = Tezos_base.Protocol.{ + expected_env = V1 ; + components = [(* FIXME ?? *)] ; + } end) in ()")))) + +(library + ((name tezos_embedded_protocol_environment_genesis) + (public_name tezos-embedded-protocol-genesis.environment) + (library_flags (:standard -linkall)) + (libraries (tezos.node.updater)) + (modules (Environment)))) + +(library + ((name tezos_embedded_raw_protocol_genesis) + (public_name tezos-embedded-protocol-genesis.raw) + (libraries (tezos_embedded_protocol_environment_genesis)) + (library_flags (:standard -linkall)) + (flags (:standard -nopervasives -nostdlib -safe-string + -w +a-4-6-7-9-29-32-40..42-44-45-48 + -warn-error -a+8 + -open Tezos_embedded_protocol_environment_genesis__Environment + -open Error_monad + -open Hash + -open Tezos_data)) + (modules (:standard \ Environment Registerer)))) + +(library + ((name tezos_embedded_protocol_genesis) + (public_name tezos-embedded-protocol-genesis) + (library_flags (:standard -linkall)) + (libraries (tezos_embedded_raw_protocol_genesis tezos.node.shell)) + (modules (Registerer)))) diff --git a/src/proto/genesis/main.ml b/lib_embedded_protocol_genesis/src/main.ml similarity index 100% rename from src/proto/genesis/main.ml rename to lib_embedded_protocol_genesis/src/main.ml diff --git a/src/proto/genesis/services.ml b/lib_embedded_protocol_genesis/src/services.ml similarity index 100% rename from src/proto/genesis/services.ml rename to lib_embedded_protocol_genesis/src/services.ml diff --git a/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam b/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_genesis/tezos-embedded-protocol-genesis.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam b/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam new file mode 100644 index 000000000..b844cddf0 --- /dev/null +++ b/lib_embedded_protocol_genesis/tezos-protocol-genesis.opam @@ -0,0 +1,21 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "unreleased" +depends: [ + "ocamlfind" { build } + "jbuilder" { build & >= "1.0+beta15" } + "base-bigarray" + "tezos-base" + "uutf" +] +build: [ + [ "jbuilder" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "jbuilder" "runtest" "-p" name "-j" jobs ] +] diff --git a/src/client/embedded/alpha/jbuild b/src/client/embedded/alpha/jbuild index a605b63f6..2cdb28d9e 100644 --- a/src/client/embedded/alpha/jbuild +++ b/src/client/embedded/alpha/jbuild @@ -4,14 +4,14 @@ ((name client_embedded_alpha) (public_name tezos.client.embedded.alpha) (libraries (tezos-base - tezos_embedded_protocol_alpha - tezos_embedded_raw_protocol_alpha + tezos-embedded-protocol-alpha + tezos-embedded-protocol-alpha.raw client_lib)) (library_flags (:standard -linkall)) (flags (:standard -w -9+27-30-32-40@8 -safe-string -open Tezos_base__TzPervasives - -open Tezos_protocol_environment_alpha + -open Tezos_embedded_protocol_environment_alpha -open Tezos_embedded_raw_protocol_alpha -open Tezos_context)))) diff --git a/src/client/embedded/genesis/jbuild b/src/client/embedded/genesis/jbuild index 0905d63ea..44638501d 100644 --- a/src/client/embedded/genesis/jbuild +++ b/src/client/embedded/genesis/jbuild @@ -4,15 +4,16 @@ ((name client_embedded_genesis) (public_name tezos.client.embedded.genesis) (libraries (tezos-base - tezos_embedded_raw_protocol_genesis - tezos_embedded_protocol_genesis - tezos_protocol_environment_alpha + tezos-embedded-protocol-genesis + tezos-embedded-protocol-genesis.raw + tezos-embedded-protocol-alpha.environment + tezos-embedded-protocol-alpha.raw client_lib)) (library_flags (:standard -linkall)) (flags (:standard -w -9+27-30-32-40@8 -safe-string -open Tezos_base__TzPervasives - -open Tezos_protocol_environment_genesis + -open Tezos_embedded_protocol_environment_genesis -open Tezos_embedded_raw_protocol_genesis)))) (alias diff --git a/src/jbuild b/src/jbuild index 9612824c5..4162a96e3 100644 --- a/src/jbuild +++ b/src/jbuild @@ -6,9 +6,9 @@ (package tezos) (libraries (tezos-base node_db node_main_lib node_net cmdliner - tezos_embedded_protocol_genesis - tezos_embedded_protocol_demo - tezos_embedded_protocol_alpha)) + tezos-embedded-protocol-genesis + tezos-embedded-protocol-demo + tezos-embedded-protocol-alpha)) (flags (:standard -w -9+27-30-32-40@8 -safe-string -open Tezos_base__TzPervasives diff --git a/src/proto/demo/jbuild b/src/proto/demo/jbuild deleted file mode 100644 index 362efc343..000000000 --- a/src/proto/demo/jbuild +++ /dev/null @@ -1,60 +0,0 @@ -(jbuild_version 1) - -(rule - ((targets (environment.ml)) - (action - (write-file ${@} - "include Tezos_protocol_environment.Make(struct let name = \"demo\" end)()")))) - -(rule - ((targets (registerer.ml)) - (action - (write-file ${@} - "module Ignored = - State.Register_embedded_protocol - (Tezos_protocol_environment_demo.Environment) - (Tezos_embedded_raw_protocol_demo.Main) - (struct - let hash = - Some (Tezos_crypto.Protocol_hash.of_b58check_exn - \"ProtoDemoDemoDemoDemoDemoDemoDemoDemoDemoDemoD3c8k9\") - let sources = Tezos_base.Protocol.{ - expected_env = V1 ; - components = [(* FIXME ?? *)] ; - } end)")))) - -(library - ((name tezos_protocol_environment_demo) - (libraries (node_updater)) - (modules (Environment)))) - -(library - ((name tezos_embedded_raw_protocol_demo) - (libraries (tezos_protocol_environment_demo)) - (library_flags (:standard -linkall)) - (flags (:standard -nopervasives -nostdlib -safe-string - -w +a-4-6-7-9-29-32-40..42-44-45-48 - -warn-error -a+8 - -open Tezos_protocol_environment_demo__Environment - -open Error_monad - -open Hash - -open Tezos_data)) - (modules (:standard \ Environment Registerer)))) - -(library - ((name tezos_embedded_protocol_demo) - (library_flags (:standard -linkall -w -9-32 -safe-string)) - (libraries (tezos_embedded_raw_protocol_demo node_shell)) - (modules (Registerer)))) - -(alias - ((name runtest_sandboxing) - (deps ((glob_files *.ml) - (glob_files *.mli) - TEZOS_PROTOCOL)) - (action (chdir ${ROOT} (run ${exe:../../compiler_main.exe} dummy_genesis ${path-no-dep:.}))))) - -(alias - ((name runtest_indent) - (deps ((glob_files *.ml) (glob_files *.mli))) - (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/genesis/jbuild b/src/proto/genesis/jbuild deleted file mode 100644 index 52d7577ce..000000000 --- a/src/proto/genesis/jbuild +++ /dev/null @@ -1,63 +0,0 @@ -(jbuild_version 1) - -(rule - ((targets (environment.ml)) - (action - (write-file ${@} - "include Tezos_protocol_environment.Make(struct let name = \"genesis\" end)()")))) - -(rule - ((targets (registerer.ml)) - (action - (write-file ${@} - "module Ignored = - State.Register_embedded_protocol - (Tezos_protocol_environment_genesis.Environment) - (Tezos_embedded_raw_protocol_genesis.Main) - (struct - let hash = - Some (Tezos_crypto.Protocol_hash.of_b58check_exn - \"ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im\") - let sources = Tezos_base.Protocol.{ - expected_env = V1 ; - components = [(* FIXME ?? *)] ; - } end)")))) - -(library - ((name tezos_protocol_environment_genesis) - (public_name tezos.protocol_environment.genesis) - (libraries (node_updater)) - (modules (Environment)))) - -(library - ((name tezos_embedded_raw_protocol_genesis) - (public_name tezos.embedded_raw_protocol.genesis) - (libraries (tezos_protocol_environment_genesis)) - (library_flags (:standard -linkall)) - (flags (:standard -nopervasives -nostdlib -safe-string - -w +a-4-6-7-9-29-32-40..42-44-45-48 - -warn-error -a+8 - -open Tezos_protocol_environment_genesis__Environment - -open Error_monad - -open Hash - -open Tezos_data)) - (modules (:standard \ Environment Registerer)))) - -(library - ((name tezos_embedded_protocol_genesis) - (public_name tezos.embedded_protocol.genesis) - (library_flags (:standard -linkall -w -9-32 -safe-string)) - (libraries (tezos_embedded_raw_protocol_genesis node_shell)) - (modules (Registerer)))) - -(alias - ((name runtest_sandboxing) - (deps ((glob_files *.ml) - (glob_files *.mli) - TEZOS_PROTOCOL)) - (action (chdir ${ROOT} (run ${exe:../../compiler_main.exe} dummy_genesis ${path-no-dep:.}))))) - -(alias - ((name runtest_indent) - (deps ((glob_files *.ml) (glob_files *.mli))) - (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${<})))) diff --git a/src/proto/jbuild b/src/proto/jbuild deleted file mode 100644 index fb25793f8..000000000 --- a/src/proto/jbuild +++ /dev/null @@ -1,5 +0,0 @@ -(jbuild_version 1) - -(alias - ((name runtest) - (deps ((alias_rec runtest_sandboxing))))) diff --git a/test/proto_alpha/jbuild b/test/proto_alpha/jbuild index bb4e629b4..4b96d8830 100644 --- a/test/proto_alpha/jbuild +++ b/test/proto_alpha/jbuild @@ -13,7 +13,7 @@ client_embedded_alpha)) (flags (:standard -w -9-32 -safe-string -open Tezos_base__TzPervasives - -open Tezos_protocol_environment_alpha + -open Tezos_embedded_protocol_environment_alpha -open Tezos_embedded_raw_protocol_alpha -open Tezos_context -open Client_embedded_alpha)))) diff --git a/test/shell/jbuild b/test/shell/jbuild index 85929ec28..7cc02af77 100644 --- a/test/shell/jbuild +++ b/test/shell/jbuild @@ -7,9 +7,9 @@ (libraries (tezos-base test_lib node_shell - tezos_embedded_protocol_demo - tezos_embedded_protocol_alpha - tezos_embedded_protocol_genesis)) + tezos-embedded-protocol-demo + tezos-embedded-protocol-alpha + tezos-embedded-protocol-genesis)) (flags (:standard -w -9-32 -safe-string -open Tezos_base__TzPervasives))))