Skip to content

Commit 98ec834

Browse files
authored
Upgrades (#232)
v0.11 of libs, 4.06.1 of ocaml, jbuilder 1.0+beta20 ; use opam.export in the root to get env
1 parent ff21e84 commit 98ec834

File tree

68 files changed

+284
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+284
-255
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: gcr.io/o1labs-192920/ocaml-base:77b01ebb7094f4bc73a8fd3290963e660737c55f
5+
- image: gcr.io/o1labs-192920/ocaml-base:2eeb0f6460680af652d5c6b2b38fecf24df6a5b9
66
# ENV variable is located in circleci
77
auth:
88
username: _json_key

Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM gcr.io/o1labs-192920/ocaml-base:77b01ebb7094f4bc73a8fd3290963e660737c55f
1+
FROM gcr.io/o1labs-192920/ocaml-base:2eeb0f6460680af652d5c6b2b38fecf24df6a5b9
22

3-
ENV PATH "/home/opam/.opam/4.05.0/bin:$PATH"
4-
ENV CAML_LD_LIBRARY_PATH "/home/opam/.opam/4.05.0/lib/stublibs"
5-
ENV MANPATH "/home/opam/.opam/4.05.0/man:"
6-
ENV PERL5LIB "/home/opam/.opam/4.05.0/lib/perl5"
7-
ENV OCAML_TOPLEVEL_PATH "/home/opam/.opam/4.05.0/lib/toplevel"
3+
ENV PATH "/home/opam/.opam/4.06.1/bin:$PATH"
4+
ENV CAML_LD_LIBRARY_PATH "/home/opam/.opam/4.06.1/lib/stublibs"
5+
ENV MANPATH "/home/opam/.opam/4.06.1/man:"
6+
ENV PERL5LIB "/home/opam/.opam/4.06.1/lib/perl5"
7+
ENV OCAML_TOPLEVEL_PATH "/home/opam/.opam/4.06.1/lib/toplevel"
88
ENV FORCE_BUILD 1
99

1010
RUN sudo apt-get install --yes python

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ base-minikube :
4242
base-googlecloud :
4343
./rebuild-googlecloud.sh ocaml-base base-Dockerfile $(shell git rev-parse HEAD)
4444

45-
ocaml405-googlecloud:
46-
./rebuild-googlecloud.sh ocaml405 ocaml405-Dockerfile
45+
ocaml406-googlecloud:
46+
./rebuild-googlecloud.sh ocaml406 ocaml406-Dockerfile
4747

48-
pull-ocaml405-googlecloud:
49-
gcloud docker -- pull gcr.io/o1labs-192920/ocaml405:latest
48+
pull-ocaml406-googlecloud:
49+
gcloud docker -- pull gcr.io/o1labs-192920/ocaml406:latest
5050

5151
ci-base-docker:
5252
./rebuild-docker.sh o1labs/ci-base ci-base-Dockerfile

app/logproc/src/jbuild

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
((name logproc)
55
(public_name logproc)
66
(libraries (core logger async))
7-
(preprocess (pps (ppx_jane ppx_inline_test ppx_driver.runner (-inline-test-lib logproc))))
7+
(preprocess (pps (ppx_jane ppx_inline_test)))
88
(flags (-w -40 -g -warn-error +3+4+6+8+9+10+11+12+14+16+20+21+23+24+26+27+29+32..39+56+58+59+60+61))
99
(modes (native))
1010
))

app/nanobit/src/jbuild

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
async_ssl
3131
cohttp
3232
cohttp-async))
33-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_inline_test ppx_driver.runner (-inline-test-lib cli))))
33+
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_inline_test)))
3434
(flags (-w -40 -g -warn-error +3+4+6+8+9+10+11+12+14+16+20+21+23+24+26+27+29+32..39+56+58+59+60+61))
3535
(modes (native))
3636
))

base-Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gcr.io/o1labs-192920/ocaml405:latest
1+
FROM gcr.io/o1labs-192920/ocaml406:latest
22

33
# Install nix for our haskell deps
44
RUN sudo mkdir -p /nix
@@ -17,20 +17,18 @@ RUN sudo apt-get install --yes libgmp3-dev
1717
RUN sudo apt-get install --yes libboost-dev
1818
RUN sudo apt-get install --yes libboost-program-options-dev
1919

20+
RUN opam update -y && opam upgrade -y
2021
RUN opam depext -i jbuilder
2122
RUN opam install core async ppx_deriving
2223

2324
RUN opam install merlin ocp-indent
24-
RUN opam install ctypes-foreign
25-
RUN opam install ctypes
25+
RUN opam install ctypes-foreign ctypes
2626
RUN opam install jbuilder
27-
RUN opam install yojson menhir
27+
RUN opam install yojson menhir bignum
2828
RUN opam install async_ssl cohttp cohttp-async
29-
RUN opam install bignum
29+
RUN opam install extlib rpc_parallel
3030

3131
ADD ./app/kademlia-haskell/prefetch /prefetch
3232
RUN sudo chown -R opam /prefetch
3333
RUN cd /prefetch && . /home/opam/.nix-profile/etc/profile.d/nix.sh && nix-build prefetch.nix
3434

35-
RUN opam install extlib
36-
RUN opam install rpc_parallel

bignum_bigint.opam

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
opam-version: "1.2"
2+
version: "0.1"
3+
build: [
4+
["jbuilder" "build" "--only" "src" "--root" "." "-j" jobs "@install"]
5+
]
6+

lib/bignum_bigint/bignum_bigint.ml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include Bigint

lib/bignum_bigint/jbuild

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(jbuild_version 1)
2+
3+
(library
4+
((name bignum_bigint)
5+
(public_name bignum_bigint)
6+
(library_flags (-linkall))
7+
(inline_tests)
8+
(libraries (core async async_extra bignum))
9+
(preprocess (pps (ppx_jane)))
10+
(synopsis "Bignum's bigint re-exported as Bignum_bigint")))
11+

lib/blockchain_snark/blockchain_state.ml

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ let target_time_ms = `Two_to_the 13 (* 8.192 seconds *)
1414
let compute_target timestamp (previous_target : Target.t) time =
1515
let target_time_ms =
1616
let `Two_to_the k = target_time_ms in
17-
Bignum.Bigint.(pow (of_int 2) (of_int k))
17+
Bignum_bigint.(pow (of_int 2) (of_int k))
1818
in
1919
let target_max = Target.(to_bigint max) in
2020
let delta_minus_one_max =
21-
Bignum.Bigint.(pow (of_int 2) (of_int delta_minus_one_max_bits) - one)
21+
Bignum_bigint.(pow (of_int 2) (of_int delta_minus_one_max_bits) - one)
2222
in
23-
let div_pow_2 x (`Two_to_the k) = Bignum.Bigint.shift_right x k in
23+
let div_pow_2 x (`Two_to_the k) = Bignum_bigint.shift_right x k in
2424
let previous_target = Target.to_bigint previous_target in
2525
assert Block_time.(time > timestamp);
26-
let rate_multiplier = div_pow_2 Bignum.Bigint.(target_max - previous_target) bound_divisor in
26+
let rate_multiplier = div_pow_2 Bignum_bigint.(target_max - previous_target) bound_divisor in
2727
let delta =
28-
Bignum.Bigint.(
28+
Bignum_bigint.(
2929
of_int64 Block_time.(Span.to_ms (diff time timestamp)) / target_time_ms)
3030
in
31-
let open Bignum.Bigint in
31+
let open Bignum_bigint in
3232
Target.of_bigint begin
3333
if delta = zero
3434
then begin
@@ -50,7 +50,7 @@ let negative_one =
5050
then Target.max
5151
else
5252
Target.of_bigint
53-
Bignum.Bigint.(
53+
Bignum_bigint.(
5454
Target.(to_bigint max) / pow (of_int 2) (of_int 4))
5555
in
5656
let timestamp =

lib/blockchain_snark/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name blockchain_snark)
55
(public_name blockchain_snark)
66
(library_flags (-linkall))
7-
(libraries (core protocols snarky nanobit_base proof_of_work transaction_snark bignum ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_driver.runner (-inline-test-lib blockchain_snark))))
7+
(libraries (core protocols snarky nanobit_base proof_of_work transaction_snark bignum_bigint))
8+
(inline_tests)
9+
(preprocess (pps (ppx_jane ppx_deriving.eq)))
910
(synopsis "blockchain state transition snarking library")))
1011

lib/client_lib/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name client_lib)
55
(public_name client_lib)
66
(library_flags (-linkall))
7-
(libraries (core async nanobit_base ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib client_lib))))
7+
(inline_tests)
8+
(libraries (core async nanobit_base))
9+
(preprocess (pps (ppx_jane)))
910
(synopsis "Lib powering the client interactions with the daemon")))
1011

lib/client_lib_test/client_lib_test.ml

-6
This file was deleted.

lib/client_lib_test/jbuild

-14
This file was deleted.

lib/coda/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name coda)
55
(public_name coda)
66
(library_flags (-linkall))
7-
(libraries (core protocols linear_pipe logger async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.make ppx_driver.runner (-inline-test-lib minibit))))
7+
(inline_tests)
8+
(libraries (core protocols linear_pipe logger async async_extra))
9+
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.make)))
910
(synopsis "Coda gut layer")))
1011

lib/distributed_dsl/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name distributed_dsl)
55
(public_name distributed_dsl)
66
(library_flags (-linkall))
7-
(libraries (logger core linear_pipe async async_extra extlib ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.enum ppx_driver.runner (-inline-test-lib distributed_dsl))))
7+
(inline_tests)
8+
(libraries (logger core linear_pipe async async_extra extlib))
9+
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.enum)))
910
(synopsis "Distributed DSL")))
1011

lib/distributed_dsl_test/distributed_dsl_test.ml

-2
This file was deleted.

lib/distributed_dsl_test/jbuild

-14
This file was deleted.

lib/gossip_net/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name gossip_net)
55
(public_name gossip_net)
66
(library_flags (-linkall))
7-
(libraries (core linear_pipe logger kademlia async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib gossip_net))))
7+
(inline_tests)
8+
(libraries (core linear_pipe logger kademlia async async_extra))
9+
(preprocess (pps (ppx_jane)))
910
(synopsis "Gossip Network")))
1011

lib/kademlia-test/jbuild

-14
This file was deleted.

lib/kademlia-test/kademliatest.ml

-6
This file was deleted.

lib/kademlia/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name kademlia)
55
(public_name kademlia)
66
(library_flags (-linkall))
7-
(libraries (core logger linear_pipe async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib kademlia))))
7+
(inline_tests)
8+
(libraries (core logger linear_pipe async async_extra))
9+
(preprocess (pps (ppx_jane)))
910
(synopsis "Kademlia DHT -- only being used for it's membership")))
1011

lib/ledger_fetcher/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name ledger_fetcher)
55
(public_name ledger_fetcher)
66
(library_flags (-linkall))
7-
(libraries (core storage logger protocols minibit async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner ppx_deriving.std (-inline-test-lib nanobit_base))))
7+
(inline_tests)
8+
(libraries (core storage logger protocols minibit async async_extra))
9+
(preprocess (pps (ppx_jane ppx_deriving.std)))
910
(synopsis "Ledger fetcher fetches ledgers over the network")))
1011

lib/linear_pipe/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name linear_pipe)
55
(public_name linear_pipe)
66
(library_flags (-linkall))
7-
(libraries (core async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib nanobit_base))))
7+
(inline_tests)
8+
(libraries (core async async_extra))
9+
(preprocess (pps (ppx_jane)))
910
(synopsis "Linear pipes are like pipes, but they're linear (enforced at runtime)")))
1011

lib/logger/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name logger)
55
(public_name logger)
66
(library_flags (-linkall))
7-
(libraries (core async ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib logger))))
7+
(inline_tests)
8+
(libraries (core async))
9+
(preprocess (pps (ppx_jane)))
910
(synopsis "Logging library")))
1011

lib/merkle_ledger-test/jbuild

-14
This file was deleted.

lib/merkle_ledger-test/merkle_ledger_test.ml

-2
This file was deleted.

lib/merkle_ledger/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
((name merkle_ledger)
55
(public_name merkle_ledger)
66
(library_flags (-linkall))
7-
(libraries (core extlib ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_driver.runner (-inline-test-lib merkle_ledger))))
7+
(inline_tests)
8+
(libraries (core extlib))
9+
(preprocess (pps (ppx_jane ppx_deriving.eq)))
910
(synopsis "Merkle Ledger implementation")))
1011

lib/minibit/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
(library
44
((name minibit)
55
(public_name minibit)
6+
(inline_tests)
67
(library_flags (-linkall))
7-
(libraries (core protocols linear_pipe logger async async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.make ppx_driver.runner (-inline-test-lib minibit))))
8+
(libraries (core protocols linear_pipe logger async async_extra))
9+
(preprocess (pps (ppx_jane ppx_deriving.eq ppx_deriving.make)))
910
(synopsis "Minibit gut layer")))
1011

lib/minibit_miner/jbuild

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
((name minibit_miner)
55
(public_name minibit_miner)
66
(library_flags (-linkall))
7+
(inline_tests)
78
(libraries
89
( core
910
async
1011
minibit
1112
nanobit_base
1213
protocols
13-
async_extra
14-
ppx_inline_test.runtime-lib))
15-
(preprocess (pps (ppx_jane ppx_driver.runner (-inline-test-lib minibit_networking))))
14+
async_extra ))
15+
(preprocess (pps (ppx_jane)))
1616
(synopsis "Miner layer for Minibit")))
1717

lib/minibit_networking/jbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
(library
44
((name minibit_networking)
55
(public_name minibit_networking)
6+
(inline_tests)
67
(library_flags (-linkall))
7-
(libraries (core async gossip_net minibit protocols async_extra ppx_inline_test.runtime-lib))
8-
(preprocess (pps (ppx_jane ppx_deriving.make ppx_driver.runner (-inline-test-lib minibit_networking))))
8+
(libraries (core async gossip_net minibit protocols async_extra))
9+
(preprocess (pps (ppx_jane ppx_deriving.make)))
910
(synopsis "Networking layer for Minibit")))
1011

lib/nanobit_base-test/jbuild

-14
This file was deleted.

lib/nanobit_base-test/nanobit_base_test.ml

-2
This file was deleted.

0 commit comments

Comments
 (0)