all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Julien Lepiller <julien@lepiller.eu>
Cc: 33437@debbugs.gnu.org
Subject: [bug#33437] [PATCH 01/10] build: Add dune-build-system.
Date: Sat, 24 Nov 2018 22:17:13 +0100	[thread overview]
Message-ID: <87k1l2yy3q.fsf@gnu.org> (raw)
In-Reply-To: <20181119222821.16789-1-julien@lepiller.eu> (Julien Lepiller's message of "Mon, 19 Nov 2018 23:28:12 +0100")

Hello Julien!

Julien Lepiller <julien@lepiller.eu> skribis:

> * guix/build/dune-build-system.scm,
>   guix/build-system/dune.scm: New files.
> * Makefile.am (MODULES): Add them.
> * doc/guix.texi (Build Systems): Document dune-build-system.
> * guix/build-system/ocaml.scm (lower, default-findlib, default-ocaml): Export
> them.
> (package-with-explicit-ocaml): Also transform packages built with
> dune-build-system.

Nice!

> +@defvr {Scheme Variable} dune-build-system
> +This variable is exported by @code{(guix build-system dune)}.  It
> +supports builds of packaes using Dune, a build tool for the
                           ^
Typo.

> +@uref{https://ocaml.org, OCaml programming language}.  It is implemented

Maybe add a link for Dune rather than for OCaml?


> +as an extension of the @code{ocaml-build-system} which is describe below.
                                                                    ^
Typo.

> +It automically adds the @code{dune} package to the set of inputs.
          ^^
“automatically”

> +The @code{'configure} phase is removed as dune packages typically

Maybe: “There is no @code{configure} phase because Dune packages…”?

> +The @code{#:legacy?} parameter can be passed to use the @code{jbuild}
> +command instead of the more recent @code{dune} command while building
> +a package.  Its default value is @code{#f}.

Should it be called #:jbuild? instead?  Because eventually everything
becomes “legacy”.  :-)

> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> +(define-module (guix build-system dune)

Nitpick: please insert a newline before ‘define-module’.   :-)

> +(define* (dune-build store name inputs
> +                     #:key (guile #f)
> +                     (outputs '("out"))
> +                     (search-paths '())
> +                     (build-flags ''())
> +                     (out-of-source? #t)
> +                     (legacy? #f)
> +                     (tests? #t)
> +                     (test-flags ''())
> +                     (test-target "test")
> +                     (install-target "install")
> +                     (validate-runpath? #t)
> +                     (patch-shebangs? #t)
> +                     (strip-binaries? #t)
> +                     (strip-flags ''("--strip-debug"))
> +                     (strip-directories ''("lib" "lib64" "libexec"
> +                                           "bin" "sbin"))
> +                     (phases '(@ (guix build dune-build-system)
> +                                 %standard-phases))
> +                     (system (%current-system))
> +                     (imported-modules %dune-build-system-modules)
> +                     (modules '((guix build dune-build-system)
> +                                (guix build utils))))

Would it make sense to add (guix build ocaml-build-system) as well to
the default #:modules?

> +++ b/guix/build-system/ocaml.scm
> @@ -31,6 +31,9 @@
>              package-with-ocaml4.02
>              strip-ocaml4.01-variant
>              strip-ocaml4.02-variant
> +            default-findlib
> +            default-ocaml
> +            lower
>              ocaml-build
>              ocaml-build-system))
>  
> @@ -76,6 +79,13 @@
>    (let ((module (resolve-interface '(gnu packages ocaml))))
>      (module-ref module 'ocaml-findlib)))
>  
> +(define (default-dune-build-system)
> +  "Return the dune-build-system."
> +
> +  ;; Do not use `@' to avoid introducing circular dependencies.
> +  (let ((module (resolve-interface '(guix build-system dune))))
> +    (module-ref module 'dune-build-system)))
> +
>  (define (default-ocaml4.01)
>    (let ((ocaml (resolve-interface '(gnu packages ocaml))))
>      (module-ref ocaml 'ocaml-4.01)))
> @@ -119,7 +129,8 @@ pre-defined variants."
>        => force)
>  
>       ;; Otherwise build the new package object graph.
> -     ((eq? (package-build-system p) ocaml-build-system)
> +     ((or (eq? (package-build-system p) ocaml-build-system)
> +          (eq? (package-build-system p) (default-dune-build-system)))

I don’t have a better solution to offer here, but this whole
‘package-with-explicit-XYZ’ is clearly showing its limits here.  :-/

Otherwise LGTM, thank you!

Ludo’.

  parent reply	other threads:[~2018-11-24 21:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 22:25 [bug#33437] [PATCH] Add dune-build-system Julien Lepiller
2018-11-19 22:28 ` [bug#33437] [PATCH 01/10] build: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 02/10] gnu: ocaml-migrate-parsetree: Use dune-build-system Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 03/10] gnu: ocaml-ppx-tools-versioned: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 04/10] gnu: ocaml-bitstring: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 05/10] gnu: ocaml-lwt: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 06/10] gnu: ocaml-lwt-log: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 07/10] gnu: ocaml-cppo: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 08/10] gnu: ocaml-re: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 09/10] gnu: ocaml-camomile: " Julien Lepiller
2018-11-19 22:28   ` [bug#33437] [PATCH 10/10] gnu: ocaml-lambda-term: " Julien Lepiller
2018-11-24 21:18     ` Ludovic Courtès
2018-11-24 21:17   ` Ludovic Courtès [this message]
2018-12-18 21:41 ` bug#33437: [PATCH] Add dune-build-system Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1l2yy3q.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=33437@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.