From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catonano Subject: Re: Guix-based build tool Date: Fri, 20 Apr 2018 08:58:31 +0200 Message-ID: References: <20180406220728.GA8995@thebird.nl> <87vad0ieie.fsf_-_@gnu.org> <87604r6q9t.fsf@dustycloud.org> <87efjcte6a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004bcfc6056a423751" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Q0A-0000SM-KJ for guix-devel@gnu.org; Fri, 20 Apr 2018 02:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9Q09-0000St-3x for guix-devel@gnu.org; Fri, 20 Apr 2018 02:58:34 -0400 Received: from mail-yb0-x22d.google.com ([2607:f8b0:4002:c09::22d]:33217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9Q08-0000S8-Qv for guix-devel@gnu.org; Fri, 20 Apr 2018 02:58:33 -0400 Received: by mail-yb0-x22d.google.com with SMTP id y5-v6so2671514ybg.0 for ; Thu, 19 Apr 2018 23:58:32 -0700 (PDT) In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" Cc: guix-devel --0000000000004bcfc6056a423751 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2018-04-20 8:52 GMT+02:00 Catonano : > 2018-04-19 18:49 GMT+02:00 Catonano : > >> >> >> 2018-04-18 23:09 GMT+02:00 Ludovic Court=C3=A8s : >> >>> Hello, >>> >>> Christopher Lemmer Webber skribis: >>> >>> > While this is a fun idea, I'd still much rather have a guile-based >>> > DSL replacement for autotools type things that's standalone (but mayb= e >>> > also which can export to shell if need be). >>> >>> Yeah, not depending on Guix would have pros (it=E2=80=99d be more widel= y >>> applicable), and cons (limited world view). >>> >>> Food for thought! >>> >>> Ludo=E2=80=99. >>> >>> >> there' s this file guix/buid/emacs-utils.scm >> >> it contains utilities to let Emacs byte-compile elisp files >> >> So that' s an Emacs build system and it' s embedded in Guix >> >> My initial idea was to do something similar with Guile >> >> But then I tought that it could have been a stand alone package >> >> Today in the morning I could manage to take a look at this issue >> >> I made a script that visits the file system tree of a project and >> compiles the .scm files >> >> Here' s a short demo >> https://www.youtube.com/watch?v=3DLaypeR8uw3Q >> >> It doesn' t check the availability of dependencies (other guile packages= ) >> yet >> >> I was not sure how to achieve that >> >> I saw that Automake generates snippets of bash scripting that try to run >> guile with an expression loading the required module and if that fails t= hen >> the module is not available >> >> The same functionality could be reproduced in Guile >> >> I also saw the guildhall files that Ludo mentioned >> >> So the thing is that the interface towards the user should be like those >> guildhall files >> >> and the interface towards the system should be like the Automake one >> >> But, like Automake, it should only check if a Guile module is reachable >> on the guile load path >> > > > I am experimenting with this line > > (system* "guile" "-c" "(use-modules (commonmark)) (exit ((lambda () 0)))"= ) > > If it finds the module it returns 0 > > Otherwise it returns a different number > > I copied some bits for a configure script for a Guile project instrumente= d > with the Autotools > > I could use an example of usage of "status:Exit-val" > > The Guile manual says: > > Return the exit status value, as would be set if a process ended > normally through a call to =E2=80=98exit=E2=80=99 or =E2=80=98_exit= =E2=80=99, if any, otherwise > =E2=80=98#f=E2=80=99. > > this is not enouhg for me to understand > > In which scenario is thhis function supposed to be used ? In order to do > what ? > An example would be of great help > > Anyway: Is this the idiomatic way ? > > Or maybe I should use some try catch form wrapping some module loading > instruction ? > Without launching a different guile process ? > > Thanks for any hint > so this line (notice the module is named commonmarL) (system* "guile" "-c" "(use-modules (commonmarl)) (exit ((lambda () 0)))") returns 256 while this one (status:exit-val (system* "guile" "-c" "(use-modules (commonmarl)) (exit ((lambda () 0)))")) returns 1 what's the point ? --0000000000004bcfc6056a423751 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2018-04-20 8:52 GMT+02:00 Catonano <catonano@gmail.com>= :
2018-04-19 18:49 GMT+02:00 Catonano <catonano@gmail.com>:<= br>
<= div class=3D"h5">


2018-04-18 23:09 GMT+02:00 Ludovic Court=C3=A8s <ludo@gnu= .org>:
H= ello,

Christopher Lemmer Webber <cwebber@dustycloud.org> skribis:

> While this is a fun idea, I'd still much rather have a guile-based=
> DSL replacement for autotools type things that's standalone (but m= aybe
> also which can export to shell if need be).

Yeah, not depending on Guix would have pros (it=E2=80=99d be more wi= dely
applicable), and cons (limited world view).

Food for thought!

Ludo=E2=80=99.


there&#= 39; s this file guix/buid/emacs-utils.scm

it contains utilities to let Emacs byte-compile elisp files

<= /div>
So that' s an Emacs build system and it= ' s embedded in Guix

My initial= idea was to do something similar with Guile

But then I tought that it could have been a stand alone package
Today in the morning I could manage = to take a look at this issue

I made= a script that visits the file system tree of a project and compiles the .s= cm files

Here' s a short demohttps://www.youtube.com/watch?v=3DLaypeR8uw3Q

It doesn&#= 39; t check the availability of dependencies (other guile packages) yet
=
I was not sure how to achieve that
=
I saw that Automake generates snippets= of bash scripting that try to run guile with an expression loading the req= uired module and if that fails then the module is not available

The same functionality could be reproduced in = Guile

I also saw the guildhall file= s that Ludo mentioned

So the thing = is that the interface towards the user should be like those guildhall files=

and the interface towards the syst= em should be like the Automake one

= But, like Automake, it should only check if a Guile module is reachable on = the guile load path


I am experimenting with this line

(system* "guile"= ; "-c" "(use-modules (commonmark)) (exit ((lambda () 0)))&qu= ot;)

If it finds the module it returns 0
Otherwise it returns a different number
=C2=A0
I copied some bits for a configure script for a Guile project instrumente= d with the Autotools

I could use an example of usage of &= quot;status:Exit-val"

The Guile manual says:

= =C2=A0=C2=A0=C2=A0=C2=A0 Return the exit status value, as would be set if a= process ended
=C2=A0=C2=A0=C2=A0=C2=A0 normally through a call to =E2= =80=98exit=E2=80=99 or =E2=80=98_exit=E2=80=99, if any, otherwise
=C2=A0= =C2=A0=C2=A0=C2=A0 =E2=80=98#f=E2=80=99.

this is not enou= hg for me to understand

In which scenario is thhis functi= on supposed to be used ? In order to do what ?
An example wo= uld be of great help

Anyway: Is this the idiomatic way ? =

Or maybe I should use some try catch form wrapping some = module loading instruction ?
Without launching a different gu= ile process ?

Thanks for any hint


so

this line (notice the module is named commonmar= L)

(system* "guile" "-c" "(use-modules (com= monmarl)) (exit ((lambda () 0)))")

returns 256

while this one
=
(status:exit-val (system* "guile" "-c" "(use-m= odules (commonmarl)) (exit ((lambda () 0)))"))

returns 1

what'= ;s the point ?
--0000000000004bcfc6056a423751--