From 88028c6c754fb39d26a2dfa3fb972022e5c0b1c9 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 27 Jan 2023 10:00:29 +0100 Subject: [PATCH 1/4] Manifest: fix potential Not_found exception --- manifest/manifest.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifest/manifest.ml b/manifest/manifest.ml index a0133835958e..fe21f9ea6bbf 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -3040,7 +3040,9 @@ let check_circular_opam_deps () = in while not (Queue.is_empty to_visit) do let elt = Queue.take to_visit in - let elt_path = Hashtbl.find shortest_path elt.kind in + let elt_path = + Option.value ~default:[] (Hashtbl.find_opt shortest_path elt.kind) + in list_iter (deps_of elt) (fun (dep : Target.internal) -> if not (Hashtbl.mem shortest_path dep.kind) then ( let path = dep :: elt_path in -- GitLab From 71bc8e50f971719ee7b4d1cb90d27c9f843eb6ad Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 27 Jan 2023 10:35:26 +0100 Subject: [PATCH 2/4] Manifest: move some tezt packages up in main.ml --- manifest/main.ml | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 96c122bf344e..66b263748d5f 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -333,22 +333,6 @@ let tezos_rust_lib = let tezos_rust_lib_sapling = opam_only ~can_vendor:false "tezos-rust-libs" V.(at_least "1.1") -let tezt_lib = - external_lib - ~js_compatible:false - "tezt" - V.(at_least "3.0.0") - ~main_module:"Tezt" - -let tezt_core_lib = - external_sublib - tezt_lib - ~js_compatible:true - "tezt.core" - ~main_module:"Tezt_core" - -let tezt_js_lib = external_sublib tezt_lib ~js_compatible:true "tezt.js" - let tls = external_lib "tls" V.(at_least "0.13.0") let unix = external_lib ~opam:"base-unix" "unix" V.True @@ -388,6 +372,35 @@ let () = (* INTERNAL LIBS *) +let tezt_lib = + external_lib + ~js_compatible:false + "tezt" + V.(at_least "3.0.0") + ~main_module:"Tezt" + +let tezt_core_lib = + external_sublib + tezt_lib + ~js_compatible:true + "tezt.core" + ~main_module:"Tezt_core" + +let tezt_js_lib = external_sublib tezt_lib ~js_compatible:true "tezt.js" + +let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?synopsis l = + tezt_without_tezt_lib_dependency + ~opam + ~path + ?synopsis + ?js_compatible + ?modes + ~lib_deps:((tezt_core_lib |> open_ |> open_ ~m:"Base") :: deps) + ~exe_deps:[tezt_lib] + ~js_deps:[tezt_js_lib] + ?dep_globs + l + let octez_test_helpers = public_lib "tezos-test-helpers" @@ -3070,19 +3083,6 @@ let octez_shell_benchmarks = ] ~linkall:true -let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?synopsis l = - tezt_without_tezt_lib_dependency - ~opam - ~path - ?synopsis - ?js_compatible - ?modes - ~lib_deps:((tezt_core_lib |> open_ |> open_ ~m:"Base") :: deps) - ~exe_deps:[tezt_lib] - ~js_deps:[tezt_js_lib] - ?dep_globs - l - let tezt_performance_regression = public_lib "tezt-performance-regression" -- GitLab From 44cd770b36d99e91870b53132949468c0a43d3a9 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 10 Feb 2023 16:33:52 +0100 Subject: [PATCH 3/4] Manifest: add ?dep_files to val tezt --- manifest/main.ml | 4 +++- manifest/manifest.ml | 6 +++++- manifest/manifest.mli | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 66b263748d5f..a2a321e0afbe 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -388,7 +388,8 @@ let tezt_core_lib = let tezt_js_lib = external_sublib tezt_lib ~js_compatible:true "tezt.js" -let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?synopsis l = +let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?dep_files + ?synopsis l = tezt_without_tezt_lib_dependency ~opam ~path @@ -399,6 +400,7 @@ let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?synopsis l = ~exe_deps:[tezt_lib] ~js_deps:[tezt_js_lib] ?dep_globs + ?dep_files l let octez_test_helpers = diff --git a/manifest/manifest.ml b/manifest/manifest.ml index fe21f9ea6bbf..c4c3ed98ab57 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -1782,6 +1782,7 @@ type tezt_target = { exe_deps : target list; js_deps : target list; dep_globs : string list; + dep_files : string list; modules : string list; js_compatible : bool option; modes : Dune.mode list option; @@ -1791,7 +1792,7 @@ type tezt_target = { let tezt_targets_by_path : tezt_target String_map.t ref = ref String_map.empty let tezt ~opam ~path ?js_compatible ?modes ?(lib_deps = []) ?(exe_deps = []) - ?(js_deps = []) ?(dep_globs = []) ?synopsis modules = + ?(js_deps = []) ?(dep_globs = []) ?(dep_files = []) ?synopsis modules = if String_map.mem path !tezt_targets_by_path then invalid_arg ("cannot call Manifest.tezt twice for the same directory: " ^ path) ; @@ -1802,6 +1803,7 @@ let tezt ~opam ~path ?js_compatible ?modes ?(lib_deps = []) ?(exe_deps = []) exe_deps; js_deps; dep_globs; + dep_files; modules; js_compatible; modes; @@ -1819,6 +1821,7 @@ let register_tezt_targets ~make_tezt_exe = exe_deps; js_deps; dep_globs; + dep_files; modules; js_compatible; modes; @@ -1852,6 +1855,7 @@ let register_tezt_targets ~make_tezt_exe = ?modes ~deps:(lib :: deps) ~dep_globs + ~dep_files ~modules:[exe_name] ~dune: Dune. diff --git a/manifest/manifest.mli b/manifest/manifest.mli index 1cd25805387c..3aa9e70a3763 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -920,6 +920,7 @@ val tezt : ?exe_deps:target list -> ?js_deps:target list -> ?dep_globs:string list -> + ?dep_files:string list -> ?synopsis:string -> string list -> unit -- GitLab From 570f4ef33fe69dd9b9c7c1f00ba4b7742b3a7a12 Mon Sep 17 00:00:00 2001 From: Romain Bardou Date: Mon, 7 Nov 2022 16:29:57 +0100 Subject: [PATCH 4/4] Manifest: add ?opam_with_test to tezt --- manifest/main.ml | 3 ++- manifest/manifest.ml | 7 ++++++- manifest/manifest.mli | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index a2a321e0afbe..082bbfefa27d 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -389,7 +389,7 @@ let tezt_core_lib = let tezt_js_lib = external_sublib tezt_lib ~js_compatible:true "tezt.js" let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?dep_files - ?synopsis l = + ?synopsis ?opam_with_test l = tezt_without_tezt_lib_dependency ~opam ~path @@ -401,6 +401,7 @@ let tezt ~opam ~path ?js_compatible ?modes ?(deps = []) ?dep_globs ?dep_files ~js_deps:[tezt_js_lib] ?dep_globs ?dep_files + ?opam_with_test l let octez_test_helpers = diff --git a/manifest/manifest.ml b/manifest/manifest.ml index c4c3ed98ab57..b8ff8c90f305 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -1787,12 +1787,14 @@ type tezt_target = { js_compatible : bool option; modes : Dune.mode list option; synopsis : string option; + opam_with_test : with_test option; } let tezt_targets_by_path : tezt_target String_map.t ref = ref String_map.empty let tezt ~opam ~path ?js_compatible ?modes ?(lib_deps = []) ?(exe_deps = []) - ?(js_deps = []) ?(dep_globs = []) ?(dep_files = []) ?synopsis modules = + ?(js_deps = []) ?(dep_globs = []) ?(dep_files = []) ?synopsis + ?opam_with_test modules = if String_map.mem path !tezt_targets_by_path then invalid_arg ("cannot call Manifest.tezt twice for the same directory: " ^ path) ; @@ -1808,6 +1810,7 @@ let tezt ~opam ~path ?js_compatible ?modes ?(lib_deps = []) ?(exe_deps = []) js_compatible; modes; synopsis; + opam_with_test; } in tezt_targets_by_path := String_map.add path tezt_target !tezt_targets_by_path @@ -1826,6 +1829,7 @@ let register_tezt_targets ~make_tezt_exe = js_compatible; modes; synopsis; + opam_with_test; } = let path_with_underscores = String.map (function '-' | '/' -> '_' | c -> c) path @@ -1857,6 +1861,7 @@ let register_tezt_targets ~make_tezt_exe = ~dep_globs ~dep_files ~modules:[exe_name] + ?opam_with_test ~dune: Dune. [ diff --git a/manifest/manifest.mli b/manifest/manifest.mli index 3aa9e70a3763..83cee60178c6 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -922,6 +922,7 @@ val tezt : ?dep_globs:string list -> ?dep_files:string list -> ?synopsis:string -> + ?opam_with_test:with_test -> string list -> unit -- GitLab