From b29cb9b6e73e0cf00563013411a2dbb068f4fc4b Mon Sep 17 00:00:00 2001 From: Richard Watts Date: Tue, 11 Jun 2024 11:19:16 +0100 Subject: [PATCH] (fix) Add emacs backups to .gitignore (fix) A tiny bit more documentation (feat) respect VCPKG_ALWAYS_INSTALL (fix) The protobuf library now appears to want curried arguments. --- .gitignore | 7 ++++++- INSTALL.md | 2 ++ README.md | 31 ++++++++++++++++++++++++++++++- scripts/vcpkg.sh | 5 ++++- src/eval/Ipcmessage_pb.ml | 18 +++++++++--------- 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 5d1052ec0..8b5cb17ea 100644 --- a/.gitignore +++ b/.gitignore @@ -89,4 +89,9 @@ deps/schnorr/install/ # ----------------------------------------------------------------------------- vcpkg_installed/ -debug/ \ No newline at end of file +debug/ + +# Emacs backups +*~ +\#* +.\#* diff --git a/INSTALL.md b/INSTALL.md index 64737d4e5..a96742e54 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,5 +1,7 @@ # Building and Developing Scilla +_These are old instructions - check out the (rather scatty) build instructions in README.md for how to build Scilla for ZQ2_ + The recommended installation process is comprised of two separate steps: - installation of system-wide packages using your OS native package manager and - installation of OCaml packages using the [opam](https://opam.ocaml.org) package manager. diff --git a/README.md b/README.md index fd52fcfe2..f57a9721b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,36 @@ found in [INSTALL.md](./INSTALL.md). ### 3. Compiling -To build the project from the root folder: +You'll need to install `vcpkg` and set `VCPKG_ROOT` to the root of your `vcpkg` installation, following the instructions at . + +```sh +export VCPKG_ROOT=/my/directory/vcpkg +export SCILLA_REPO_ROOT=/where/you/checked/out/scilla +apt install libgmp-dev patchelf +``` + +If `vcpkg` installation fails, you'll need to set: + +```sh +export VCPKG_ALWAYS_INSTALL=true +``` + +To force vcpkg to try again. You'll also need to do: + +``` +make opamdep +``` + +To make opam dependencies. You may well need to: + +``` +touch scilla/_build/default/vcpkg-ocaml/vcpkg-secp256k1/src/c_flags.exp +``` + +And retry to persuade `secp256k1` to rebuild. + +Now, to build the project from the root folder: + ``` make ``` diff --git a/scripts/vcpkg.sh b/scripts/vcpkg.sh index 037b268d6..38d03f200 100755 --- a/scripts/vcpkg.sh +++ b/scripts/vcpkg.sh @@ -33,12 +33,15 @@ then fi # If already installed, exit early. +if [[ -z "${VCPKG_ALWAYS_INSTALL}" ]] +then if [[ -d vcpkg_installed ]] then echo "Found vcpkg_installed, not installing again" exit 0 fi - +fi + echo "Installing vcpkg" if ! "$VCPKG_ROOT"/vcpkg install --triplet "$(scripts/vcpkg_triplet.sh)" then diff --git a/src/eval/Ipcmessage_pb.ml b/src/eval/Ipcmessage_pb.ml index 13a0a6afb..1bc9abf38 100644 --- a/src/eval/Ipcmessage_pb.ml +++ b/src/eval/Ipcmessage_pb.ml @@ -111,31 +111,31 @@ let rec encode_proto_scilla_val_map (v : Ipcmessage_types.proto_scilla_val_map) encoder = let encode_key = Pbrt.Encoder.string in let encode_value x encoder = - Pbrt.Encoder.nested (encode_proto_scilla_val x) encoder + Pbrt.Encoder.nested encode_proto_scilla_val x encoder in List.iter v.Ipcmessage_types.m ~f:(fun (k, v) -> - Pbrt.Encoder.key (1, Pbrt.Bytes) encoder; + Pbrt.Encoder.key 1 Pbrt.Bytes encoder; let map_entry = ((k, Pbrt.Bytes), (v, Pbrt.Bytes)) in Pbrt.Encoder.map_entry ~encode_key ~encode_value map_entry encoder) and encode_proto_scilla_val (v : Ipcmessage_types.proto_scilla_val) encoder = match v with | Ipcmessage_types.Bval x -> - Pbrt.Encoder.key (1, Pbrt.Bytes) encoder; + Pbrt.Encoder.key 1 Pbrt.Bytes encoder; Pbrt.Encoder.bytes x encoder | Ipcmessage_types.Mval x -> - Pbrt.Encoder.key (2, Pbrt.Bytes) encoder; - Pbrt.Encoder.nested (encode_proto_scilla_val_map x) encoder + Pbrt.Encoder.key 2 Pbrt.Bytes encoder; + Pbrt.Encoder.nested encode_proto_scilla_val_map x encoder let rec encode_proto_scilla_query (v : Ipcmessage_types.proto_scilla_query) encoder = - Pbrt.Encoder.key (1, Pbrt.Bytes) encoder; + Pbrt.Encoder.key 1 Pbrt.Bytes encoder; Pbrt.Encoder.string v.Ipcmessage_types.name encoder; - Pbrt.Encoder.key (2, Pbrt.Varint) encoder; + Pbrt.Encoder.key 2 Pbrt.Varint encoder; Pbrt.Encoder.int_as_varint v.Ipcmessage_types.mapdepth encoder; List.iter v.Ipcmessage_types.indices ~f:(fun x -> - Pbrt.Encoder.key (3, Pbrt.Bytes) encoder; + Pbrt.Encoder.key 3 Pbrt.Bytes encoder; Pbrt.Encoder.bytes x encoder); - Pbrt.Encoder.key (4, Pbrt.Varint) encoder; + Pbrt.Encoder.key 4 Pbrt.Varint encoder; Pbrt.Encoder.bool v.Ipcmessage_types.ignoreval encoder; ()