Skip to content

Commit

Permalink
fix: pass -w -53 in wrapped_compat modules (#10699)
Browse files Browse the repository at this point in the history
On OCaml 5.2, this feature triggers warning 53, which is justified.

Quoting @nojb:

> Dune first builds bar.cmi and bar.cmo from bar.ml-gen and this part
> works well (bar.ml-gen contains a top-level attribute but no .cmi).
> However, when it is the turn of the native-code compiler, bar.cmi
> already exists (and contains the expected deprecation attribute), so the
> top-level attribute in Bar.ml-gen is correctly ignored by the compiler,
> hence the warning.

Fixes #10689

Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon authored Jul 8, 2024
1 parent 2d3d1dc commit 7c423c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dune_rules/compilation_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ let for_module_generated_at_link_time cctx ~requires ~module_ =
}
;;

let for_wrapped_compat t = { t with includes = Includes.empty; stdlib = None }
let for_wrapped_compat t =
(* See #10689 *)
let flags = Ocaml_flags.append_common t.flags [ "-w"; "-53" ] in
{ t with includes = Includes.empty; stdlib = None; flags }
;;

let for_plugin_executable t ~embed_in_plugin_libraries =
let libs = Scope.libs t.scope in
Expand Down

0 comments on commit 7c423c5

Please sign in to comment.