From bcf35bbf69855218c8a8f7cce7807117d9c3521d Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 25 Aug 2022 15:05:58 +0200 Subject: [PATCH 1/3] TPS evaluation: Remove compile time dependency to postgresql --- manifest/main.ml | 4 ++-- opam/tezos-tps-evaluation.opam | 2 +- scripts/update_opam_repo.sh | 2 +- src/bin_tps_evaluation/dune | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index c841d01050d6..e68fe43879ae 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -99,7 +99,7 @@ let caqti = external_lib "caqti" V.True let caqti_lwt = external_lib "caqti-lwt" V.True -let caqti_driver_postgresql = external_lib "caqti-driver-postgresql" V.True +let caqti_dynload = external_lib "caqti-dynload" V.True let cmdliner = external_lib "cmdliner" V.(at_least "1.1.0") @@ -5442,7 +5442,7 @@ let _octez_tps_evaluation = [ octez_base |> open_ ~m:"TzPervasives"; caqti; - caqti_driver_postgresql; + caqti_dynload; caqti_lwt; data_encoding; lwt; diff --git a/opam/tezos-tps-evaluation.opam b/opam/tezos-tps-evaluation.opam index 645cafe9aea8..1e3e47360a3e 100644 --- a/opam/tezos-tps-evaluation.opam +++ b/opam/tezos-tps-evaluation.opam @@ -11,7 +11,7 @@ depends: [ "dune" { >= "3.0" } "tezos-base" "caqti" - "caqti-driver-postgresql" + "caqti-dynload" "caqti-lwt" "data-encoding" { >= "0.6" & < "0.7" } "lwt" { >= "5.4.0" } diff --git a/scripts/update_opam_repo.sh b/scripts/update_opam_repo.sh index 93ba211f4911..f78e726c1413 100755 --- a/scripts/update_opam_repo.sh +++ b/scripts/update_opam_repo.sh @@ -120,7 +120,7 @@ case $(opam --version) in esac #shellcheck disable=SC2086 OPAMSOLVERTIMEOUT=600 opam admin filter --yes --resolve \ - $packages,ocaml,ocaml-base-compiler,odoc,${opam_depext_dep}js_of_ocaml-ppx,opam-ed,ledgerwallet-tezos,$dummy_pkg + $packages,ocaml,ocaml-base-compiler,odoc,${opam_depext_dep}js_of_ocaml-ppx,opam-ed,ledgerwallet-tezos,caqti-driver-postgresql,$dummy_pkg ## Adding useful compiler variants diff --git a/src/bin_tps_evaluation/dune b/src/bin_tps_evaluation/dune index 0fba5e79e169..0493317c01a8 100644 --- a/src/bin_tps_evaluation/dune +++ b/src/bin_tps_evaluation/dune @@ -9,7 +9,7 @@ (libraries tezos-base caqti - caqti-driver-postgresql + caqti-dynload caqti-lwt data-encoding lwt -- GitLab From c488e42e785e0239a4630dea9893dd15966eb192 Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Fri, 26 Aug 2022 15:48:55 +0200 Subject: [PATCH 2/3] Build: document and cleanup packages added manually to opam-repository --- .gitlab/ci/templates.yml | 2 +- scripts/update_opam_repo.sh | 10 ++++++++-- scripts/version.sh | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab/ci/templates.yml b/.gitlab/ci/templates.yml index e4ec92d0e6b4..320bb65b8fb7 100644 --- a/.gitlab/ci/templates.yml +++ b/.gitlab/ci/templates.yml @@ -2,7 +2,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: fa7875a43d20b0377624a310460f6776ac948905 + build_deps_image_version: d830ad8b1830feceeb245a967a6fb7900a2aac9c build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" GIT_STRATEGY: fetch GIT_DEPTH: "1" diff --git a/scripts/update_opam_repo.sh b/scripts/update_opam_repo.sh index f78e726c1413..b0e430d74f1c 100755 --- a/scripts/update_opam_repo.sh +++ b/scripts/update_opam_repo.sh @@ -120,8 +120,14 @@ case $(opam --version) in esac #shellcheck disable=SC2086 OPAMSOLVERTIMEOUT=600 opam admin filter --yes --resolve \ - $packages,ocaml,ocaml-base-compiler,odoc,${opam_depext_dep}js_of_ocaml-ppx,opam-ed,ledgerwallet-tezos,caqti-driver-postgresql,$dummy_pkg - + $packages,ocaml,ocaml-base-compiler,odoc,${opam_depext_dep}ledgerwallet-tezos,caqti-driver-postgresql,$dummy_pkg +## - ocaml-base-compiler has to be explicitely listed for the solver +## to not prefer the "variant" `system` of the compiler +## - odoc is used by the CI to generate the doc +## - ledgerwallet-tezos is an optional dependency of signer-services +## we want to have when building released binaries +## - caqti-driver-postgresq is needed by tps measurement software to +## read tezos-indexer databases ## Adding useful compiler variants for variant in afl flambda fp ; do diff --git a/scripts/version.sh b/scripts/version.sh index fee1e7551583..169559621136 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -25,7 +25,7 @@ export full_opam_repository_tag=231273e96a862099add322413688f896afb02464 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab/ci/templates.ym export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag=fa7875a43d20b0377624a310460f6776ac948905 +export opam_repository_tag=d830ad8b1830feceeb245a967a6fb7900a2aac9c export opam_repository_git=$opam_repository_url.git export opam_repository=$opam_repository_git\#$opam_repository_tag -- GitLab From 98b1bbb573a4657e192b1df6476d8ef31fda7de9 Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 25 Aug 2022 15:29:00 +0200 Subject: [PATCH 3/3] Build: always install caqti but require postgresql only for tps_evaluation --- scripts/install_build_deps.raw.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/install_build_deps.raw.sh b/scripts/install_build_deps.raw.sh index cb1085ecaee9..4c11cb06ccca 100755 --- a/scripts/install_build_deps.raw.sh +++ b/scripts/install_build_deps.raw.sh @@ -6,13 +6,7 @@ src_dir="$(dirname "$script_dir")" #shellcheck source=scripts/version.sh . "$script_dir"/version.sh -if [ "$1" = "--tps" ]; then - opams=$(find "$src_dir/vendors" "$src_dir/src" "$src_dir/tezt" "$src_dir/opam" -name \*.opam -print) -else - # The TPS evaluation tool requires some extra dependencies that we want to hide from the end user that - # builds Octez. As such we're not building it by default. - opams=$(find "$src_dir/vendors" "$src_dir/src" "$src_dir/tezt" "$src_dir/opam" -name \*.opam -not -name tezos-tps-evaluation.opam -print) -fi +opams=$(find "$src_dir/vendors" "$src_dir/src" "$src_dir/tezt" "$src_dir/opam" -name \*.opam -print) export OPAMYES="${OPAMYES:=true}" @@ -46,3 +40,7 @@ $opam_depext_command # an error. # shellcheck disable=SC2086 opam install $opams --deps-only --with-test --criteria="-notuptodate,-changed,-removed" + +if [ "$1" = "--tps" ]; then + opam install caqti-driver-postgresql +fi -- GitLab