From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQfJT-0005sS-5j for guix-patches@gnu.org; Sat, 24 Nov 2018 16:18:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQfJR-0001GS-VC for guix-patches@gnu.org; Sat, 24 Nov 2018 16:18:03 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:41583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQfJR-0001GM-Rz for guix-patches@gnu.org; Sat, 24 Nov 2018 16:18:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gQfJR-0003fU-Mu for guix-patches@gnu.org; Sat, 24 Nov 2018 16:18:01 -0500 Subject: [bug#33437] [PATCH 01/10] build: Add dune-build-system. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20181119232537.66d2a822@lepiller.eu> <20181119222821.16789-1-julien@lepiller.eu> Date: Sat, 24 Nov 2018 22:17:13 +0100 In-Reply-To: <20181119222821.16789-1-julien@lepiller.eu> (Julien Lepiller's message of "Mon, 19 Nov 2018 23:28:12 +0100") Message-ID: <87k1l2yy3q.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Julien Lepiller Cc: 33437@debbugs.gnu.org Hello Julien! Julien Lepiller 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): Ex= port > 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. ^^ =E2=80=9Cautomatically=E2=80=9D > +The @code{'configure} phase is removed as dune packages typically Maybe: =E2=80=9CThere is no @code{configure} phase because Dune packages=E2= =80=A6=E2=80=9D? > +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 =E2=80=9Clegacy=E2=80=9D. :-) > +;;; along with GNU Guix. If not, see . > +(define-module (guix build-system dune) Nitpick: please insert a newline before =E2=80=98define-module=E2=80=99. = :-) > +(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)) >=20=20 > @@ -76,6 +79,13 @@ > (let ((module (resolve-interface '(gnu packages ocaml)))) > (module-ref module 'ocaml-findlib))) >=20=20 > +(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." > =3D> force) >=20=20 > ;; 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=E2=80=99t have a better solution to offer here, but this whole =E2=80=98package-with-explicit-XYZ=E2=80=99 is clearly showing its limits h= ere. :-/ Otherwise LGTM, thank you! Ludo=E2=80=99.