Skip to content

Commit

Permalink
Opam tweaks (#879)
Browse files Browse the repository at this point in the history
* Reorder deps in opam file alphabetically

* build: add dev dependencies target

* ci: update ocamlformat to 0.15.0

* cleanup: remove unused checkers directory
  • Loading branch information
Anton Trunov committed Aug 14, 2020
1 parent d7a62ba commit 2b129b9
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 88 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Invoke `make` to build, `make clean` to clean up, etc.

OCAML_VERSION_RECOMMENDED=4.08.1
OCAMLFORMAT_VERSION=0.14.3
OCAMLFORMAT_VERSION=0.15.0
IPC_SOCK_PATH="/tmp/zilliqa.sock"
CPPLIB_DIR=${PWD}/_build/default/src/base/cpp

Expand Down Expand Up @@ -143,6 +143,10 @@ opamdep:
opam install ./scilla.opam --deps-only --with-test --yes
opam install --yes $(OPAM_DEV_DEPS)

.PHONY : dev-env
dev-deps:
opam install --yes $(OPAM_DEV_DEPS)

.PHONY : opamdep-ci
opamdep-ci:
opam init --disable-sandboxing --compiler=$(OCAML_VERSION) --yes
Expand Down
40 changes: 20 additions & 20 deletions scilla.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ bug-reports: "https://github.com/Zilliqa/scilla/issues"
dev-repo: "git+https://github.com/Zilliqa/scilla.git"
license: "GPL-3.0"
depends: [
"ocaml" {>= "4.08.0" & < "4.11~"}
"dune" {>= "2.0"}
"menhir"
"core" {>= "v0.14.0" & < "v0.15~"}
"bitstring" {>= "3.1.0" & < "3.2~"}
"angstrom" {>= "0.11.0" & < "0.15~"}
"bisect_ppx" {>= "2.0.0" & < "2.5~"}
"bitstring" {>= "3.1.0" & < "3.2~"}
"conf-boost"
"conf-cmake" {build}
"conf-gcc" {build}
"conf-gmp"
"conf-g++" {build}
"conf-libffi"
"conf-libpcre"
"conf-m4" {build}
"conf-openssl"
"conf-pkg-config" {build}
"conf-secp256k1"
"conf-zlib"
"core" {>= "v0.14.0" & < "v0.15~"}
"dune" {>= "2.0"}
"cryptokit" {>= "1.13" & < "1.15~"}
"ctypes" {>= "0.14.0" & < "0.18~"}
"ctypes-foreign" {>= "0.4.0" & < "0.5~"}
"fileutils" {>= "0.5.3" & < "0.7~"}
"hex" {>= "1.3.0" & < "1.5~"}
"yojson" {>= "1.7.0" & < "1.8~"}
"menhir"
"ocaml" {>= "4.08.0" & < "4.11~"}
"ocaml-protoc" {>= "1.2.0" & < "2.1~"}
"ounit" {>= "2.0.8" & < "2.3~"}
"patdiff" {>= "v0.14.0" & < "v0.15~"}
"ppx_deriving" {>= "4.2.1" & < "4.6~"}
"ppx_sexp_conv" {>= "v0.14.0" & < "v0.15~"}
"ppx_compare" {>= "v0.14.0" & < "v0.15~"}
"ppx_deriving_rpc" {>= "6.0.0" & < "8.0~"}
"secp256k1" {>= "0.4.0" & < "0.5~"}
"stdint" {>= "0.5.1" & < "0.7~"}
"ounit" {>= "2.0.8" & < "2.3~"}
"patdiff" {>= "v0.14.0" & < "v0.15~"}
"conf-cmake" {build}
"conf-gcc" {build}
"conf-g++" {build}
"conf-m4" {build}
"conf-pkg-config" {build}
"conf-boost"
"conf-gmp"
"conf-libffi"
"conf-libpcre"
"conf-openssl"
"conf-secp256k1"
"conf-zlib"
"yojson" {>= "1.7.0" & < "1.8~"}
]
build: [
[ "./scripts/libff.sh" ]
Expand Down
93 changes: 49 additions & 44 deletions src/base/Cashflow.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,14 @@ struct
| Constructor (s, ps) ->
let new_ps, new_ps_tags, new_local_env, ps_ctr_tag_map, ps_changes =
List.fold_right ps ~init:([], [], local_env, ctr_tag_map, false)
~f:(fun p
( acc_ps,
acc_ps_tags,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
~f:(fun
p
( acc_ps,
acc_ps_tags,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
let new_p, new_p_tag, p_local_env, p_ctr_tag_map, p_changes =
walk p acc_local_env acc_ctr_tag_map
in
Expand Down Expand Up @@ -1283,9 +1284,10 @@ struct
| Ok res -> res
in
List.fold_right tags_list ~init:([], param_env, local_env, false)
~f:(fun (arg, arg_tag)
(acc_args, acc_param_env, acc_local_env, acc_changes)
->
~f:(fun
(arg, arg_tag)
(acc_args, acc_param_env, acc_local_env, acc_changes)
->
let new_local_env, new_param_env =
update_var_tag2 arg arg_tag acc_local_env acc_param_env
in
Expand Down Expand Up @@ -1385,14 +1387,15 @@ struct
res_clause_changes ) =
List.fold_right clauses
~init:([], expected_tag, param_env, local_env, ctr_tag_map, false)
~f:(fun (p, ep)
( acc_clauses,
acc_res_tag,
acc_param_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
~f:(fun
(p, ep)
( acc_clauses,
acc_res_tag,
acc_param_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
let sub_local_env =
insert_pattern_vars_into_env p acc_local_env
in
Expand Down Expand Up @@ -1471,9 +1474,8 @@ struct
(* Find initializers and update env as appropriate *)
let new_bs, new_param_env, new_local_env, changes =
List.fold_right bs ~init:([], param_env, local_env, false)
~f:(fun (s, p)
(acc_bs, acc_param_env, acc_local_env, acc_changes)
->
~f:(fun (s, p) (acc_bs, acc_param_env, acc_local_env, acc_changes)
->
match p with
| MLit _ ->
((s, p) :: acc_bs, acc_param_env, acc_local_env, acc_changes)
Expand Down Expand Up @@ -1693,14 +1695,15 @@ struct
res_clause_changes ) =
List.fold_right clauses
~init:([], param_env, field_env, local_env, ctr_tag_map, false)
~f:(fun (p, sp)
( acc_clauses,
acc_param_env,
acc_field_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
~f:(fun
(p, sp)
( acc_clauses,
acc_param_env,
acc_field_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
let sub_local_env =
insert_pattern_vars_into_env p acc_local_env
in
Expand Down Expand Up @@ -1857,14 +1860,15 @@ struct
in
List.fold_right ss
~init:([], param_env, field_env, init_local_env, ctr_tag_map, false)
~f:(fun s
( acc_ss,
acc_param_env,
acc_field_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
~f:(fun
s
( acc_ss,
acc_param_env,
acc_field_env,
acc_local_env,
acc_ctr_tag_map,
acc_changes )
->
let ( new_s,
new_param_env,
new_field_env,
Expand Down Expand Up @@ -1955,13 +1959,14 @@ struct
List.fold_right components
~init:
([], tmp_param_env, field_env, tmp_ctr_tag_map, constraint_changes)
~f:(fun t
( acc_ts,
acc_param_env,
acc_field_env,
acc_ctr_tag_map,
acc_changes )
->
~f:(fun
t
( acc_ts,
acc_param_env,
acc_field_env,
acc_ctr_tag_map,
acc_changes )
->
let new_t, new_param_env, new_field_env, new_ctr_tag_map, t_changes
=
cf_tag_component t acc_param_env acc_field_env acc_ctr_tag_map
Expand Down
19 changes: 8 additions & 11 deletions src/base/Disambiguate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,10 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct

(* Build dictionaries *)
foldM imports ~init:([], [], [], [])
~f:(fun ( ns_dict_acc,
simp_var_dict_acc,
simp_typ_dict_acc,
simp_ctr_dict_acc )
(libname, ns_opt)
->
~f:(fun
(ns_dict_acc, simp_var_dict_acc, simp_typ_dict_acc, simp_ctr_dict_acc)
(libname, ns_opt)
->
let%bind lib = find_lib libname extlibs in
let%bind lib_filename = find_lib_filename lib in
let add_key_and_lib_filename_to_dict dict key =
Expand Down Expand Up @@ -706,11 +704,10 @@ module ScillaDisambiguation (SR : Rep) (ER : Rep) = struct
let%bind simp_var_dict, simp_typ_dict, simp_ctr_dict =
foldM lib.lentries
~init:(simp_var_dict_acc, simp_typ_dict_acc, simp_ctr_dict_acc)
~f:(fun ( simp_var_dict_acc',
simp_typ_dict_acc',
simp_ctr_dict_acc' )
lentry
->
~f:(fun
(simp_var_dict_acc', simp_typ_dict_acc', simp_ctr_dict_acc')
lentry
->
match lentry with
| LibVar (x, _, _) ->
(* simple var name *)
Expand Down
7 changes: 4 additions & 3 deletions src/base/Recursion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,10 @@ module ScillaRecursion (SR : Rep) (ER : Rep) = struct
SR.get_loc (get_rep lname) )
@@ let%bind recursion_entries, adts, _, _ =
foldM lentries ~init:([], [], [], [])
~f:(fun (rec_entries, datatypes, adts_in_scope, adt_ctrs_in_scope)
entry
->
~f:(fun
(rec_entries, datatypes, adts_in_scope, adt_ctrs_in_scope)
entry
->
let%bind new_entry, adt_opt =
recursion_lib_entry
(is_adt_in_scope adts_in_scope)
Expand Down
9 changes: 0 additions & 9 deletions src/checkers/dune

This file was deleted.

0 comments on commit 2b129b9

Please sign in to comment.