From 3c7285f6b4e50512da68b83996e541eff77f2109 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 25 May 2022 10:07:12 +0200 Subject: [PATCH] tps_evaluation: remove ppx_blob dep --- manifest/main.ml | 28 +++++++++++++++---- manifest/manifest.mli | 2 +- opam/tezos-tooling.opam | 1 + opam/tezos-tps-evaluation.opam | 1 - src/bin_tps_evaluation/dune | 10 +++++-- .../estimate_average_block_command.ml | 4 +-- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 0c39adc453ee..8162f287c42b 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -208,8 +208,6 @@ let ometrics = opam_only "ometrics" V.(at_least "0.2.1") let parsexp = external_lib ~js_compatible:true "parsexp" V.True -let ppx_blob = external_lib "ppx_blob" V.True - let ppx_inline_test = inline_tests_backend (external_lib "ppx_inline_test" V.True) @@ -1222,6 +1220,10 @@ let _tezos_tooling = it is added to tezos/opam-repository. *) ocamlformat; ometrics; + (* Keep a fake dependency on ppx_blob so that we don't need to + do the opam-repository dance just for this. It will be + removed later when bumping opam-repository is mandatory *) + external_lib "ppx_blob" V.True; ] let _tezos_tooling_js_inline_tests = @@ -4852,7 +4854,6 @@ let _tezos_tps_evaluation = caqti_lwt; data_encoding; lwt; - ppx_blob; Protocol.(baking_exn alpha); Protocol.(client_commands_exn alpha); tezos_client_base_unix; @@ -4861,10 +4862,27 @@ let _tezos_tps_evaluation = tezt_tezos |> open_; tezt_performance_regression |> open_; ] - ~preprocess:[pps ppx_blob] - ~preprocessor_deps:[File "./sql/get_all_operations.sql"] ~static:false ~release:false + ~dune: + Dune. + [ + targets_rule + ["sql.ml"] + ~action: + [ + S "run"; + G + [ + S "%{bin:ocp-ocamlres}"; + S "-format"; + S "ocaml"; + S "-o"; + S "%{targets}"; + ]; + S "%{dep:sql/get_all_operations.sql}"; + ]; + ] (* Add entries to this function to declare that some dune and .opam files are not generated by the manifest on purpose. diff --git a/manifest/manifest.mli b/manifest/manifest.mli index d72efc1d2c7f..c79d758d817c 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -557,7 +557,7 @@ val inline_tests_backend : target -> inline_tests - [preprocess]: preprocessor directives to add using the [(preprocess ...)] stanza. Those preprocessors are also added as dependencies in the [.opam] file. - - [preprocessor_deps]: preprocessor dependencies, such as files for [ppx_blob]. + - [preprocessor_deps]: preprocessor dependencies. - [private_modules]: similar to [modules], but those modules are not part of the library interface. They are not part of the toplevel module of the library. diff --git a/opam/tezos-tooling.opam b/opam/tezos-tooling.opam index e01838d7d55b..3e84e6c34972 100644 --- a/opam/tezos-tooling.opam +++ b/opam/tezos-tooling.opam @@ -12,6 +12,7 @@ depends: [ "bisect_ppx" { >= "2.7.0" } "ocamlformat" { = "0.21.0" } "ometrics" { >= "0.2.1" } + "ppx_blob" "parsexp" {with-test} "base-unix" ] diff --git a/opam/tezos-tps-evaluation.opam b/opam/tezos-tps-evaluation.opam index 5ebd5c6db4e2..82e0416ec887 100644 --- a/opam/tezos-tps-evaluation.opam +++ b/opam/tezos-tps-evaluation.opam @@ -9,7 +9,6 @@ dev-repo: "git+https://gitlab.com/tezos/tezos.git" license: "MIT" depends: [ "dune" { >= "2.9" & < "3.0" } - "ppx_blob" "tezos-base" "caqti" "caqti-driver-postgresql" diff --git a/src/bin_tps_evaluation/dune b/src/bin_tps_evaluation/dune index f8d5e25bdee1..4a20330bc3b7 100644 --- a/src/bin_tps_evaluation/dune +++ b/src/bin_tps_evaluation/dune @@ -13,7 +13,6 @@ caqti-lwt data-encoding lwt - ppx_blob tezos-baking-alpha tezos-client-alpha-commands tezos-client-base-unix @@ -21,8 +20,6 @@ tezt tezt-tezos tezt-performance-regression) - (preprocess (pps ppx_blob)) - (preprocessor_deps (file ./sql/get_all_operations.sql)) (flags (:standard -open Tezos_base.TzPervasives @@ -30,3 +27,10 @@ -open Tezt.Base -open Tezt_tezos -open Tezt_performance_regression))) + +(rule + (targets sql.ml) + (action + (run + %{bin:ocp-ocamlres} -format ocaml -o %{targets} + %{dep:sql/get_all_operations.sql}))) diff --git a/src/bin_tps_evaluation/estimate_average_block_command.ml b/src/bin_tps_evaluation/estimate_average_block_command.ml index fed3825c49d3..c44d4a38847e 100644 --- a/src/bin_tps_evaluation/estimate_average_block_command.ml +++ b/src/bin_tps_evaluation/estimate_average_block_command.ml @@ -105,7 +105,7 @@ module Db = struct ) AS _final WHERE _final.percentage >= ? |} - [%blob "./sql/get_all_operations.sql"] + Sql.get_all_operations_sql in Caqti_request.Infix.( Caqti_type.(tup3 string string float) ->! Encoding.contract_row) @@ -142,7 +142,7 @@ module Db = struct GROUP BY total.transaction_kind |} - [%blob "./sql/get_all_operations.sql"] + Sql.get_all_operations_sql in Caqti_request.Infix.( Caqti_type.(tup2 string string) ->! Encoding.summary_row) -- GitLab