From 8f8f3f1c34276186559a1cb548175b417e955c8a Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 1 Jun 2022 13:09:38 +0200 Subject: [PATCH 1/4] Protocol: use standard flags --- manifest/main.ml | 17 +++++------------ manifest/manifest.ml | 20 +++----------------- manifest/manifest.mli | 13 ++----------- src/proto_000_Ps9mPmXa/lib_protocol/dune | 14 ++++++-------- src/proto_001_PtCJ7pwo/lib_protocol/dune | 14 ++++++-------- src/proto_002_PsYLVpVv/lib_protocol/dune | 14 ++++++-------- src/proto_003_PsddFKi3/lib_protocol/dune | 14 ++++++-------- src/proto_004_Pt24m4xi/lib_protocol/dune | 14 ++++++-------- src/proto_005_PsBABY5H/lib_protocol/dune | 14 ++++++-------- src/proto_005_PsBabyM1/lib_protocol/dune | 14 ++++++-------- src/proto_006_PsCARTHA/lib_protocol/dune | 14 ++++++-------- src/proto_007_PsDELPH1/lib_protocol/dune | 14 ++++++-------- src/proto_008_PtEdo2Zk/lib_protocol/dune | 14 ++++++-------- src/proto_008_PtEdoTez/lib_protocol/dune | 14 ++++++-------- src/proto_009_PsFLoren/lib_protocol/dune | 14 ++++++-------- src/proto_010_PtGRANAD/lib_protocol/dune | 14 ++++++-------- src/proto_011_PtHangz2/lib_protocol/dune | 14 ++++++-------- src/proto_012_Psithaca/lib_protocol/dune | 14 ++++++-------- src/proto_013_PtJakart/lib_protocol/dune | 14 ++++++-------- src/proto_alpha/lib_protocol/dune | 14 ++++++-------- src/proto_demo_counter/lib_protocol/dune | 14 ++++++-------- src/proto_demo_noops/lib_protocol/dune | 14 ++++++-------- src/proto_genesis/lib_protocol/dune | 14 ++++++-------- 23 files changed, 130 insertions(+), 200 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index dcddfdaf6f94..f46e0f1d7b11 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -3327,9 +3327,8 @@ end = struct in disabled_by_default @ disabled_extra in - sf "+a%s" (disabled_warnings_to_string disabled_warnings) + disabled_warnings_to_string disabled_warnings in - let warn_error = "+a" in let environment = public_lib (sf "tezos-protocol-%s.environment" name_dash) @@ -3367,13 +3366,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end ~opam:(sf "tezos-protocol-%s" name_dash) ~linkall:true ~modules:tezos_protocol.modules - ~flags: - (Flags.standard - ~nopervasives:true - ~nostdlib:true - ~warnings - ~warn_error - ()) + ~flags:(Flags.standard ~nopervasives:true ~nostdlib:true ~warnings ()) ~deps:[environment |> open_ ~m:"Environment"] ~opens:["Pervasives"; "Error_monad"] in @@ -3394,7 +3387,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end name_underscore | Alpha | V _ -> "Tezos/Protocol: economic-protocol definition") ~modules:["Protocol"] - ~flags:(Flags.no_standard ~nopervasives:true ~warn_error ~warnings ()) + ~flags:(Flags.standard ~nopervasives:true ~warnings ()) ~deps: [ tezos_protocol_environment; @@ -3470,7 +3463,7 @@ include Tezos_raw_protocol_%s.Main (* The instrumentation is removed as it can lead to a stack overflow *) (* https://gitlab.com/tezos/tezos/-/issues/1927 *) ~bisect_ppx:false - ~flags:(Flags.no_standard ~nopervasives:true ~warn_error ~warnings ()) + ~flags:(Flags.standard ~nopervasives:true ~warnings ()) ~opam_only_deps:[tezos_protocol_compiler_tezos_protocol_packer] ~deps: [ @@ -3523,7 +3516,7 @@ include Tezos_raw_protocol_%s.Main `tezos-node`") ~modules:["Registerer"] ~linkall:true - ~flags:(Flags.standard ~warnings ~warn_error ()) + ~flags:(Flags.standard ~warnings ()) ~deps:[main; tezos_protocol_updater; tezos_protocol_environment] ~dune: Dune. diff --git a/manifest/manifest.ml b/manifest/manifest.ml index 47eab1d6fcd7..1e94bc58d192 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -721,37 +721,23 @@ end module Flags = struct type t = {standard : bool; rest : Dune.s_expr list} - type maker = - ?nopervasives:bool -> - ?nostdlib:bool -> - ?opaque:bool -> - ?warnings:string -> - ?warn_error:string -> - unit -> - t - let if_true b name = if b then Dune.S name else Dune.E let if_some o name = match o with None -> Dune.E | Some x -> H [S name; S x] - let make ~standard ?(nopervasives = false) ?(nostdlib = false) - ?(opaque = false) ?warnings ?warn_error () = + let standard ?(nopervasives = false) ?(nostdlib = false) ?(opaque = false) + ?warnings () = { - standard; + standard = true; rest = [ if_some warnings "-w"; - if_some warn_error "-warn-error"; if_true nostdlib "-nostdlib"; if_true nopervasives "-nopervasives"; if_true opaque "-opaque"; ]; } - let standard = make ~standard:true - - let no_standard = make ~standard:false - let include_ f = {standard = false; rest = Dune.[S ":include"; S f]} end diff --git a/manifest/manifest.mli b/manifest/manifest.mli index 2d479e816791..3523fbe1b9f0 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -460,7 +460,7 @@ module Flags : sig (** OCaml flags *) type t - (** Functions that build OCaml flags. + (** Extend standard flags with custom ones. - [nopervasives]: if [true], add [-nopervasives] to the list of flags. @@ -469,24 +469,15 @@ module Flags : sig - [opaque]: if [true], add [-opaque] to the list of flags. - [warnings]: the argument passed to the -w flag when building. - - - [warn_error]: the argument passed to the -warn-error flag when building. *) - type maker = + val standard : ?nopervasives:bool -> ?nostdlib:bool -> ?opaque:bool -> ?warnings:string -> - ?warn_error:string -> unit -> t - (** Extend standard flags with custom ones. *) - val standard : maker - - (** Override standard flags with custom ones. *) - val no_standard : maker - (** [include_ file] will use the flags defined in the file [file]. *) val include_ : string -> t end diff --git a/src/proto_000_Ps9mPmXa/lib_protocol/dune b/src/proto_000_Ps9mPmXa/lib_protocol/dune index ed6adb17ff06..c6a7f2c73000 100644 --- a/src/proto_000_Ps9mPmXa/lib_protocol/dune +++ b/src/proto_000_Ps9mPmXa/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_000_Ps9mPmXa.Environment @@ -44,8 +43,8 @@ tezos-protocol-environment.sigs tezos-protocol-000-Ps9mPmXa.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -78,8 +77,8 @@ tezos-protocol-environment.sigs tezos-protocol-000-Ps9mPmXa.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -106,8 +105,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_001_PtCJ7pwo/lib_protocol/dune b/src/proto_001_PtCJ7pwo/lib_protocol/dune index ee20955f79e4..b3d86aab3f44 100644 --- a/src/proto_001_PtCJ7pwo/lib_protocol/dune +++ b/src/proto_001_PtCJ7pwo/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_001_PtCJ7pwo.Environment @@ -111,8 +110,8 @@ tezos-protocol-environment.sigs tezos-protocol-001-PtCJ7pwo.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -276,8 +275,8 @@ tezos-protocol-environment.sigs tezos-protocol-001-PtCJ7pwo.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -369,8 +368,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_002_PsYLVpVv/lib_protocol/dune b/src/proto_002_PsYLVpVv/lib_protocol/dune index be4f00bd7ba0..6af64260f12a 100644 --- a/src/proto_002_PsYLVpVv/lib_protocol/dune +++ b/src/proto_002_PsYLVpVv/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_002_PsYLVpVv.Environment @@ -111,8 +110,8 @@ tezos-protocol-environment.sigs tezos-protocol-002-PsYLVpVv.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -276,8 +275,8 @@ tezos-protocol-environment.sigs tezos-protocol-002-PsYLVpVv.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -369,8 +368,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_003_PsddFKi3/lib_protocol/dune b/src/proto_003_PsddFKi3/lib_protocol/dune index 368fc8f28fae..5f4708ff5a53 100644 --- a/src/proto_003_PsddFKi3/lib_protocol/dune +++ b/src/proto_003_PsddFKi3/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_003_PsddFKi3.Environment @@ -112,8 +111,8 @@ tezos-protocol-environment.sigs tezos-protocol-003-PsddFKi3.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -279,8 +278,8 @@ tezos-protocol-environment.sigs tezos-protocol-003-PsddFKi3.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -373,8 +372,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_004_Pt24m4xi/lib_protocol/dune b/src/proto_004_Pt24m4xi/lib_protocol/dune index 0dd9b015298c..9627ca57225b 100644 --- a/src/proto_004_Pt24m4xi/lib_protocol/dune +++ b/src/proto_004_Pt24m4xi/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_004_Pt24m4xi.Environment @@ -112,8 +111,8 @@ tezos-protocol-environment.sigs tezos-protocol-004-Pt24m4xi.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -279,8 +278,8 @@ tezos-protocol-environment.sigs tezos-protocol-004-Pt24m4xi.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -373,8 +372,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_005_PsBABY5H/lib_protocol/dune b/src/proto_005_PsBABY5H/lib_protocol/dune index 6e3c40b05969..a3a3d7e5ece3 100644 --- a/src/proto_005_PsBABY5H/lib_protocol/dune +++ b/src/proto_005_PsBABY5H/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_005_PsBABY5H.Environment @@ -113,8 +112,8 @@ tezos-protocol-environment.sigs tezos-protocol-005-PsBABY5H.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -282,8 +281,8 @@ tezos-protocol-environment.sigs tezos-protocol-005-PsBABY5H.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -377,8 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_005_PsBabyM1/lib_protocol/dune b/src/proto_005_PsBabyM1/lib_protocol/dune index 062bb6e61ad4..b03f34b107bf 100644 --- a/src/proto_005_PsBabyM1/lib_protocol/dune +++ b/src/proto_005_PsBabyM1/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_005_PsBabyM1.Environment @@ -113,8 +112,8 @@ tezos-protocol-environment.sigs tezos-protocol-005-PsBabyM1.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -282,8 +281,8 @@ tezos-protocol-environment.sigs tezos-protocol-005-PsBabyM1.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -377,8 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_006_PsCARTHA/lib_protocol/dune b/src/proto_006_PsCARTHA/lib_protocol/dune index f93585fecb85..a3acee099c6f 100644 --- a/src/proto_006_PsCARTHA/lib_protocol/dune +++ b/src/proto_006_PsCARTHA/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_006_PsCARTHA.Environment @@ -113,8 +112,8 @@ tezos-protocol-environment.sigs tezos-protocol-006-PsCARTHA.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -282,8 +281,8 @@ tezos-protocol-environment.sigs tezos-protocol-006-PsCARTHA.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -377,8 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_007_PsDELPH1/lib_protocol/dune b/src/proto_007_PsDELPH1/lib_protocol/dune index 0c35ec7ec487..6dea11de7dd5 100644 --- a/src/proto_007_PsDELPH1/lib_protocol/dune +++ b/src/proto_007_PsDELPH1/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_007_PsDELPH1.Environment @@ -115,8 +114,8 @@ tezos-protocol-environment.sigs tezos-protocol-007-PsDELPH1.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -288,8 +287,8 @@ tezos-protocol-environment.sigs tezos-protocol-007-PsDELPH1.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -385,8 +384,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_008_PtEdo2Zk/lib_protocol/dune b/src/proto_008_PtEdo2Zk/lib_protocol/dune index 6ca589a80bfe..bcaa10903493 100644 --- a/src/proto_008_PtEdo2Zk/lib_protocol/dune +++ b/src/proto_008_PtEdo2Zk/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_008_PtEdo2Zk.Environment @@ -120,8 +119,8 @@ tezos-protocol-environment.sigs tezos-protocol-008-PtEdo2Zk.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -303,8 +302,8 @@ tezos-protocol-environment.sigs tezos-protocol-008-PtEdo2Zk.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -405,8 +404,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_008_PtEdoTez/lib_protocol/dune b/src/proto_008_PtEdoTez/lib_protocol/dune index cd699728bef7..e0a93d880471 100644 --- a/src/proto_008_PtEdoTez/lib_protocol/dune +++ b/src/proto_008_PtEdoTez/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_008_PtEdoTez.Environment @@ -120,8 +119,8 @@ tezos-protocol-environment.sigs tezos-protocol-008-PtEdoTez.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -303,8 +302,8 @@ tezos-protocol-environment.sigs tezos-protocol-008-PtEdoTez.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -405,8 +404,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_009_PsFLoren/lib_protocol/dune b/src/proto_009_PsFLoren/lib_protocol/dune index f845acd60573..ea24187a28f9 100644 --- a/src/proto_009_PsFLoren/lib_protocol/dune +++ b/src/proto_009_PsFLoren/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_009_PsFLoren.Environment @@ -123,8 +122,8 @@ tezos-protocol-environment.sigs tezos-protocol-009-PsFLoren.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -312,8 +311,8 @@ tezos-protocol-environment.sigs tezos-protocol-009-PsFLoren.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -417,8 +416,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_010_PtGRANAD/lib_protocol/dune b/src/proto_010_PtGRANAD/lib_protocol/dune index 89ef9afc84bf..10445a7520a4 100644 --- a/src/proto_010_PtGRANAD/lib_protocol/dune +++ b/src/proto_010_PtGRANAD/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nostdlib -nopervasives -open Tezos_protocol_environment_010_PtGRANAD.Environment @@ -128,8 +127,8 @@ tezos-protocol-environment.sigs tezos-protocol-010-PtGRANAD.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Protocol)) @@ -327,8 +326,8 @@ tezos-protocol-environment.sigs tezos-protocol-010-PtGRANAD.raw) (flags - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a + (:standard) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 -nopervasives) (modules Functor)) @@ -437,8 +436,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 - -warn-error +a) + -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) (modules Registerer)) (rule diff --git a/src/proto_011_PtHangz2/lib_protocol/dune b/src/proto_011_PtHangz2/lib_protocol/dune index a877091933d7..9fedea559911 100644 --- a/src/proto_011_PtHangz2/lib_protocol/dune +++ b/src/proto_011_PtHangz2/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + -w -4-40..42-44-45-48-51-70 -nostdlib -nopervasives -open Tezos_protocol_environment_011_PtHangz2.Environment @@ -141,8 +140,8 @@ tezos-protocol-environment.sigs tezos-protocol-011-PtHangz2.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Protocol)) @@ -366,8 +365,8 @@ tezos-protocol-environment.sigs tezos-protocol-011-PtHangz2.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Functor)) @@ -489,8 +488,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a) + -w -4-40..42-44-45-48-51-70) (modules Registerer)) (rule diff --git a/src/proto_012_Psithaca/lib_protocol/dune b/src/proto_012_Psithaca/lib_protocol/dune index cf583aba6a10..6606eca7b4b3 100644 --- a/src/proto_012_Psithaca/lib_protocol/dune +++ b/src/proto_012_Psithaca/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + -w -4-40..42-44-45-48-51-70 -nostdlib -nopervasives -open Tezos_protocol_environment_012_Psithaca.Environment @@ -158,8 +157,8 @@ tezos-protocol-environment.sigs tezos-protocol-012-Psithaca.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Protocol)) @@ -417,8 +416,8 @@ tezos-protocol-environment.sigs tezos-protocol-012-Psithaca.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Functor)) @@ -557,8 +556,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a) + -w -4-40..42-44-45-48-51-70) (modules Registerer)) (rule diff --git a/src/proto_013_PtJakart/lib_protocol/dune b/src/proto_013_PtJakart/lib_protocol/dune index 668dac8b6665..52307ad32400 100644 --- a/src/proto_013_PtJakart/lib_protocol/dune +++ b/src/proto_013_PtJakart/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + -w -4-40..42-44-45-48-51-70 -nostdlib -nopervasives -open Tezos_protocol_environment_013_PtJakart.Environment @@ -223,8 +222,8 @@ tezos-protocol-environment.sigs tezos-protocol-013-PtJakart.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Protocol)) @@ -614,8 +613,8 @@ tezos-protocol-environment.sigs tezos-protocol-013-PtJakart.raw) (flags - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-51-70 -nopervasives) (modules Functor)) @@ -820,8 +819,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-51-70 - -warn-error +a) + -w -4-40..42-44-45-48-51-70) (modules Registerer)) (rule diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index 66f2ede09ba7..1affedea66f5 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a + -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_alpha.Environment @@ -242,8 +241,8 @@ tezos-protocol-environment.sigs tezos-protocol-alpha.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -673,8 +672,8 @@ tezos-protocol-environment.sigs tezos-protocol-alpha.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -899,8 +898,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a) + -w -4-40..42-44-45-48-70) (modules Registerer)) (rule diff --git a/src/proto_demo_counter/lib_protocol/dune b/src/proto_demo_counter/lib_protocol/dune index 7db2c5c724ff..52e490266ea4 100644 --- a/src/proto_demo_counter/lib_protocol/dune +++ b/src/proto_demo_counter/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a + -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_demo_counter.Environment @@ -53,8 +52,8 @@ tezos-protocol-environment.sigs tezos-protocol-demo-counter.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -102,8 +101,8 @@ tezos-protocol-environment.sigs tezos-protocol-demo-counter.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -137,8 +136,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a) + -w -4-40..42-44-45-48-70) (modules Registerer)) (rule diff --git a/src/proto_demo_noops/lib_protocol/dune b/src/proto_demo_noops/lib_protocol/dune index df7a83ac13ee..0b965348e28a 100644 --- a/src/proto_demo_noops/lib_protocol/dune +++ b/src/proto_demo_noops/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a + -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_demo_noops.Environment @@ -44,8 +43,8 @@ tezos-protocol-environment.sigs tezos-protocol-demo-noops.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -74,8 +73,8 @@ tezos-protocol-environment.sigs tezos-protocol-demo-noops.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -100,8 +99,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a) + -w -4-40..42-44-45-48-70) (modules Registerer)) (rule diff --git a/src/proto_genesis/lib_protocol/dune b/src/proto_genesis/lib_protocol/dune index c66c80f8a265..53a51e666466 100644 --- a/src/proto_genesis/lib_protocol/dune +++ b/src/proto_genesis/lib_protocol/dune @@ -26,8 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a + -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_genesis.Environment @@ -44,8 +43,8 @@ tezos-protocol-environment.sigs tezos-protocol-genesis.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -78,8 +77,8 @@ tezos-protocol-environment.sigs tezos-protocol-genesis.raw) (flags - -w +a-4-40..42-44-45-48-70 - -warn-error +a + (:standard) + -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -106,8 +105,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w +a-4-40..42-44-45-48-70 - -warn-error +a) + -w -4-40..42-44-45-48-70) (modules Registerer)) (rule -- GitLab From e25b6a2193616865c5f1e6b4f73a428833cd5499 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 1 Jun 2022 14:06:42 +0200 Subject: [PATCH 2/4] Manifest: simplify warning handling --- manifest/main.ml | 51 +++++++++++++++---------------------------- manifest/manifest.ml | 30 +++++++++++++++++++++---- manifest/manifest.mli | 6 ++--- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index f46e0f1d7b11..02b94b4c94ef 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -3257,25 +3257,6 @@ end = struct in () - let disabled_warnings_to_string l = - let int_ranges l = - List.sort_uniq compare l - |> List.fold_left - (fun acc x -> - match acc with - | [] -> [(x, x)] - | (l, u) :: acc when succ u = x -> (l, x) :: acc - | _ -> (x, x) :: acc) - [] - |> List.rev - in - let range_to_flag (x, y) = - if x = y then sf "-%d" x - else if x + 1 = y then sf "-%d-%d" x y - else sf "-%d..%d" x y - in - List.map range_to_flag (int_ranges l) |> String.concat "" - let make ~name = let name_underscore = Name.name_underscore name in let name_dash = Name.name_dash name in @@ -3310,24 +3291,21 @@ end = struct in Dune.V s_expr in - let warnings = + let disable_warnings = let disabled_by_default = [4; 40; 41; 42; 44; 45; 48; 70] in - let disabled_warnings = + let disabled_extra = match number with (* [Other] and [Alpha] protocols can be edited and should be fixed whenever a warning that we care about triggers. We only want to disable a limited set of warnings *) - | Other | Alpha -> disabled_by_default - (* [V _] protocols can't be edited to accommodate warnings, we need to disable warnings instead. *) + | Other | Alpha -> [] + (* [V _] protocols can't be edited to accomodate warnings, we need to disable warnings instead. *) | V _ as number -> - let disabled_extra = - if N.(number >= 014) then [] - else if N.(number >= 011) then [51] - else [6; 7; 9; 16; 29; 32; 51; 60; 67; 68] - in - disabled_by_default @ disabled_extra + if N.(number >= 014) then [] + else if N.(number >= 011) then [51] + else [6; 7; 9; 16; 29; 32; 51; 60; 67; 68] in - disabled_warnings_to_string disabled_warnings + disabled_by_default @ disabled_extra in let environment = public_lib @@ -3366,7 +3344,12 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end ~opam:(sf "tezos-protocol-%s" name_dash) ~linkall:true ~modules:tezos_protocol.modules - ~flags:(Flags.standard ~nopervasives:true ~nostdlib:true ~warnings ()) + ~flags: + (Flags.standard + ~nopervasives:true + ~nostdlib:true + ~disable_warnings + ()) ~deps:[environment |> open_ ~m:"Environment"] ~opens:["Pervasives"; "Error_monad"] in @@ -3387,7 +3370,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end name_underscore | Alpha | V _ -> "Tezos/Protocol: economic-protocol definition") ~modules:["Protocol"] - ~flags:(Flags.standard ~nopervasives:true ~warnings ()) + ~flags:(Flags.standard ~nopervasives:true ~disable_warnings ()) ~deps: [ tezos_protocol_environment; @@ -3463,7 +3446,7 @@ include Tezos_raw_protocol_%s.Main (* The instrumentation is removed as it can lead to a stack overflow *) (* https://gitlab.com/tezos/tezos/-/issues/1927 *) ~bisect_ppx:false - ~flags:(Flags.standard ~nopervasives:true ~warnings ()) + ~flags:(Flags.standard ~nopervasives:true ~disable_warnings ()) ~opam_only_deps:[tezos_protocol_compiler_tezos_protocol_packer] ~deps: [ @@ -3516,7 +3499,7 @@ include Tezos_raw_protocol_%s.Main `tezos-node`") ~modules:["Registerer"] ~linkall:true - ~flags:(Flags.standard ~warnings ()) + ~flags:(Flags.standard ~disable_warnings ()) ~deps:[main; tezos_protocol_updater; tezos_protocol_environment] ~dune: Dune. diff --git a/manifest/manifest.ml b/manifest/manifest.ml index 1e94bc58d192..bc9b092f2445 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -723,15 +723,37 @@ module Flags = struct let if_true b name = if b then Dune.S name else Dune.E - let if_some o name = match o with None -> Dune.E | Some x -> H [S name; S x] + let disable_warnings_to_string ws = + let int_ranges l = + List.sort_uniq compare l + |> List.fold_left + (fun acc x -> + match acc with + | [] -> [(x, x)] + | (l, u) :: acc when succ u = x -> (l, x) :: acc + | _ -> (x, x) :: acc) + [] + |> List.rev + in + let range_to_flag (x, y) = + if x = y then Printf.sprintf "-%d" x + else if x + 1 = y then Printf.sprintf "-%d-%d" x y + else Printf.sprintf "-%d..%d" x y + in + List.map range_to_flag (int_ranges ws) |> String.concat "" - let standard ?(nopervasives = false) ?(nostdlib = false) ?(opaque = false) - ?warnings () = + let standard ?disable_warnings ?(nopervasives = false) ?(nostdlib = false) + ?(opaque = false) () = { standard = true; rest = [ - if_some warnings "-w"; + (match disable_warnings with + | None | Some Stdlib.List.[] -> E + | Some l -> + if List.exists (fun x -> x <= 0) l then + invalid_arg "Warning number must be positive" ; + H [S "-w"; S (disable_warnings_to_string l)]); if_true nostdlib "-nostdlib"; if_true nopervasives "-nopervasives"; if_true opaque "-opaque"; diff --git a/manifest/manifest.mli b/manifest/manifest.mli index 3523fbe1b9f0..2de00cfa22f7 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -462,19 +462,19 @@ module Flags : sig (** Extend standard flags with custom ones. + - [disable_warnings]: disable additional warnings + - [nopervasives]: if [true], add [-nopervasives] to the list of flags. - [nostdlib]: if [true], add [-nostdlib] to the list of flags. - [opaque]: if [true], add [-opaque] to the list of flags. - - - [warnings]: the argument passed to the -w flag when building. *) val standard : + ?disable_warnings:int list -> ?nopervasives:bool -> ?nostdlib:bool -> ?opaque:bool -> - ?warnings:string -> unit -> t -- GitLab From d0dec4e63e418c2aa282346f49e4f3402187c1c6 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 15 Jun 2022 12:38:00 +0200 Subject: [PATCH 3/4] Build: do no re-disabled flags disabled by default --- manifest/main.ml | 24 ++++++++++-------------- src/proto_000_Ps9mPmXa/lib_protocol/dune | 8 ++++---- src/proto_001_PtCJ7pwo/lib_protocol/dune | 8 ++++---- src/proto_002_PsYLVpVv/lib_protocol/dune | 8 ++++---- src/proto_003_PsddFKi3/lib_protocol/dune | 8 ++++---- src/proto_004_Pt24m4xi/lib_protocol/dune | 8 ++++---- src/proto_005_PsBABY5H/lib_protocol/dune | 8 ++++---- src/proto_005_PsBabyM1/lib_protocol/dune | 8 ++++---- src/proto_006_PsCARTHA/lib_protocol/dune | 8 ++++---- src/proto_007_PsDELPH1/lib_protocol/dune | 8 ++++---- src/proto_008_PtEdo2Zk/lib_protocol/dune | 8 ++++---- src/proto_008_PtEdoTez/lib_protocol/dune | 8 ++++---- src/proto_009_PsFLoren/lib_protocol/dune | 8 ++++---- src/proto_010_PtGRANAD/lib_protocol/dune | 8 ++++---- src/proto_011_PtHangz2/lib_protocol/dune | 8 ++++---- src/proto_012_Psithaca/lib_protocol/dune | 8 ++++---- src/proto_013_PtJakart/lib_protocol/dune | 8 ++++---- src/proto_alpha/lib_protocol/dune | 6 +----- src/proto_demo_counter/lib_protocol/dune | 6 +----- src/proto_demo_noops/lib_protocol/dune | 6 +----- src/proto_genesis/lib_protocol/dune | 6 +----- 21 files changed, 78 insertions(+), 98 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 02b94b4c94ef..6cef99aa04db 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -3292,20 +3292,16 @@ end = struct Dune.V s_expr in let disable_warnings = - let disabled_by_default = [4; 40; 41; 42; 44; 45; 48; 70] in - let disabled_extra = - match number with - (* [Other] and [Alpha] protocols can be edited and should be - fixed whenever a warning that we care about triggers. We - only want to disable a limited set of warnings *) - | Other | Alpha -> [] - (* [V _] protocols can't be edited to accomodate warnings, we need to disable warnings instead. *) - | V _ as number -> - if N.(number >= 014) then [] - else if N.(number >= 011) then [51] - else [6; 7; 9; 16; 29; 32; 51; 60; 67; 68] - in - disabled_by_default @ disabled_extra + match number with + (* [Other] and [Alpha] protocols can be edited and should be + fixed whenever a warning that we care about triggers. We + only want to disable a limited set of warnings *) + | Other | Alpha -> [] + (* [V _] protocols can't be edited to accomodate warnings, we need to disable warnings instead. *) + | V _ as number -> + if N.(number >= 014) then [] + else if N.(number >= 011) then [51] + else [6; 7; 9; 16; 29; 32; 51; 60; 67; 68] in let environment = public_lib diff --git a/src/proto_000_Ps9mPmXa/lib_protocol/dune b/src/proto_000_Ps9mPmXa/lib_protocol/dune index c6a7f2c73000..e8aa538f2a6d 100644 --- a/src/proto_000_Ps9mPmXa/lib_protocol/dune +++ b/src/proto_000_Ps9mPmXa/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_000_Ps9mPmXa.Environment @@ -44,7 +44,7 @@ tezos-protocol-000-Ps9mPmXa.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -78,7 +78,7 @@ tezos-protocol-000-Ps9mPmXa.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -105,7 +105,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_001_PtCJ7pwo/lib_protocol/dune b/src/proto_001_PtCJ7pwo/lib_protocol/dune index b3d86aab3f44..db6cb1a285aa 100644 --- a/src/proto_001_PtCJ7pwo/lib_protocol/dune +++ b/src/proto_001_PtCJ7pwo/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_001_PtCJ7pwo.Environment @@ -111,7 +111,7 @@ tezos-protocol-001-PtCJ7pwo.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -276,7 +276,7 @@ tezos-protocol-001-PtCJ7pwo.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -368,7 +368,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_002_PsYLVpVv/lib_protocol/dune b/src/proto_002_PsYLVpVv/lib_protocol/dune index 6af64260f12a..0f6105b4d5ab 100644 --- a/src/proto_002_PsYLVpVv/lib_protocol/dune +++ b/src/proto_002_PsYLVpVv/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_002_PsYLVpVv.Environment @@ -111,7 +111,7 @@ tezos-protocol-002-PsYLVpVv.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -276,7 +276,7 @@ tezos-protocol-002-PsYLVpVv.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -368,7 +368,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_003_PsddFKi3/lib_protocol/dune b/src/proto_003_PsddFKi3/lib_protocol/dune index 5f4708ff5a53..9d219b0abbb7 100644 --- a/src/proto_003_PsddFKi3/lib_protocol/dune +++ b/src/proto_003_PsddFKi3/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_003_PsddFKi3.Environment @@ -112,7 +112,7 @@ tezos-protocol-003-PsddFKi3.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -279,7 +279,7 @@ tezos-protocol-003-PsddFKi3.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -372,7 +372,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_004_Pt24m4xi/lib_protocol/dune b/src/proto_004_Pt24m4xi/lib_protocol/dune index 9627ca57225b..e7e22d0ce8e7 100644 --- a/src/proto_004_Pt24m4xi/lib_protocol/dune +++ b/src/proto_004_Pt24m4xi/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_004_Pt24m4xi.Environment @@ -112,7 +112,7 @@ tezos-protocol-004-Pt24m4xi.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -279,7 +279,7 @@ tezos-protocol-004-Pt24m4xi.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -372,7 +372,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_005_PsBABY5H/lib_protocol/dune b/src/proto_005_PsBABY5H/lib_protocol/dune index a3a3d7e5ece3..29215af4ef80 100644 --- a/src/proto_005_PsBABY5H/lib_protocol/dune +++ b/src/proto_005_PsBABY5H/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_005_PsBABY5H.Environment @@ -113,7 +113,7 @@ tezos-protocol-005-PsBABY5H.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -282,7 +282,7 @@ tezos-protocol-005-PsBABY5H.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -376,7 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_005_PsBabyM1/lib_protocol/dune b/src/proto_005_PsBabyM1/lib_protocol/dune index b03f34b107bf..7f45cb4b9b4b 100644 --- a/src/proto_005_PsBabyM1/lib_protocol/dune +++ b/src/proto_005_PsBabyM1/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_005_PsBabyM1.Environment @@ -113,7 +113,7 @@ tezos-protocol-005-PsBabyM1.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -282,7 +282,7 @@ tezos-protocol-005-PsBabyM1.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -376,7 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_006_PsCARTHA/lib_protocol/dune b/src/proto_006_PsCARTHA/lib_protocol/dune index a3acee099c6f..cb8fd82bb8c8 100644 --- a/src/proto_006_PsCARTHA/lib_protocol/dune +++ b/src/proto_006_PsCARTHA/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_006_PsCARTHA.Environment @@ -113,7 +113,7 @@ tezos-protocol-006-PsCARTHA.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -282,7 +282,7 @@ tezos-protocol-006-PsCARTHA.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -376,7 +376,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_007_PsDELPH1/lib_protocol/dune b/src/proto_007_PsDELPH1/lib_protocol/dune index 6dea11de7dd5..dbedcc9f621d 100644 --- a/src/proto_007_PsDELPH1/lib_protocol/dune +++ b/src/proto_007_PsDELPH1/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_007_PsDELPH1.Environment @@ -115,7 +115,7 @@ tezos-protocol-007-PsDELPH1.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -288,7 +288,7 @@ tezos-protocol-007-PsDELPH1.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -384,7 +384,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_008_PtEdo2Zk/lib_protocol/dune b/src/proto_008_PtEdo2Zk/lib_protocol/dune index bcaa10903493..4c03e1a4d0a6 100644 --- a/src/proto_008_PtEdo2Zk/lib_protocol/dune +++ b/src/proto_008_PtEdo2Zk/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_008_PtEdo2Zk.Environment @@ -120,7 +120,7 @@ tezos-protocol-008-PtEdo2Zk.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -303,7 +303,7 @@ tezos-protocol-008-PtEdo2Zk.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -404,7 +404,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_008_PtEdoTez/lib_protocol/dune b/src/proto_008_PtEdoTez/lib_protocol/dune index e0a93d880471..fb4a6d5a0aa6 100644 --- a/src/proto_008_PtEdoTez/lib_protocol/dune +++ b/src/proto_008_PtEdoTez/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_008_PtEdoTez.Environment @@ -120,7 +120,7 @@ tezos-protocol-008-PtEdoTez.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -303,7 +303,7 @@ tezos-protocol-008-PtEdoTez.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -404,7 +404,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_009_PsFLoren/lib_protocol/dune b/src/proto_009_PsFLoren/lib_protocol/dune index ea24187a28f9..cf8c3e9eea13 100644 --- a/src/proto_009_PsFLoren/lib_protocol/dune +++ b/src/proto_009_PsFLoren/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_009_PsFLoren.Environment @@ -123,7 +123,7 @@ tezos-protocol-009-PsFLoren.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -312,7 +312,7 @@ tezos-protocol-009-PsFLoren.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -416,7 +416,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_010_PtGRANAD/lib_protocol/dune b/src/proto_010_PtGRANAD/lib_protocol/dune index 10445a7520a4..f99566fd1f10 100644 --- a/src/proto_010_PtGRANAD/lib_protocol/dune +++ b/src/proto_010_PtGRANAD/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nostdlib -nopervasives -open Tezos_protocol_environment_010_PtGRANAD.Environment @@ -128,7 +128,7 @@ tezos-protocol-010-PtGRANAD.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Protocol)) @@ -327,7 +327,7 @@ tezos-protocol-010-PtGRANAD.raw) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70 + -w -6-7-9-16-29-32-51-60-67-68 -nopervasives) (modules Functor)) @@ -436,7 +436,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-6-7-9-16-29-32-40..42-44-45-48-51-60-67-68-70) + -w -6-7-9-16-29-32-51-60-67-68) (modules Registerer)) (rule diff --git a/src/proto_011_PtHangz2/lib_protocol/dune b/src/proto_011_PtHangz2/lib_protocol/dune index 9fedea559911..8aa83538d569 100644 --- a/src/proto_011_PtHangz2/lib_protocol/dune +++ b/src/proto_011_PtHangz2/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nostdlib -nopervasives -open Tezos_protocol_environment_011_PtHangz2.Environment @@ -141,7 +141,7 @@ tezos-protocol-011-PtHangz2.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Protocol)) @@ -366,7 +366,7 @@ tezos-protocol-011-PtHangz2.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Functor)) @@ -488,7 +488,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70) + -w -51) (modules Registerer)) (rule diff --git a/src/proto_012_Psithaca/lib_protocol/dune b/src/proto_012_Psithaca/lib_protocol/dune index 6606eca7b4b3..0ad6bd4c9d1b 100644 --- a/src/proto_012_Psithaca/lib_protocol/dune +++ b/src/proto_012_Psithaca/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nostdlib -nopervasives -open Tezos_protocol_environment_012_Psithaca.Environment @@ -158,7 +158,7 @@ tezos-protocol-012-Psithaca.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Protocol)) @@ -417,7 +417,7 @@ tezos-protocol-012-Psithaca.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Functor)) @@ -556,7 +556,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70) + -w -51) (modules Registerer)) (rule diff --git a/src/proto_013_PtJakart/lib_protocol/dune b/src/proto_013_PtJakart/lib_protocol/dune index 52307ad32400..b7b598c60bf7 100644 --- a/src/proto_013_PtJakart/lib_protocol/dune +++ b/src/proto_013_PtJakart/lib_protocol/dune @@ -26,7 +26,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nostdlib -nopervasives -open Tezos_protocol_environment_013_PtJakart.Environment @@ -223,7 +223,7 @@ tezos-protocol-013-PtJakart.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Protocol)) @@ -614,7 +614,7 @@ tezos-protocol-013-PtJakart.raw) (flags (:standard) - -w -4-40..42-44-45-48-51-70 + -w -51 -nopervasives) (modules Functor)) @@ -819,7 +819,7 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-51-70) + -w -51) (modules Registerer)) (rule diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index 1affedea66f5..8c576376f363 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -26,7 +26,6 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_alpha.Environment @@ -242,7 +241,6 @@ tezos-protocol-alpha.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -673,7 +671,6 @@ tezos-protocol-alpha.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -897,8 +894,7 @@ tezos-protocol-environment) (library_flags (:standard -linkall)) (flags - (:standard) - -w -4-40..42-44-45-48-70) + (:standard)) (modules Registerer)) (rule diff --git a/src/proto_demo_counter/lib_protocol/dune b/src/proto_demo_counter/lib_protocol/dune index 52e490266ea4..ec7e0644c66f 100644 --- a/src/proto_demo_counter/lib_protocol/dune +++ b/src/proto_demo_counter/lib_protocol/dune @@ -26,7 +26,6 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_demo_counter.Environment @@ -53,7 +52,6 @@ tezos-protocol-demo-counter.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -102,7 +100,6 @@ tezos-protocol-demo-counter.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -135,8 +132,7 @@ tezos-protocol-environment) (library_flags (:standard -linkall)) (flags - (:standard) - -w -4-40..42-44-45-48-70) + (:standard)) (modules Registerer)) (rule diff --git a/src/proto_demo_noops/lib_protocol/dune b/src/proto_demo_noops/lib_protocol/dune index 0b965348e28a..d6977e7c4b0e 100644 --- a/src/proto_demo_noops/lib_protocol/dune +++ b/src/proto_demo_noops/lib_protocol/dune @@ -26,7 +26,6 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_demo_noops.Environment @@ -44,7 +43,6 @@ tezos-protocol-demo-noops.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -74,7 +72,6 @@ tezos-protocol-demo-noops.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -98,8 +95,7 @@ tezos-protocol-environment) (library_flags (:standard -linkall)) (flags - (:standard) - -w -4-40..42-44-45-48-70) + (:standard)) (modules Registerer)) (rule diff --git a/src/proto_genesis/lib_protocol/dune b/src/proto_genesis/lib_protocol/dune index 53a51e666466..998585e482ca 100644 --- a/src/proto_genesis/lib_protocol/dune +++ b/src/proto_genesis/lib_protocol/dune @@ -26,7 +26,6 @@ (library_flags (:standard -linkall)) (flags (:standard) - -w -4-40..42-44-45-48-70 -nostdlib -nopervasives -open Tezos_protocol_environment_genesis.Environment @@ -44,7 +43,6 @@ tezos-protocol-genesis.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Protocol)) @@ -78,7 +76,6 @@ tezos-protocol-genesis.raw) (flags (:standard) - -w -4-40..42-44-45-48-70 -nopervasives) (modules Functor)) @@ -104,8 +101,7 @@ tezos-protocol-environment) (library_flags (:standard -linkall)) (flags - (:standard) - -w -4-40..42-44-45-48-70) + (:standard)) (modules Registerer)) (rule -- GitLab From 557c560ff2bd000888d9ebcb9600db6bfad594ab Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 15 Jun 2022 15:55:03 +0200 Subject: [PATCH 4/4] Manifest: do not generate standalone :standard flag stanza --- manifest/manifest.ml | 28 +++++++++++++----------- src/proto_alpha/lib_protocol/dune | 2 -- src/proto_demo_counter/lib_protocol/dune | 2 -- src/proto_demo_noops/lib_protocol/dune | 2 -- src/proto_genesis/lib_protocol/dune | 2 -- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/manifest/manifest.ml b/manifest/manifest.ml index bc9b092f2445..32a64b6095b8 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -721,7 +721,7 @@ end module Flags = struct type t = {standard : bool; rest : Dune.s_expr list} - let if_true b name = if b then Dune.S name else Dune.E + let if_true b name = if b then Some (Dune.S name) else None let disable_warnings_to_string ws = let int_ranges l = @@ -747,17 +747,19 @@ module Flags = struct { standard = true; rest = - [ - (match disable_warnings with - | None | Some Stdlib.List.[] -> E - | Some l -> - if List.exists (fun x -> x <= 0) l then - invalid_arg "Warning number must be positive" ; - H [S "-w"; S (disable_warnings_to_string l)]); - if_true nostdlib "-nostdlib"; - if_true nopervasives "-nopervasives"; - if_true opaque "-opaque"; - ]; + List.filter_map + (fun x -> x) + [ + (match disable_warnings with + | None | Some Stdlib.List.[] -> None + | Some l -> + if List.exists (fun x -> x <= 0) l then + invalid_arg "Warning number must be positive" ; + Some Dune.(H [S "-w"; S (disable_warnings_to_string l)])); + if_true nostdlib "-nostdlib"; + if_true nopervasives "-nopervasives"; + if_true opaque "-opaque"; + ]; } let include_ f = {standard = false; rest = Dune.[S ":include"; S f]} @@ -1725,7 +1727,7 @@ let generate_dune (internal : Target.internal) = in let flags = match (internal.flags, open_flags) with - | None, [] -> None + | None, [] | Some {standard = true; rest = []}, [] -> None | flags, _ -> let flags = match flags with None -> Flags.standard () | Some flags -> flags diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index 8c576376f363..2fbd4b52fc8e 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -893,8 +893,6 @@ tezos-protocol-updater tezos-protocol-environment) (library_flags (:standard -linkall)) - (flags - (:standard)) (modules Registerer)) (rule diff --git a/src/proto_demo_counter/lib_protocol/dune b/src/proto_demo_counter/lib_protocol/dune index ec7e0644c66f..b363b6cd444f 100644 --- a/src/proto_demo_counter/lib_protocol/dune +++ b/src/proto_demo_counter/lib_protocol/dune @@ -131,8 +131,6 @@ tezos-protocol-updater tezos-protocol-environment) (library_flags (:standard -linkall)) - (flags - (:standard)) (modules Registerer)) (rule diff --git a/src/proto_demo_noops/lib_protocol/dune b/src/proto_demo_noops/lib_protocol/dune index d6977e7c4b0e..025f7be86221 100644 --- a/src/proto_demo_noops/lib_protocol/dune +++ b/src/proto_demo_noops/lib_protocol/dune @@ -94,8 +94,6 @@ tezos-protocol-updater tezos-protocol-environment) (library_flags (:standard -linkall)) - (flags - (:standard)) (modules Registerer)) (rule diff --git a/src/proto_genesis/lib_protocol/dune b/src/proto_genesis/lib_protocol/dune index 998585e482ca..fda7cba3820d 100644 --- a/src/proto_genesis/lib_protocol/dune +++ b/src/proto_genesis/lib_protocol/dune @@ -100,8 +100,6 @@ tezos-protocol-updater tezos-protocol-environment) (library_flags (:standard -linkall)) - (flags - (:standard)) (modules Registerer)) (rule -- GitLab