Subject: Re: [PATCH gnome-team 1/1] gnu: opam: Fix build.

From: Maxim Cournoyer <[email-masked]>
Date: Sat, 09 Mar 2024 13:18:55 -0500

Hi Vivien,

Vivien Kraus <[email-masked]> writes:

> * gnu/packages/ocaml.scm (ocaml-opam-core) [#:phases]: Add 'always-use-base64-compat-5'.

[...]

>  gnu/packages/ocaml.scm | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
> index 0f4c351141..5051524a53 100644
> --- a/gnu/packages/ocaml.scm
> +++ b/gnu/packages/ocaml.scm
> @@ -854,6 +854,26 @@ (define ocaml-opam-core
>                   #:tests? #f
>                   #:phases
>                   (modify-phases %standard-phases
> +                   (add-after 'unpack 'always-use-base64-compat-5
> +                     (lambda _
> +                       (call-with-input-file "src/client/dune"
> +                         (lambda (port)
> +                           (display "ok")
> +                           (newline)))

Shouldn't this be 'call-with-output-file' ?  It seems you want to
*write* a file containing "ok\n".

> +                       ;; By default, the opamBase64Compat module will be
> +                       ;; compatibility version 6, which is just an empty
> +                       ;; file.  Opam-client cannot build with an
> empty file.

What does upstream say about this?  Is this a bug?  Or some understood
limitation they don't foresee fixing?

> +                       (substitute* "src/client/dune"
> +                         (("opamBase64Compat\\.ml\\.6")
> +                          "opamBase64Compat.ml.5")
> +                         (("opamBase64Compat\\.mli\\.6")
> +                          "opamBase64Compat.mli.5")
> +                         ;; Undo the change in the rule to generate the .6
> +                         ;; files
> +                         (("with-stdout-to opamBase64Compat\\.ml\\.5")
> +                          "with-stdout-to opamBase64Compat.ml.6")
> +                         (("with-stdout-to opamBase64Compat\\.mli\\.5")
> +                          "with-stdout-to opamBase64Compat.mli.6"))))

I'd like to hear about upstream.  Perhaps our package is simply buggy?
It'd be nice to have an upstream issue to link to.

-- 
Thanks,
Maxim