GNU bug report logs - #63947
Bug when building ocaml-dune-build-info for ocaml5.0

Previous Next

Package: guix;

Reported by: "Benjamin" <benjamin <at> uvy.fr>

Date: Wed, 7 Jun 2023 15:56:01 UTC

Severity: normal

To reply to this bug, email your comments to 63947 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#63947; Package guix. (Wed, 07 Jun 2023 15:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Benjamin" <benjamin <at> uvy.fr>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 07 Jun 2023 15:56:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Benjamin" <benjamin <at> uvy.fr>
To: <bug-guix <at> gnu.org>
Cc: pukkamustard <pukkamustard <at> posteo.net>,
 Julien Lepiller <julien <at> lepiller.eu>
Subject: Bug when building ocaml-dune-build-info for ocaml5.0
Date: Wed, 07 Jun 2023 17:55:21 +0200
Hello,

While trying to work with guix and add the ocaml-lsp-server for
ocaml <at> 5.0 I think I faced a bug.

I did not find the root cause, but I think this is due to the fact of
using a combination of (inherit) and (package-with-ocaml5.0).

Here is a minimal example to reproduce the bug :

---
(use-modules
  (gnu packages ocaml)
  (guix build-system ocaml))

;ocaml-dune-build-info
(package-with-ocaml5.0 ocaml-dune-build-info)
---

Building the commented default version will create the expected package
in /gnu/store/...ocaml-dune-build-info

While building the ocaml5.0 version will build /gnu/store/...ocaml5.0-dune

I do not exactly know in which direction I should search to fix this
issue but there might be a bug in "package-with-ocaml5.0" function

Is this really a bug ? Or I did not use properly the
package-withocaml5.0 function.

Thanks

Benjamin




Information forwarded to bug-guix <at> gnu.org:
bug#63947; Package guix. (Thu, 08 Jun 2023 07:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 63947 <at> debbugs.gnu.org (full text, mbox):

From: "Benjamin" <benjamin <at> uvy.fr>
To: <63947 <at> debbugs.gnu.org>
Subject: Re: Bug when building ocaml-dune-build-info for ocaml5.0
Date: Thu, 08 Jun 2023 09:26:07 +0200
After digging a bit more, I could fix this issue by modifying the
definition of ocaml-dune-build-info with this patch.

The problem might have come from the non standard definition  of dune
package using properties only.


diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index f0b8f9e912..40a820b90e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -9538,7 +9538,7 @@ (define-public ocaml-fix

 (define-public ocaml-dune-build-info
   (package
-    (inherit dune)
+    (inherit dune-bootstrap)
     (name "ocaml-dune-build-info")
     (build-system dune-build-system)
     (arguments





Information forwarded to bug-guix <at> gnu.org:
bug#63947; Package guix. (Tue, 13 Jun 2023 06:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 63947 <at> debbugs.gnu.org (full text, mbox):

From: pukkamustard <pukkamustard <at> posteo.net>
To: Benjamin <benjamin <at> uvy.fr>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 63947 <at> debbugs.gnu.org
Subject: Re: Bug when building ocaml-dune-build-info for ocaml5.0
Date: Tue, 13 Jun 2023 05:08:11 +0000
[Message part 1 (text/plain, inline)]
Hi Benjamin,

Thanks for the report.

"Benjamin" <benjamin <at> uvy.fr> writes:

> Here is a minimal example to reproduce the bug :
>
> ---
> (use-modules
>   (gnu packages ocaml)
>   (guix build-system ocaml))
>
> ;ocaml-dune-build-info
> (package-with-ocaml5.0 ocaml-dune-build-info)
> ---
>
> Building the commented default version will create the expected package
> in /gnu/store/...ocaml-dune-build-info
>
> While building the ocaml5.0 version will build /gnu/store/...ocaml5.0-dune

Yes, this is a bug.

The reason is that the `(inherit dune)` in ocaml-dune-build-info
incorrectly inherits the package variant properties from dune. The OCaml
5.0 variant for ocaml-dune-build-info becomes ocaml5.0-dune.

I think the best way to fix this is to clear the package variant
properties in ocaml-dune-build-info by resetting the properties. Find
attached a patch that does exactly that. CC: Julien for review.

Your fix to inherit from `dune-bootstrap` has a similar effect as the
package variants are defined in `dune` but not `dune-bootstrap`. I
slightly prefer not inheriting from `dune-bootstrap` as it reduces
things that directly touch bootstrap stuff.

-pukkamustard

[0001-gnu-ocaml-dune-build-info-Clear-ocaml-variant-proper.patch (text/x-patch, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#63947; Package guix. (Tue, 13 Jun 2023 06:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 63947 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>, Benjamin <benjamin <at> uvy.fr>
Cc: 63947 <at> debbugs.gnu.org
Subject: Re: Bug when building ocaml-dune-build-info for ocaml5.0
Date: Tue, 13 Jun 2023 08:36:22 +0200
Untested yet, but looks fine, thanks

Le 13 juin 2023 07:08:11 GMT+02:00, pukkamustard <pukkamustard <at> posteo.net> a écrit :
>
>Hi Benjamin,
>
>Thanks for the report.
>
>"Benjamin" <benjamin <at> uvy.fr> writes:
>
>> Here is a minimal example to reproduce the bug :
>>
>> ---
>> (use-modules
>>   (gnu packages ocaml)
>>   (guix build-system ocaml))
>>
>> ;ocaml-dune-build-info
>> (package-with-ocaml5.0 ocaml-dune-build-info)
>> ---
>>
>> Building the commented default version will create the expected package
>> in /gnu/store/...ocaml-dune-build-info
>>
>> While building the ocaml5.0 version will build /gnu/store/...ocaml5.0-dune
>
>Yes, this is a bug.
>
>The reason is that the `(inherit dune)` in ocaml-dune-build-info
>incorrectly inherits the package variant properties from dune. The OCaml
>5.0 variant for ocaml-dune-build-info becomes ocaml5.0-dune.
>
>I think the best way to fix this is to clear the package variant
>properties in ocaml-dune-build-info by resetting the properties. Find
>attached a patch that does exactly that. CC: Julien for review.
>
>Your fix to inherit from `dune-bootstrap` has a similar effect as the
>package variants are defined in `dune` but not `dune-bootstrap`. I
>slightly prefer not inheriting from `dune-bootstrap` as it reduces
>things that directly touch bootstrap stuff.
>
>-pukkamustard
>




This bug report was last modified 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.