File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,8 @@ Bug fixes:
208208 (Jacques Garrigue, report by Valentin Gatien-Baron)
209209- PR#6889: ast_mapper fails to rewrite class attributes
210210 (Sébastien Briais)
211+ - PR#6893: ocamlbuild: "tag not used" warning when using (p)dep
212+ (Gabriel Scherer, report by Christiano Haesbaert)
211213- GPR#143: fix getsockopt behaviour for boolean socket options
212214 (Anil Madhavapeddy and Andrew Ray)
213215- GPR#190: typo in pervasives
Original file line number Diff line number Diff line change @@ -393,6 +393,9 @@ let pdep tags ptag deps =
393393 Param_tags. declare ptag
394394 (fun param -> dep (Param_tags. make ptag param :: tags) (deps param))
395395
396+ let list_all_deps () =
397+ ! all_deps_of_tags
398+
396399(*
397400let to_string_for_digest x =
398401 let rec cmd_of_spec =
Original file line number Diff line number Diff line change @@ -46,4 +46,6 @@ val dep : Tags.elt list -> pathname list -> unit
4646
4747val pdep : Tags .elt list -> Tags .elt -> (string -> pathname list ) -> unit
4848
49+ val list_all_deps : unit -> (Tags .t * pathname list ) list
50+
4951val file_or_exe_exists : string -> bool
Original file line number Diff line number Diff line change @@ -81,10 +81,11 @@ let tag_any tags =
8181let check_tags_usage useful_tags =
8282 let check_tag (tag , loc ) =
8383 if not (Tags. mem tag useful_tags) then
84- Log. eprintf " %aWarning: the tag %S is not used in any flag declaration, \
85- so it will have no effect; it may be a typo. Otherwise use \
86- `mark_tag_used` in your myocamlbuild.ml to disable \
87- this warning."
84+
85+ Log. eprintf " %aWarning: the tag %S is not used in any flag or dependency \
86+ declaration, so it will have no effect; it may be a typo. \
87+ Otherwise you can use `mark_tag_used` in your myocamlbuild.ml \
88+ to disable this warning."
8889 Loc. print_loc loc tag
8990 in
9091 let check_conf (_ , values ) =
Original file line number Diff line number Diff line change @@ -205,7 +205,14 @@ let proceed () =
205205 raise Exit_silently
206206 end ;
207207
208- let all_tags = Tags. union builtin_useful_tags (Flags. get_used_tags () ) in
208+ let all_tags =
209+ let builtin = builtin_useful_tags in
210+ let used_in_flags = Flags. get_used_tags () in
211+ let used_in_deps =
212+ List. fold_left (fun acc (tags , _deps ) -> Tags. union acc tags)
213+ Tags. empty (Command. list_all_deps () )
214+ in
215+ Tags. union builtin (Tags. union used_in_flags used_in_deps) in
209216 Configuration. check_tags_usage all_tags;
210217
211218 Digest_cache. init () ;
You can’t perform that action at this time.
0 commit comments