Subject: Re: Bug when building ocaml-dune-build-info for ocaml5.0

From: pukkamustard <[email-masked]>
Date: Tue, 13 Jun 2023 05:08:11 +0000

Hi Benjamin,

Thanks for the report.

"Benjamin" <[email-masked]> 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

>From e9286b8552c2c4bed4dd7ddab4ccfeaedb03406c Mon Sep 17 00:00:00 2001
Message-Id: <e928[email-masked]>
From: pukkamustard <[email-masked]>
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 <[email-masked]>.
---
 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