unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0
@ 2023-06-07 15:55 Benjamin
  2023-06-08  7:26 ` Benjamin
  2023-06-13  5:08 ` pukkamustard
  0 siblings, 2 replies; 4+ messages in thread
From: Benjamin @ 2023-06-07 15:55 UTC (permalink / raw)
  To: 63947; +Cc: pukkamustard, Julien Lepiller

Hello,

While trying to work with guix and add the ocaml-lsp-server for
ocaml@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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0
  2023-06-07 15:55 bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0 Benjamin
@ 2023-06-08  7:26 ` Benjamin
  2023-06-13  5:08 ` pukkamustard
  1 sibling, 0 replies; 4+ messages in thread
From: Benjamin @ 2023-06-08  7:26 UTC (permalink / raw)
  To: 63947

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





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0
  2023-06-07 15:55 bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0 Benjamin
  2023-06-08  7:26 ` Benjamin
@ 2023-06-13  5:08 ` pukkamustard
  2023-06-13  6:36   ` Julien Lepiller
  1 sibling, 1 reply; 4+ messages in thread
From: pukkamustard @ 2023-06-13  5:08 UTC (permalink / raw)
  To: Benjamin; +Cc: Julien Lepiller, 63947

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]


Hi Benjamin,

Thanks for the report.

"Benjamin" <benjamin@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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-ocaml-dune-build-info-Clear-ocaml-variant-proper.patch --]
[-- Type: text/x-patch, Size: 1142 bytes --]

From e9286b8552c2c4bed4dd7ddab4ccfeaedb03406c Mon Sep 17 00:00:00 2001
Message-Id: <e9286b8552c2c4bed4dd7ddab4ccfeaedb03406c.1686637070.git.pukkamustard@posteo.net>
From: pukkamustard <pukkamustard@posteo.net>
Date: Tue, 13 Jun 2023 08:13:48 +0200
Subject: [PATCH] gnu: ocaml-dune-build-info: Clear ocaml*-variant properties.

* gnu/packages/ocaml.scm (ocaml-dune-build-info): Clear properties.

Fixes <https://issues.guix.gnu.org/63947>.
Reported by Benjamin <benjamin@uvy.fr>.
---
 gnu/packages/ocaml.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index ab0aa0574a..06ef5796d9 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -9664,6 +9664,7 @@ (define-public ocaml-dune-build-info
        #:tests? #f))
     (propagated-inputs
      (list ocaml-odoc))
+    (properties '())
     (synopsis "Embed build information inside an executable")
     (description "This package allows one to access information about how the
 executable was built, such as the version of the project at which it was built

base-commit: 0433e7f3c200936fbf77f22aa3b433413d17d0fa
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0
  2023-06-13  5:08 ` pukkamustard
@ 2023-06-13  6:36   ` Julien Lepiller
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Lepiller @ 2023-06-13  6:36 UTC (permalink / raw)
  To: pukkamustard, Benjamin; +Cc: 63947

Untested yet, but looks fine, thanks

Le 13 juin 2023 07:08:11 GMT+02:00, pukkamustard <pukkamustard@posteo.net> a écrit :
>
>Hi Benjamin,
>
>Thanks for the report.
>
>"Benjamin" <benjamin@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
>




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-13 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-07 15:55 bug#63947: Bug when building ocaml-dune-build-info for ocaml5.0 Benjamin
2023-06-08  7:26 ` Benjamin
2023-06-13  5:08 ` pukkamustard
2023-06-13  6:36   ` Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).