Subject: Re: [bug#44032] [PATCH] gnu: ocaml: Update to 4.11.1

From: Julien Lepiller <[email-masked]>
Date: Mon, 19 Oct 2020 11:14:32 -0400

Le 19 octobre 2020 10:24:23 GMT-04:00, zimoun <[email-masked]> a écrit :
>On Mon, 19 Oct 2020 at 16:11, Julien Lepiller <[email-masked]>
>wrote:
>
>> >> +(define-public ocaml4.09-csexp
>> >> +  (package
>> >> +    (inherit ocaml-csexp)
>> >> +    (name "ocaml4.09-csexp")
>> >> +    (arguments
>> >> +     `(#:ocaml ,ocaml-4.09
>> >> +       #:findlib ,ocaml4.09-findlib
>> >> +       ,@(substitute-keyword-arguments (package-arguments
>> >ocaml-csexp)
>> >> +           ((#:dune _) (package-with-ocaml4.09
>dune-bootstrap)))))
>> >> +    (propagated-inputs
>> >> +     `(("ocaml-result" ,(package-with-ocaml4.09
>ocaml-result))))))
>> >
>> >You do not use the one you define below.  Why?  Other said, do you
>> >really need 'ocaml4.09.result' defined below?
>>
>> Actually, the properties ensure that I actually use the one below :)
>
>I am not sure.  You are recreating a package based on 'ocaml-result'
>and not using the package 'ocaml4.09-result'.  Or I miss something
>about the symbols.

package-with-ocaml4.09 first reads the properties field of its arguments, and if it has an ocaml4.09-variant,it uses it. Otherwise it creates a new package that uses ocaml 4.09, ocaml4.09-findlib and ocaml4.09-dune.

If you remove the property in ocaml-result, you'll see that building (package-with-ocaml4.09 result) ends up in a loop: it wants ocaml4.09-dune, but is itself a dependency of ocaml4.09-dune.

>
>
>> >> +(define-public ocaml4.09-result
>> >> +  (package
>> >> +    (inherit ocaml-result)
>> >> +    (arguments
>> >> +     `(#:test-target "."
>> >> +       #:dune ,(package-with-ocaml4.09 dune-bootstrap)
>> >> +       #:ocaml ,ocaml-4.09
>> >> +       #:findlib ,ocaml4.09-findlib))))
>> >
>> >Since the name is not changed after inheritance, this package is
>> >ambiguous.  And possibly do not compile.
>>
>> Ah right, thanks!
>
>Moreover, my point is: you are using
>
> once:
>    (properties `((ocaml4.09-variant . ,(delay ocaml4.09-result))))
>and once:
>     `(("ocaml-result" ,(package-with-ocaml4.09 ocaml-result))))))
>
>and it seems easier to only use one form.  Other said, maybe you do
>not need the new 'ocaml4.09-result' and '(package-with-ocaml4.09
>ocaml-result)' is enough.

OK, I'll use the variant I define everywhere if it makes things easier to understand later.

>
>
>> >> -     `(#:phases
>> >> +     `(#:tests? #f; no tests
>> >
>> >Why?  Because the tests are run during the build?  If yes, does it
>make
>> >sense to move the comment there?
>>
>> No, the comment might have come from a previous version or just
>copied by mistake. There is really no test in this package (unless
>there's something weird going on with oasis scripts).
>
>Maybe reword the comment: "no test provided by the package"or
>something like that.
>
>
>All the best,
>simon