Jbuilder: Move alpha/genesis/demo in their own two OPAM packages

One package for the embedded version. One for the functorized one.
This commit is contained in:
Grégoire Henry 2017-11-27 06:13:12 +01:00 committed by Benjamin Canou
parent 78d838059f
commit 9cb498eee6
116 changed files with 384 additions and 166 deletions

4
jbuild
View File

@ -3,3 +3,7 @@
(alias
((name runtest)
(deps ((alias_rec runtest_indent)))))
(alias
((name runtest)
(deps ((alias_rec runtest_sandbox)))))

View File

@ -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} ${<}))))

View File

@ -9,6 +9,8 @@
open Tezos_context
let () = ()
let select_winning_proposal proposals =
let merge proposal vote winners =
match winners with

View File

@ -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} ${<}))))

View File

@ -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 ]
]

View File

@ -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 ]
]

View File

@ -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} ${<}))))

View File

@ -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))))

View File

@ -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 ]
]

View File

@ -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 ]
]

Some files were not shown because too many files have changed in this diff Show More