GNU bug report logs - #49868
[PATCH 0/2] guix: dune-build-system: Add a profile parameter.

Previous Next

Package: guix-patches;

Reported by: pukkamustard <pukkamustard <at> posteo.net>

Date: Wed, 4 Aug 2021 08:05:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49868 in the body.
You can then email your comments to 49868 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Wed, 04 Aug 2021 08:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to pukkamustard <pukkamustard <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 04 Aug 2021 08:05:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: pukkamustard <pukkamustard <at> posteo.net>
Subject: [PATCH 0/2] guix: dune-build-system: Add a profile parameter.
Date: Wed,  4 Aug 2021 08:04:23 +0000
Hi,

This adds a profile parameter to the dune-build-system and sets it to "release" by default.

The exact effects of the "release" profile are not clearly documented in dune [1]. But it seems to be the default when installing packages with OPAM [2]. I think it should also be the default in Guix.

Some OCaml packages had set the profile to "release" manually by specifiying it in the build flags. This has been removed.

This patch will probably require a rebuild of almost all OCaml packages.

A second patch is attached that removes unnecessary arguments from the ocaml4.07-base packages. This is a more intrusive change to the package, so I've kept it in a separate commit.

-pukkamustard

[1] https://github.com/ocaml/dune/issues/3359
[2] https://dune.readthedocs.io/en/stable/faq.html#how-to-make-warnings-non-fatal

pukkamustard (2):
  guix: dune-build-system: Add a profile parameter.
  gnu: ocaml4.07-base: Remove unnecessary arguments.

 doc/guix.texi                    |  7 +++++++
 gnu/packages/ocaml.scm           | 27 ++++++---------------------
 guix/build-system/dune.scm       |  3 +++
 guix/build/dune-build-system.scm |  8 ++++++--
 4 files changed, 22 insertions(+), 23 deletions(-)

-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Wed, 04 Aug 2021 08:09:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: 49868 <at> debbugs.gnu.org
Cc: pukkamustard <pukkamustard <at> posteo.net>
Subject: [PATCH 1/2] guix: dune-build-system: Add a profile parameter.
Date: Wed,  4 Aug 2021 08:08:29 +0000
* guix/build-system/dune.scm: Add a profile parameter.
* guix/build/dune-build-system.scm (build): Use it.
* doc/guix.texi: Document it.
* gnu/packages/ocaml.scm: Remove profile being set from build flags.
---
 doc/guix.texi                    |  7 +++++++
 gnu/packages/ocaml.scm           | 17 ++++++-----------
 guix/build-system/dune.scm       |  3 +++
 guix/build/dune-build-system.scm |  8 ++++++--
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 9a9c85678c..2ba2edeb72 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -94,6 +94,7 @@ Copyright @copyright{} 2021 Xinglu Chen@*
 Copyright @copyright{} 2021 Raghav Gururajan@*
 Copyright @copyright{} 2021 Domagoj Stolfa@*
 Copyright @copyright{} 2021 Hui Lu@*
+Copyright @copyright{} 2021 pukkamustard@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -7731,6 +7732,12 @@ The @code{#:package} parameter can be passed to specify a package name, which
 is useful when a package contains multiple packages and you want to build
 only one of them.  This is equivalent to passing the @code{-p} argument to
 @code{dune}.
+
+The @code{#:profile} parameter can be passed to specify the
+@uref{https://dune.readthedocs.io/en/stable/dune-files.html#profil, dune
+build profile}. This is equivalent to passing the @code{--profile}
+argument to @code{dune}. Its default value is @code{"release"}.
+
 @end defvr
 
 @defvr {Scheme Variable} go-build-system
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index bf9242410d..547b905317 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2854,8 +2854,7 @@ without a complete in-memory representation of the data.")
           "1dvcl108ir9nqkk4mjm9xhhj4p9dx9bmg8bnms54fizs1x3x8ar3"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "tests"
-       #:build-flags (list "--profile=release")))
+     `(#:test-target "tests"))
     (propagated-inputs
      `(("ocaml-cmdliner" ,ocaml-cmdliner)))
     (home-page "https://www.typerex.org/ocp-indent.html")
@@ -3273,8 +3272,7 @@ build system and allows external tools to analyse your project easily.")
                   "1smcc0l6fh2n0y6bp96c69j5nw755jja99w0b206wx3yb2m4w2hs"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f
-       #:build-flags (list "--profile" "release")))
+     `(#:tests? #f))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)))
     (home-page "https://github.com/mjambon/cppo")
@@ -3342,8 +3340,7 @@ standard iterator type starting from 4.07.")
         (base32 "07ycb103mr4mrkxfd63cwlsn023xvcjp0ra0k7n2gwrg0mwxmfss"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f
-       #:build-flags (list "--profile" "release")))
+     `(#:tests? #f))
     (propagated-inputs
      `(("ocaml-seq" ,ocaml-seq)))
     (native-inputs
@@ -3820,9 +3817,8 @@ the plugins facilitate extensibility, and the frontends serve as entry points.")
                 "0chn7ldqb3wyf95yhmsxxq65cif56smgz1mhhc7m0dpwmyq1k97h"))))
     (build-system dune-build-system)
     (arguments
-     `(#:build-flags (list "--profile" "release")
-       #:test-target "camomile-test"
-       #:tests? #f; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
+     `(#:test-target "camomile-test"
+       #:tests? #f ; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'fix-usr-share
@@ -3913,8 +3909,7 @@ connect an engine to your inputs and rendering functions to get an editor.")
         (base32 "0zcjy6fvf0d3i2ssz96asl889n3r6bplyzk7xvb2s3dkxbgcisyy"))))
     (build-system dune-build-system)
     (arguments
-     `(#:build-flags (list "--profile" "release")
-       #:tests? #f
+     `(#:tests? #f
        #:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 6a2f3d16de..1a64cf9b75 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben <at> gmail.com>
+;;; Copyright © 2021 pukkamustard <pukkamustard <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +89,7 @@
                      (out-of-source? #t)
                      (jbuild? #f)
                      (package #f)
+                     (profile "release")
                      (tests? #t)
                      (test-flags ''())
                      (test-target "test")
@@ -127,6 +129,7 @@ provides a 'setup.ml' file as its build system."
                    #:out-of-source? ,out-of-source?
                    #:jbuild? ,jbuild?
                    #:package ,package
+                   #:profile ,profile
                    #:tests? ,tests?
                    #:test-target ,test-target
                    #:install-target ,install-target
diff --git a/guix/build/dune-build-system.scm b/guix/build/dune-build-system.scm
index 7e2ec1e3e1..6a0c2593ac 100644
--- a/guix/build/dune-build-system.scm
+++ b/guix/build/dune-build-system.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2019 Gabriel Hondet <gabrielhondet <at> gmail.com>
+;;; Copyright © 2021 pukkamustard <pukkamustard <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,11 +32,14 @@
 ;; Code:
 
 (define* (build #:key (build-flags '()) (jbuild? #f)
-                (use-make? #f) (package #f) #:allow-other-keys)
+                (use-make? #f) (package #f)
+                (profile "release") #:allow-other-keys)
   "Build the given package."
   (let ((program (if jbuild? "jbuilder" "dune")))
     (apply invoke program "build" "@install"
-           (append (if package (list "-p" package) '()) build-flags)))
+           (append (if package (list "-p" package) '())
+                   `("--profile" ,profile)
+                   build-flags)))
   #t)
 
 (define* (check #:key (test-flags '()) (test-target "test") tests?
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Wed, 04 Aug 2021 08:10:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: 49868 <at> debbugs.gnu.org
Cc: pukkamustard <pukkamustard <at> posteo.net>
Subject: [PATCH 2/2] gnu: ocaml4.07-base: Remove unnecessary arguments.
Date: Wed,  4 Aug 2021 08:08:30 +0000
* gnu/packages/ocaml.scm (ocaml4.07-base): Remove unnecessary arguments.
---
 gnu/packages/ocaml.scm | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 547b905317..39ed60088e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4925,16 +4925,6 @@ provided by companion libraries such as
         (sha256
          (base32
           "0j6xb4265jr41vw4fjzak6yr8s30qrnzapnc6rl1dxy8bjai0nir"))))
-     (arguments
-      `(#:phases
-        (modify-phases %standard-phases
-          (replace 'build
-            ;; make warnings non fatal (jbuilder behaviour)
-            (lambda _
-              (invoke "dune" "build" "@install" "--profile=release"))))
-        #:ocaml ,ocaml-4.07
-        #:findlib ,ocaml4.07-findlib
-        #:dune ,ocaml4.07-dune))
      (properties '()))))
 
 (define-public ocaml-compiler-libs
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Mon, 09 Aug 2021 02:19:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Mon, 9 Aug 2021 04:17:58 +0200
Thanks for the patches! They LGTM, but since they're changing all our
ocaml packages (which can go to master), I thought I could sneak in a
small dune update. That needed an opam update and it was not as smooth
as expected. I'd like to wait until I get reviews on
https://issues.guix.gnu.org/49950, so we can push our patches together,
if that's ok with you?

Also, note that the link in the doc is incorrect, the anchor should be
#profile, not #profil :)




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Mon, 09 Aug 2021 07:18:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Mon, 09 Aug 2021 07:17:31 +0000
Julien Lepiller <julien <at> lepiller.eu> writes:

> Thanks for the patches! They LGTM, but since they're changing 
> all our
> ocaml packages (which can go to master), I thought I could sneak 
> in a
> small dune update. That needed an opam update and it was not as 
> smooth
> as expected. I'd like to wait until I get reviews on
> https://issues.guix.gnu.org/49950, so we can push our patches 
> together,
> if that's ok with you?

Sounds good to me!

Will try and checkout #49950 today.

> Also, note that the link in the doc is incorrect, the anchor 
> should be
> #profile, not #profil :)

Oops. Fixed in v2.




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Mon, 09 Aug 2021 07:20:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: 49868 <at> debbugs.gnu.org
Cc: pukkamustard <pukkamustard <at> posteo.net>
Subject: [PATCH v2 1/2] guix: dune-build-system: Add a profile parameter.
Date: Mon,  9 Aug 2021 07:19:03 +0000
* guix/build-system/dune.scm: Add a profile parameter.
* guix/build/dune-build-system.scm (build): Use it.
* doc/guix.texi: Document it.
* gnu/packages/ocaml.scm: Remove profile being set from build flags.
---
 doc/guix.texi                    |  7 +++++++
 gnu/packages/ocaml.scm           | 17 ++++++-----------
 guix/build-system/dune.scm       |  3 +++
 guix/build/dune-build-system.scm |  8 ++++++--
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 9a9c85678c..15b0ed7534 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -94,6 +94,7 @@ Copyright @copyright{} 2021 Xinglu Chen@*
 Copyright @copyright{} 2021 Raghav Gururajan@*
 Copyright @copyright{} 2021 Domagoj Stolfa@*
 Copyright @copyright{} 2021 Hui Lu@*
+Copyright @copyright{} 2021 pukkamustard@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -7731,6 +7732,12 @@ The @code{#:package} parameter can be passed to specify a package name, which
 is useful when a package contains multiple packages and you want to build
 only one of them.  This is equivalent to passing the @code{-p} argument to
 @code{dune}.
+
+The @code{#:profile} parameter can be passed to specify the
+@uref{https://dune.readthedocs.io/en/stable/dune-files.html#profile,
+dune build profile}. This is equivalent to passing the @code{--profile}
+argument to @code{dune}. Its default value is @code{"release"}.
+
 @end defvr
 
 @defvr {Scheme Variable} go-build-system
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index bf9242410d..547b905317 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2854,8 +2854,7 @@ without a complete in-memory representation of the data.")
           "1dvcl108ir9nqkk4mjm9xhhj4p9dx9bmg8bnms54fizs1x3x8ar3"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "tests"
-       #:build-flags (list "--profile=release")))
+     `(#:test-target "tests"))
     (propagated-inputs
      `(("ocaml-cmdliner" ,ocaml-cmdliner)))
     (home-page "https://www.typerex.org/ocp-indent.html")
@@ -3273,8 +3272,7 @@ build system and allows external tools to analyse your project easily.")
                   "1smcc0l6fh2n0y6bp96c69j5nw755jja99w0b206wx3yb2m4w2hs"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f
-       #:build-flags (list "--profile" "release")))
+     `(#:tests? #f))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)))
     (home-page "https://github.com/mjambon/cppo")
@@ -3342,8 +3340,7 @@ standard iterator type starting from 4.07.")
         (base32 "07ycb103mr4mrkxfd63cwlsn023xvcjp0ra0k7n2gwrg0mwxmfss"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f
-       #:build-flags (list "--profile" "release")))
+     `(#:tests? #f))
     (propagated-inputs
      `(("ocaml-seq" ,ocaml-seq)))
     (native-inputs
@@ -3820,9 +3817,8 @@ the plugins facilitate extensibility, and the frontends serve as entry points.")
                 "0chn7ldqb3wyf95yhmsxxq65cif56smgz1mhhc7m0dpwmyq1k97h"))))
     (build-system dune-build-system)
     (arguments
-     `(#:build-flags (list "--profile" "release")
-       #:test-target "camomile-test"
-       #:tests? #f; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
+     `(#:test-target "camomile-test"
+       #:tests? #f ; Tests fail, see https://github.com/yoriyuki/Camomile/issues/82
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'fix-usr-share
@@ -3913,8 +3909,7 @@ connect an engine to your inputs and rendering functions to get an editor.")
         (base32 "0zcjy6fvf0d3i2ssz96asl889n3r6bplyzk7xvb2s3dkxbgcisyy"))))
     (build-system dune-build-system)
     (arguments
-     `(#:build-flags (list "--profile" "release")
-       #:tests? #f
+     `(#:tests? #f
        #:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 6a2f3d16de..1a64cf9b75 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben <at> gmail.com>
+;;; Copyright © 2021 pukkamustard <pukkamustard <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +89,7 @@
                      (out-of-source? #t)
                      (jbuild? #f)
                      (package #f)
+                     (profile "release")
                      (tests? #t)
                      (test-flags ''())
                      (test-target "test")
@@ -127,6 +129,7 @@ provides a 'setup.ml' file as its build system."
                    #:out-of-source? ,out-of-source?
                    #:jbuild? ,jbuild?
                    #:package ,package
+                   #:profile ,profile
                    #:tests? ,tests?
                    #:test-target ,test-target
                    #:install-target ,install-target
diff --git a/guix/build/dune-build-system.scm b/guix/build/dune-build-system.scm
index 7e2ec1e3e1..6a0c2593ac 100644
--- a/guix/build/dune-build-system.scm
+++ b/guix/build/dune-build-system.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2019 Gabriel Hondet <gabrielhondet <at> gmail.com>
+;;; Copyright © 2021 pukkamustard <pukkamustard <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,11 +32,14 @@
 ;; Code:
 
 (define* (build #:key (build-flags '()) (jbuild? #f)
-                (use-make? #f) (package #f) #:allow-other-keys)
+                (use-make? #f) (package #f)
+                (profile "release") #:allow-other-keys)
   "Build the given package."
   (let ((program (if jbuild? "jbuilder" "dune")))
     (apply invoke program "build" "@install"
-           (append (if package (list "-p" package) '()) build-flags)))
+           (append (if package (list "-p" package) '())
+                   `("--profile" ,profile)
+                   build-flags)))
   #t)
 
 (define* (check #:key (test-flags '()) (test-target "test") tests?
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Mon, 09 Aug 2021 07:20:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: 49868 <at> debbugs.gnu.org
Cc: pukkamustard <pukkamustard <at> posteo.net>
Subject: [PATCH v2 2/2] gnu: ocaml4.07-base: Remove unnecessary arguments.
Date: Mon,  9 Aug 2021 07:19:04 +0000
* gnu/packages/ocaml.scm (ocaml4.07-base): Remove unnecessary arguments.
---
 gnu/packages/ocaml.scm | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 547b905317..39ed60088e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4925,16 +4925,6 @@ provided by companion libraries such as
         (sha256
          (base32
           "0j6xb4265jr41vw4fjzak6yr8s30qrnzapnc6rl1dxy8bjai0nir"))))
-     (arguments
-      `(#:phases
-        (modify-phases %standard-phases
-          (replace 'build
-            ;; make warnings non fatal (jbuilder behaviour)
-            (lambda _
-              (invoke "dune" "build" "@install" "--profile=release"))))
-        #:ocaml ,ocaml-4.07
-        #:findlib ,ocaml4.07-findlib
-        #:dune ,ocaml4.07-dune))
      (properties '()))))
 
 (define-public ocaml-compiler-libs
-- 
2.32.0





Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Fri, 20 Aug 2021 22:10:01 GMT) Full text and rfc822 format available.

Notification sent to pukkamustard <pukkamustard <at> posteo.net>:
bug acknowledged by developer. (Fri, 20 Aug 2021 22:10:02 GMT) Full text and rfc822 format available.

Message #28 received at 49868-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 49868-done <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Sat, 21 Aug 2021 00:09:26 +0200
Pushed to master as 777ce1485749cc3dbe178fcc1e0654a7e74900c5 and
33a1ec29fa0ad72c61cef13c8af08c847eb399c1, thanks!




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 24 Aug 2021 06:54:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 24 Aug 2021 06:52:56 +0000
Julien Lepiller <julien <at> lepiller.eu> writes:

> Pushed to master as 777ce1485749cc3dbe178fcc1e0654a7e74900c5 and
> 33a1ec29fa0ad72c61cef13c8af08c847eb399c1, thanks!

Hi,

I think this is causing trouble and maybe we should revert the commits.

Setting the dune "--profile" argument to "release" without using "-p" seems to cause broken builds.

For example ocaml-ppxlib builds properly but seems to be broken. Anything depending on ocaml-ppxlib fails with the errors:

```
Error: Files /gnu/store/4rxccc7d9qxfp8ggv0b3ais1r22yf46l-ocaml-ppx-compare-0.14.0/lib/ocaml/site-lib/ppx_compare/expander/ppx_compare_expander.cmxa
       and /gnu/store/dvrvy7b6d318ifg5n698x1667776alwg-ocaml-ppxlib-0.22.1/lib/ocaml/site-lib/ppxlib/ppxlib.cmxa
       make inconsistent assumptions over interface Ppxlib
Error: The files /gnu/store/dvrvy7b6d318ifg5n698x1667776alwg-ocaml-ppxlib-0.22.1/lib/ocaml/site-lib/ppxlib/ppxlib.cmi
       and /gnu/store/4rxccc7d9qxfp8ggv0b3ais1r22yf46l-ocaml-ppx-compare-0.14.0/lib/ocaml/site-lib/ppx_compare/expander/ppx_compare_expander.cmi
       make inconsistent assumptions over interface Ppxlib
````

See also https://issues.guix.gnu.org/49867#96 where the same thing happens for ocaml-eqaf.

-pukkamustard




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 24 Aug 2021 07:14:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 24 Aug 2021 07:13:35 +0000
pukkamustard <pukkamustard <at> posteo.net> writes:

> For example ocaml-ppxlib builds properly but seems to be broken. Anything depending on ocaml-ppxlib fails with the errors:

This is not true. ocaml-ppx-hash fails to build. But other things depending on ocaml-ppxlib seem to build fine (e.g. ocaml-ppx-optional, ocaml-ppx-assert).




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 24 Aug 2021 07:52:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 24 Aug 2021 07:51:25 +0000
I submitted #50180 to fix builds of ocaml-ppx-hash.

The impact of this seems to be smaller than I feared. Maybe reverting is not necessary.

Still I don't really understand what's going on. I will try and find a concise example and ask the Dune people.

pukkamustard <pukkamustard <at> posteo.net> writes:

> pukkamustard <pukkamustard <at> posteo.net> writes:
>
>> For example ocaml-ppxlib builds properly but seems to be broken. Anything depending on ocaml-ppxlib fails with the errors:
>
> This is not true. ocaml-ppx-hash fails to build. But other things depending on ocaml-ppxlib seem to build fine (e.g. ocaml-ppx-optional, ocaml-ppx-assert).




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 09:49:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: 49868 <at> debbugs.gnu.org
Cc: Julien Lepiller <julien <at> lepiller.eu>
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 07 Sep 2021 09:33:39 +0000
[Message part 1 (text/plain, inline)]
I suggest reverting commit 33a1ec29fa0ad72c61cef13c8af08c847eb399c1
('guix: dune-build-system: Add a profile parameter.') and instead
applying attached patch.

The attached patch sets the '--release' flag instead of '--profile
release'. From 'dune --help':

--8<---------------cut here---------------start------------->8---
--release
   Put dune into a reproducible release mode. This is in fact a
   shorthand for --root . --ignore-promoted-rules --no-config
   --profile release --always-show-command-line
   --promote-install-files --default-target @install. You should use
   this option for release builds. For instance, you must use this
   option in your <package>.opam files. Except if you already use -p,
   as -p implies this option.
--8<---------------cut here---------------end--------------->8---

I think this is what we want.

Setting '--profile release' was not enough and was causing
inconsistencies with packages that were building with the '-p' flag.

-pukkamustard

[0001-guix-dune-build-system-Put-dune-into-a-reproducible-.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

pukkamustard <pukkamustard <at> posteo.net> writes:

> I submitted #50180 to fix builds of ocaml-ppx-hash.
>
> The impact of this seems to be smaller than I feared. Maybe reverting is not necessary.
>
> Still I don't really understand what's going on. I will try and find a concise example and ask the Dune people.
>
> pukkamustard <pukkamustard <at> posteo.net> writes:
>
>> pukkamustard <pukkamustard <at> posteo.net> writes:
>>
>>> For example ocaml-ppxlib builds properly but seems to be broken. Anything depending on ocaml-ppxlib fails with the errors:
>>
>> This is not true. ocaml-ppx-hash fails to build. But other things depending on ocaml-ppxlib seem to build fine (e.g. ocaml-ppx-optional, ocaml-ppx-assert).


Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 11:07:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>, 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile parameter.
Date: Tue, 07 Sep 2021 07:06:20 -0400
[Message part 1 (text/plain, inline)]
Instead of reverting, coull you senl a patch on top of master, that simply replaces the flag?

Le 7 septembre 2021 05:33:39 GMT-04:00, pukkamustard <pukkamustard <at> posteo.net> a écrit :
>
>I suggest reverting commit 33a1ec29fa0ad72c61cef13c8af08c847eb399c1
>('guix: dune-build-system: Add a profile parameter.') and instead
>applying attached patch.
>
>The attached patch sets the '--release' flag instead of '--profile
>release'. From 'dune --help':
>
>--8<---------------cut here---------------start------------->8---
>--release
>   Put dune into a reproducible release mode. This is in fact a
>   shorthand for --root . --ignore-promoted-rules --no-config
>   --profile release --always-show-command-line
>   --promote-install-files --default-target @install. You should use
>   this option for release builds. For instance, you must use this
>   option in your <package>.opam files. Except if you already use -p,
>   as -p implies this option.
>--8<---------------cut here---------------end--------------->8---
>
>I think this is what we want.
>
>Setting '--profile release' was not enough and was causing
>inconsistencies with packages that were building with the '-p' flag.
>
>-pukkamustard
>
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 11:57:02 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 07 Sep 2021 11:46:01 +0000
[Message part 1 (text/plain, inline)]
Attached a patch on top of master that replaces the profile parameter
with the release flag.

[0001-guix-dune-build-system-Put-dune-into-a-reproducible-.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

Julien Lepiller <julien <at> lepiller.eu> writes:

> Instead of reverting, coull you senl a patch on top of master, that simply replaces the flag?
>
> Le 7 septembre 2021 05:33:39 GMT-04:00, pukkamustard <pukkamustard <at> posteo.net> a écrit :
>
>  I suggest reverting commit 33a1ec29fa0ad72c61cef13c8af08c847eb399c1
> ('guix: dune-build-system: Add a profile parameter.') and instead
> applying attached patch.
>
> The attached patch sets the '--release' flag instead of '--profile
> release'. From 'dune --help':
>
> --8<---------------cut here---------------start------------->8---
> --release
>    Put dune into a reproducible release mode. This is in fact a
>    shorthand for --root . --ignore-promoted-rules --no-config
>    --profile release --always-show-command-line
>    --promote-install-files --default-target @install. You should use
>    this option for release builds. For instance, you must use this
>    option in your <package>.opam files. Except if you already use -p,
>    as -p implies this option.
> --8<---------------cut here---------------end--------------->8---
>
> I think this is what we want.
>
> Setting '--profile release' was not enough and was causing
> inconsistencies with packages that were building with the '-p' flag.
>
> -pukkamustard


Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 13:04:01 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 7 Sep 2021 15:03:30 +0200
Le Tue, 07 Sep 2021 11:46:01 +0000,
pukkamustard <pukkamustard <at> posteo.net> a écrit :

> Attached a patch on top of master that replaces the profile parameter
> with the release flag.
> 

Unfortunately, this is breaking our ocaml4.07-* packages, because the
--release flag doesn't exist in the version we use for ocaml4.07-dune.
I think the easiest would be to add a flag #:release? and set it to #f
in package-with-ocaml4.07.




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 20:04:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Tue, 07 Sep 2021 18:11:24 +0000
Julien Lepiller <julien <at> lepiller.eu> writes:

> Unfortunately, this is breaking our ocaml4.07-* packages, because the
> --release flag doesn't exist in the version we use for ocaml4.07-dune.

Whoops. Seems like the --release flag was only added in dune 2.5.0
(https://github.com/ocaml/dune/blob/main/CHANGES.md#250-09042020;
ocaml4.07-dune is at 1.11.3).

> I think the easiest would be to add a flag #:release? and set it to #f
> in package-with-ocaml4.07.

That would work. But I think it would be better if we built everything
in release mode.

Unfortunately the way to do that with old dune is by expclity with '-p
PACKAGE1,PACKAGE2'. That means we need to rename the #:package argument
to #:packages, allow it to take a list and add explicit packages to all
OCaml4.07 packages.

Another way would be to write-out the flags for which -p and --release
are short-hand for. Unfortunately this is different in dune 2.9.0 and
1.11.3 (taken from the --help):

2.9.0:
--8<---------------cut here---------------start------------->8---
--root . --ignore-promoted-rules --no-config --profile release
  --always-show-command-line --promote-install-files --default-target
  @install
--8<---------------cut here---------------end--------------->8---

1.11.3:
--8<---------------cut here---------------start------------->8---
--root . --ignore-promoted-rules --no-config ----profile release
--8<---------------cut here---------------end--------------->8---

Can we check the version of dune in dune-build-system and either use
--release or the set of 1.11.3 flags?

I just tried doing this in (guix build dune-build-system). Didn't work
as I couldn't use (guix package). After reading up, I guess this needs
to be done in (guix build-system dune) and lowered down as an argument -
maybe as 'dune-release-flags'? Would that be ok?




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Tue, 07 Sep 2021 22:04:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Wed, 8 Sep 2021 00:03:21 +0200
Le Tue, 07 Sep 2021 18:11:24 +0000,
pukkamustard <pukkamustard <at> posteo.net> a écrit :

> Julien Lepiller <julien <at> lepiller.eu> writes:
> 
> > Unfortunately, this is breaking our ocaml4.07-* packages, because
> > the --release flag doesn't exist in the version we use for
> > ocaml4.07-dune.  
> 
> Whoops. Seems like the --release flag was only added in dune 2.5.0
> (https://github.com/ocaml/dune/blob/main/CHANGES.md#250-09042020;
> ocaml4.07-dune is at 1.11.3).
> 
> > I think the easiest would be to add a flag #:release? and set it to
> > #f in package-with-ocaml4.07.  
> 
> That would work. But I think it would be better if we built everything
> in release mode.
> 
> Unfortunately the way to do that with old dune is by expclity with '-p
> PACKAGE1,PACKAGE2'. That means we need to rename the #:package
> argument to #:packages, allow it to take a list and add explicit
> packages to all OCaml4.07 packages.
> 
> Another way would be to write-out the flags for which -p and --release
> are short-hand for. Unfortunately this is different in dune 2.9.0 and
> 1.11.3 (taken from the --help):
> 
> 2.9.0:
> --8<---------------cut here---------------start------------->8---
> --root . --ignore-promoted-rules --no-config --profile release
>   --always-show-command-line --promote-install-files --default-target
>   @install
> --8<---------------cut here---------------end--------------->8---
> 
> 1.11.3:
> --8<---------------cut here---------------start------------->8---
> --root . --ignore-promoted-rules --no-config ----profile release
> --8<---------------cut here---------------end--------------->8---

I suppose these additional flags are not available in dune 1.11?

> 
> Can we check the version of dune in dune-build-system and either use
> --release or the set of 1.11.3 flags?
> 
> I just tried doing this in (guix build dune-build-system). Didn't work
> as I couldn't use (guix package). After reading up, I guess this needs
> to be done in (guix build-system dune) and lowered down as an
> argument - maybe as 'dune-release-flags'? Would that be ok?

Yeah, that sounds good. Another solution would be to get rid of
ocaml4.07, but that's our future bootstrap path (as this is the only
bootstrapped version currently), so we will need it anyway...




Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Wed, 08 Sep 2021 08:31:01 GMT) Full text and rfc822 format available.

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

From: pukkamustard <pukkamustard <at> posteo.net>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49868 <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Wed, 08 Sep 2021 08:24:19 +0000
[Message part 1 (text/plain, inline)]
Julien Lepiller <julien <at> lepiller.eu> writes:

>> 
>> 2.9.0:
>> --8<---------------cut here---------------start------------->8---
>> --root . --ignore-promoted-rules --no-config --profile release
>>   --always-show-command-line --promote-install-files --default-target
>>   @install
>> --8<---------------cut here---------------end--------------->8---
>> 
>> 1.11.3:
>> --8<---------------cut here---------------start------------->8---
>> --root . --ignore-promoted-rules --no-config ----profile release
>> --8<---------------cut here---------------end--------------->8---
>
> I suppose these additional flags are not available in dune 1.11?
>

No, unfortunately the flags are not available in 1.11. We need to check
version and use appropriate flags.

>> 
>> Can we check the version of dune in dune-build-system and either use
>> --release or the set of 1.11.3 flags?
>> 
>> I just tried doing this in (guix build dune-build-system). Didn't work
>> as I couldn't use (guix package). After reading up, I guess this needs
>> to be done in (guix build-system dune) and lowered down as an
>> argument - maybe as 'dune-release-flags'? Would that be ok?
>
> Yeah, that sounds good.

Attached a patch that does that. ocaml4.07 packages are building again.

Unsure about the double quote things and if there is a better way to
check versions.

> Another solution would be to get rid of
> ocaml4.07, but that's our future bootstrap path (as this is the only
> bootstrapped version currently), so we will need it anyway...

Yup, good to keep it.

[0001-guix-dune-build-system-Put-dune-into-a-reproducible-.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49868; Package guix-patches. (Wed, 08 Sep 2021 11:46:02 GMT) Full text and rfc822 format available.

Message #61 received at 49868-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: pukkamustard <pukkamustard <at> posteo.net>
Cc: 49868-done <at> debbugs.gnu.org
Subject: Re: [bug#49868] [PATCH 0/2] guix: dune-build-system: Add a profile
 parameter.
Date: Wed, 8 Sep 2021 13:45:21 +0200
Le Wed, 08 Sep 2021 08:24:19 +0000,
pukkamustard <pukkamustard <at> posteo.net> a écrit :

> 
> Attached a patch that does that. ocaml4.07 packages are building
> again.
> 
> Unsure about the double quote things and if there is a better way to
> check versions.
> 
> > Another solution would be to get rid of
> > ocaml4.07, but that's our future bootstrap path (as this is the only
> > bootstrapped version currently), so we will need it anyway...
> 
> Yup, good to keep it.
> 

Pushed as f8f94cc5446753b37ab3ddd23e21919efd006769, thanks!

I made an adjustment to the commit message and used version>= in (guix
build-system dune) instead of comparing to the exact version, in case
someone wants to use a different version, older that 2.5.0. Otherwise
unchanged. Thanks again!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 07 Oct 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 194 days ago.

Previous Next


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