[PATCH] tools/ocaml: silence ocaml_deprecated_auto_include alert

Guillaume Thouvenin posted 1 patch 3 days, 22 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/1780990616.8631fc262581453bbf619ec5b2062170.19eab5024a2000701b@vates.tech
tools/ocaml/common.make | 1 +
1 file changed, 1 insertion(+)
[PATCH] tools/ocaml: silence ocaml_deprecated_auto_include alert
Posted by Guillaume Thouvenin 3 days, 22 hours ago
Ocaml's lib directory layout changed in 5.0: the unix and dynlink
libraries have been moved out of the standard library directory into
subdirectories. The compiler still locates them automatically but emits
an ocaml_deprecated_auto_include alert when doing so.

This patch sets the paths explicitly with -I +unix and -I +dynlink to
silence the alert.

Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
---
 tools/ocaml/common.make | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index c7eefceeb4..0e6714e25a 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -11,6 +11,7 @@ OCAMLFIND ?= ocamlfind
 
 CFLAGS += -fPIC -I$(shell ocamlc -where)
 
+OCAMLINCLUDE += -I +unix -I +dynlink
 OCAMLOPTFLAGS = -g -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
 OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 
-- 
2.47.3



-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Re: [PATCH for-4.22] tools/ocaml: silence ocaml_deprecated_auto_include alert
Posted by Andrew Cooper 3 days, 21 hours ago
On 09/06/2026 8:36 am, Guillaume Thouvenin wrote:
> Ocaml's lib directory layout changed in 5.0: the unix and dynlink
> libraries have been moved out of the standard library directory into
> subdirectories. The compiler still locates them automatically but emits
> an ocaml_deprecated_auto_include alert when doing so.
>
> This patch sets the paths explicitly with -I +unix and -I +dynlink to
> silence the alert.
>
> Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
>  tools/ocaml/common.make | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
> index c7eefceeb4..0e6714e25a 100644
> --- a/tools/ocaml/common.make
> +++ b/tools/ocaml/common.make
> @@ -11,6 +11,7 @@ OCAMLFIND ?= ocamlfind
>  
>  CFLAGS += -fPIC -I$(shell ocamlc -where)
>  
> +OCAMLINCLUDE += -I +unix -I +dynlink
>  OCAMLOPTFLAGS = -g -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
>  OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
>  

CC Oleksii.

For 4.22.  This fixes a build warning with newer versions of Ocaml, and
also wants backporting to older trees.

~Andrew

Re: [PATCH for-4.22] tools/ocaml: silence ocaml_deprecated_auto_include alert
Posted by Oleksii Kurochko 3 days, 21 hours ago

On 6/9/26 10:24 AM, Andrew Cooper wrote:
> On 09/06/2026 8:36 am, Guillaume Thouvenin wrote:
>> Ocaml's lib directory layout changed in 5.0: the unix and dynlink
>> libraries have been moved out of the standard library directory into
>> subdirectories. The compiler still locates them automatically but emits
>> an ocaml_deprecated_auto_include alert when doing so.
>>
>> This patch sets the paths explicitly with -I +unix and -I +dynlink to
>> silence the alert.
>>
>> Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
>> ---
>>   tools/ocaml/common.make | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
>> index c7eefceeb4..0e6714e25a 100644
>> --- a/tools/ocaml/common.make
>> +++ b/tools/ocaml/common.make
>> @@ -11,6 +11,7 @@ OCAMLFIND ?= ocamlfind
>>   
>>   CFLAGS += -fPIC -I$(shell ocamlc -where)
>>   
>> +OCAMLINCLUDE += -I +unix -I +dynlink
>>   OCAMLOPTFLAGS = -g -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
>>   OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
>>   
> 
> CC Oleksii.
> 
> For 4.22.  This fixes a build warning with newer versions of Ocaml, and
> also wants backporting to older trees.

You just pinged me when I started to look at the patch.

It look okay for me to have in in 4.22:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii