[PATCH] Add a TLDR entry to the cookbook for building Guix from Git.

  • Open
  • quality assurance status badge
Details
5 participants
  • Pierre-Henry Fröhring
  • Leo Famulari
  • Ludovic Courtès
  • Maxime Devos
  • zimoun
Owner
unassigned
Submitted by
Pierre-Henry Fröhring
Severity
normal
P
P
Pierre-Henry Fröhring wrote on 6 Feb 2022 22:33
(address . guix-patches@gnu.org)(name . Pierre-Henry Fröhring)(address . contact@phfrohring.com)
20220206213344.3117861-1-contact@phfrohring.com
---
doc/guix-cookbook.texi | 68 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (86 lines)
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index d2ce525998..2d004d7a6b 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -66,6 +66,7 @@ Weblate} (@pxref{Translating Guix,,, guix, GNU Guix reference manual}).
@menu
* Scheme tutorials:: Meet your new favorite language!
+* Building from Git:: Hack Guix itself
* Packaging:: Packaging tutorials
* System Configuration:: Customizing the GNU System
* Advanced package management:: Power to the users!
@@ -301,7 +302,73 @@ You'll find more books, tutorials and other resources at
@url{https://schemers.org/}.
+@c *********************************************************************
+@node Building from Git
+@chapter Building from Git
+
+Build Guix from Git and start hacking.
+
+@node Context
+@section Context
+
+@itemize
+@item
+Guix is installed using binary installation.
+@end itemize
+
+@node Source
+@section Source
+
+@example
+cd ~/src
+git clone https://git.savannah.gnu.org/git/guix.git
+@end example
+
+@node Authentication
+@section Authentication
+
+@example
+git fetch origin keyring:keyring
+guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
+ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
+@end example
+
+@node Development environment
+@section Development environment
+
+@example
+guix environment guix --pure --ad-hoc fd
+./bootstrap
+guix_db_prefix=$(fd -p '.*/guix/db$' /)
+guix_db_prefix=$@{guix_db_prefix%/guix/db@}
+./configure --localstatedir="$guix_db_prefix"
+exit
+make authenticate
+@end example
+
+@node Compile
+@section Compile
+
+@example
+guix environment guix --pure
+make
+make check
+exit
+@end example
+
+@node Test
+@section Test
+
+@code{./pre-inst-env} let's you distinguish between this installation of
+Guix and any other.
+
+@example
+cd ~/src/guix
+guix environment guix --pure
+./pre-inst-env guix build hello
+@end example
+
+
@c *********************************************************************
@node Packaging
@chapter Packaging
--
2.34.0
M
M
Maxime Devos wrote on 6 Feb 2022 23:02
2c51e2236116c55e112199a2dbfb143361e88ae8.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (8 lines)
> +@node Building from Git
> +@chapter Building from Git
> +
> +Build Guix from Git and start hacking.
> +
> +@node Context
> +@section Context

This is all explained in the main manual in more detail, can a cross-
reference to ‘(guix)Building from Git’ be added?
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBFcRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mYBAP4sPzZeG21/Aad4a0ydnd3rZEOi
Cr1rBUXbQLE0P4PvsAEA9DiP/Qp/9Qoo1c8VAbOMN1erlR0HOVpZtT1ZsdJrZAY=
=ERMG
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 6 Feb 2022 23:02
2e8bc664e39df799c170991789c497422fa5095b.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (2 lines)
> +@code{./pre-inst-env} let's you distinguish between this installation of

"lets", not "let's"
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBFgxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iW+AQDEEyjC0moyECahZI51S6X1MQ6P
u7yEwheK31jwzZvjBAEA/PCOUjZVucTC34f5LUKPHATToPK+TByS6I7Kz3BYzAg=
=Bi6e
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 6 Feb 2022 23:03
9bc9c87058cfa3db9fbd8f39abd364015d421b23.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (2 lines)
> +guix environment guix --pure

Nowadays it's "guix shell":

"guix shell --pure -D guix"
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBFmRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7meOAQDLxKFIiSaLPW5U68z8rB125o7V
YE+8xbF1dUcCHBZb3wEAlJOr9pzSyKicnN28D8+mZmUDwMCwCXPfoZYt/zLkjwQ=
=MhQD
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 6 Feb 2022 23:06
c89c9ce54ca883af6355964ebcf5807009db10c0.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (5 lines)
> +guix environment guix --pure --ad-hoc fd
> +./bootstrap
> +guix_db_prefix=$(fd -p '.*/guix/db$' /)
> +guix_db_prefix=$@{guix_db_prefix%/guix/db@}

What's this 'fd' and guix_db_prefix about?
If this is necessary, shouldn't it be documented in the main manual.

Toggle quote (4 lines)
> +./configure --localstatedir="$guix_db_prefix"
> +exit
> +make authenticate

This "make authenticate" gives a false sense of security -- the MITM
attacker could have changed the Makefile.am to let the 'authenticate'
target be a no-op. Likewise, authentication must happen before
./bootstrap and ./configure otherwise it's too late.

Also, didn't this authentication already happen in

Toggle quote (8 lines)
> +@node Authentication
> +@section Authentication
> +
> +@example
> +git fetch origin keyring:keyring
> +guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
> + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBGaBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gPdAPwNwtKDmYn9Gc1Xyz3Xoo2A/cga
BmvyFfWf7MKP017c2AEAn2+HrM6vCNl7nPXJnnBs0bsneSBnDMlWTtbg4sAvXAw=
=DQhP
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 6 Feb 2022 23:07
8ed430e5525be810207a5cd307a6e65b14676a3d.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (2 lines)
> +cd ~/src

That directory does not exist on my machine, it needs to be created
first ('mkdir').

Toggle quote (2 lines)
Before we can "git clone", git needs to be installed ("guix install
git", or "guix shell git").

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBGqxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7s28AP9SSiUOP/6gb5pg71djnJvU09HE
+feBh2bzQPo6UXSDBAEAyeVUts+fNqmcqfENs8gCi+NA2lxYkQYG6M3ZLhnFxA4=
=3tYe
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 6 Feb 2022 23:09
3a55d575fdd527952e57ab346a019196f17d3aa3.camel@telenet.be
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
Toggle quote (4 lines)
> ---
>  doc/guix-cookbook.texi | 68 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 68 insertions(+)

Commit message is missing.

Greetings,
Maxime
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgBHExccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7go4AP9Fe9g8eM1q4MJo8Kt/JziOuWOF
w/F8+cVA7iBLkv4wzgEA0YxsCnFtm8CsOLkdCeJmLL5RkG5fQiUDCaAMPpo9/Qk=
=TEhW
-----END PGP SIGNATURE-----


P
P
Pierre-Henry Fröhring wrote on 7 Feb 2022 00:03
[PATCH] Add a TLDR entry for building Guix from Git.
(address . 53827@debbugs.gnu.org)(name . Pierre-Henry Fröhring)(address . contact@phfrohring.com)
20220206230321.3142016-1-contact@phfrohring.com
Add a TLDR version of the `Building from Git' section of the
Guix reference manual.

---
doc/guix-cookbook.texi | 77 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)

Toggle diff (94 lines)
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index d2ce525998..001c22f648 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -66,6 +66,7 @@ Weblate} (@pxref{Translating Guix,,, guix, GNU Guix reference manual}).
@menu
* Scheme tutorials:: Meet your new favorite language!
+* Building from Git:: Hack Guix itself
* Packaging:: Packaging tutorials
* System Configuration:: Customizing the GNU System
* Advanced package management:: Power to the users!
@@ -301,7 +302,81 @@ You'll find more books, tutorials and other resources at
@url{https://schemers.org/}.
+@c *********************************************************************
+@node Building from Git
+@chapter Building from Git
+
+Build Guix from Git and start hacking. TLDR version of:
+@pxref{Building from Git,,, guix, GNU Guix reference manual}
+
+@node Context
+@section Context
+
+@itemize
+@item
+Guix is installed using binary installation.
+@item
+Git is installed
+@end itemize
+
+@node Source
+@section Source
+
+@example
+mkdir ~/src; cd ~/src
+git clone https://git.savannah.gnu.org/git/guix.git
+@end example
+
+@node Authentication
+@section Authentication
+
+@example
+git fetch origin keyring:keyring
+guix git authenticate 9edb3f66fd807b096b48283debdcddccfea34bad \
+ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"
+@end example
+
+@node Development environment
+@section Development environment
+
+The @code{localstatedir} value is the prefix of @code{/guix/db}. For
+example, if:
+
+@example
+$ find / -type d -path "*/guix/db" 2>/dev/null
+/var/guix/db
+@end example
+
+then the value of @code{localstatedir} is @code{/var}.
+
+@example
+guix shell --pure -D guix
+./bootstrap
+./configure --localstatedir=/var
+@end example
+
+@node Compile
+@section Compile
+
+@example
+make
+make check
+exit
+@end example
+
+@node Test
+@section Test
+
+@code{./pre-inst-env} lets you distinguish between this installation of
+Guix and any other.
+
+@example
+cd ~/src/guix
+guix shell --pure -D guix
+./pre-inst-env guix build hello
+@end example
+
+
@c *********************************************************************
@node Packaging
@chapter Packaging
--
2.34.0
P
P
Pierre-Henry Fröhring wrote on 7 Feb 2022 00:10
Re: [bug#53827] [PATCH] Add a TLDR entry to the cookbook for building Guix from Git.
f5576c4687658f3b82c9dcd0340b6a275b35eef2.camel@phfrohring.com
Thank you for your comments.

An updated patch is on its way.

On Sun, 2022-02-06 at 23:09 +0100, Maxime Devos wrote:
Toggle quote (10 lines)
> Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> > ---
> >  doc/guix-cookbook.texi | 68
> > ++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 68 insertions(+)
>
> Commit message is missing.
>
> Greetings,
> Maxime
L
L
Ludovic Courtès wrote on 15 Feb 2022 10:20
Re: bug#53827: [PATCH] Add a TLDR entry to the cookbook for building Guix from Git.
(name . Maxime Devos)(address . maximedevos@telenet.be)
8735kkqydy.fsf_-_@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (12 lines)
> Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
>> +@node Building from Git
>> +@chapter Building from Git
>> +
>> +Build Guix from Git and start hacking.
>> +
>> +@node Context
>> +@section Context
>
> This is all explained in the main manual in more detail, can a cross-
> reference to ‘(guix)Building from Git’ be added?

Yes, I wonder: what do you think Pierre-Henry is wrong with the
same-named section of the manual?


It is more verbose, but the important commands are in @example boxes,
which should allow the reader to skip straight to the main parts.

WDYT?

Ludo’.
P
P
Pierre-Henry Fröhring wrote on 15 Feb 2022 11:10
(address . 53827@debbugs.gnu.org)
089df39f323ee4b4bb83b6b7e0cc8f262a9317e5.camel@phfrohring.com
Hello Ludovic,

I try to make Guix our default package manager. It's really wonderful
so far. To that end, I need TLDRs so that less experienced
developpers can get going /fast/. Deeper understanding will come in
time.

I also need to convince that Guix is /easy/ to third parties. I need
to /show/ that /installing/, /configuring/ and /using/ Guix is fast
and efficient. I found out that TLDRs are great tools for that.

I need to have small TLDRs so that when things go wrong, it's easy to
know where and fix either the TLDR or the manual steps. Also,
sometimes, things go wrong and are not documented. /E.g./ setting
~LC_ALL=C.UTF-8~ will make Guix complain even after installing ~guix
install glibc-utf8-locales~. I can factor this knowledge inside these
TLDR fast.

Now, if I compare the official documentation:


with the TLDR version of it:


Then, even after taking into account the great work accomplished in
the documentation, I find the TLDR version more convincing.

Pierre-Henry



On Tue, 2022-02-15 at 10:20 +0100, Ludovic Courtès wrote:
Toggle quote (29 lines)
> Hi,
>
> Maxime Devos <maximedevos@telenet.be> skribis:
>
> > Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> > > +@node Building from Git
> > > +@chapter Building from Git
> > > +
> > > +Build Guix from Git and start hacking.
> > > +
> > > +@node Context
> > > +@section Context
> >
> > This is all explained in the main manual in more detail, can a
> > cross-
> > reference to ‘(guix)Building from Git’ be added?
>
> Yes, I wonder: what do you think Pierre-Henry is wrong with the
> same-named section of the manual?
>
>  
> https://guix.gnu.org/manual/devel/en/html_node/Building-from-Git.html
>
> It is more verbose, but the important commands are in @example boxes,
> which should allow the reader to skip straight to the main parts.
>
> WDYT?
>
> Ludo’.
L
L
Ludovic Courtès wrote on 16 Feb 2022 14:36
(name . Pierre-Henry Fröhring)(address . contact@phfrohring.com)
877d9vx7b3.fsf_-_@gnu.org
Hi,

Pierre-Henry Fröhring <contact@phfrohring.com> skribis:

Toggle quote (16 lines)
> I try to make Guix our default package manager. It's really wonderful
> so far. To that end, I need TLDRs so that less experienced
> developpers can get going /fast/. Deeper understanding will come in
> time.
>
> I also need to convince that Guix is /easy/ to third parties. I need
> to /show/ that /installing/, /configuring/ and /using/ Guix is fast
> and efficient. I found out that TLDRs are great tools for that.
>
> I need to have small TLDRs so that when things go wrong, it's easy to
> know where and fix either the TLDR or the manual steps. Also,
> sometimes, things go wrong and are not documented. /E.g./ setting
> ~LC_ALL=C.UTF-8~ will make Guix complain even after installing ~guix
> install glibc-utf8-locales~. I can factor this knowledge inside these
> TLDR fast.

No argument here, I very much understand why as a user or potential
contributor one would want to-the-point documentation as a first step.

I also want to be able to understand what I’m doing though—maybe not at
first, but soon enough. That’s why I don’t feel comfortable giving a
raw list of commands without explanations.

But maybe we can have both, with cross references.

Thoughts?

Ludo’.
Z
Z
zimoun wrote on 16 Feb 2022 15:36
Re: [bug#53827] [PATCH] Add a TLDR entry to the cookbook for building Guix from Git.
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAJ3okZ1_4oEvfz5CFrruHPT9ChZjnHq=kjoiwVQLbcv5Hz0Btg@mail.gmail.com
Hi,

On Wed, 16 Feb 2022 at 14:39, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (28 lines)
>
> Hi,
>
> Pierre-Henry Fröhring <contact@phfrohring.com> skribis:
>
> > I try to make Guix our default package manager. It's really wonderful
> > so far. To that end, I need TLDRs so that less experienced
> > developpers can get going /fast/. Deeper understanding will come in
> > time.
> >
> > I also need to convince that Guix is /easy/ to third parties. I need
> > to /show/ that /installing/, /configuring/ and /using/ Guix is fast
> > and efficient. I found out that TLDRs are great tools for that.
> >
> > I need to have small TLDRs so that when things go wrong, it's easy to
> > know where and fix either the TLDR or the manual steps. Also,
> > sometimes, things go wrong and are not documented. /E.g./ setting
> > ~LC_ALL=C.UTF-8~ will make Guix complain even after installing ~guix
> > install glibc-utf8-locales~. I can factor this knowledge inside these
> > TLDR fast.
>
> No argument here, I very much understand why as a user or potential
> contributor one would want to-the-point documentation as a first step.
>
> I also want to be able to understand what I’m doing though—maybe not at
> first, but soon enough. That’s why I don’t feel comfortable giving a
> raw list of commands without explanations.

For what it is worth, I wrote a version for some users here:


The manual is good (even really good!) once I am able to explicitly
formulate what I want. That's the job of the Cookbook (or any other
materials): fill the gap, IMHO.

Cheers,
simon
P
P
Pierre-Henry Fröhring wrote on 16 Feb 2022 16:50
Re: bug#53827: [PATCH] Add a TLDR entry to the cookbook for building Guix from Git.
(name . Ludovic Courtès)(address . ludo@gnu.org)
ED0CDD22-5311-41C5-A0B1-85F53AFB2019@phfrohring.com
Envoyé de mon iPhone

Toggle quote (28 lines)
> Le 16 févr. 2022 à 14:36, Ludovic Courtès <ludo@gnu.org> a écrit :
>
> ?Hi,
>
> Pierre-Henry Fröhring <contact@phfrohring.com> skribis:
>
>> I try to make Guix our default package manager. It's really wonderful
>> so far. To that end, I need TLDRs so that less experienced
>> developpers can get going /fast/. Deeper understanding will come in
>> time.
>>
>> I also need to convince that Guix is /easy/ to third parties. I need
>> to /show/ that /installing/, /configuring/ and /using/ Guix is fast
>> and efficient. I found out that TLDRs are great tools for that.
>>
>> I need to have small TLDRs so that when things go wrong, it's easy to
>> know where and fix either the TLDR or the manual steps. Also,
>> sometimes, things go wrong and are not documented. /E.g./ setting
>> ~LC_ALL=C.UTF-8~ will make Guix complain even after installing ~guix
>> install glibc-utf8-locales~. I can factor this knowledge inside these
>> TLDR fast.
>
> No argument here, I very much understand why as a user or potential
> contributor one would want to-the-point documentation as a first step.
>
> I also want to be able to understand what I’m doing though—maybe not at
> first, but soon enough. That’s why I don’t feel comfortable giving a
> raw list of commands without explanations.
Agreed.
Toggle quote (2 lines)
>
> But maybe we can have both, with cross references.
Yes! It’s implicit in our workflow, the documentation _is_ the reference.
Toggle quote (2 lines)
>
> Thoughts?
Yes. I can add cross references in the patch and in the so called transient.blog
Toggle quote (2 lines)
>
> Ludo’.
L
L
Leo Famulari wrote on 16 Feb 2022 17:16
Re: [bug#53827] [PATCH] Add a TLDR entry to the cookbook for building Guix from Git.
(name . Ludovic Courtès)(address . ludo@gnu.org)
Yg0jW49BK4VHlv/S@jasmine.lan
On Wed, Feb 16, 2022 at 02:36:00PM +0100, Ludovic Court�s wrote:
Toggle quote (2 lines)
> But maybe we can have both, with cross references.

Sure, but we'll have to increase our efforts to maintain the cookbook.

So far, we seem to forgot to update it to reflect changes in Guix, while
we do try to keep the manual in sync with the codebase.

Instead, we could put the TLDR at the beginning of the manual section
Building From Git, and then we'll have less trouble remembering to
update it.
P
P
Pierre-Henry Fröhring wrote on 16 Feb 2022 21:37
4a7c8f65adbfb1a820775d5f34344dfea4320f4a.camel@phfrohring.com
Toggle quote (11 lines)
> Sure, but we'll have to increase our efforts to maintain the
> cookbook.
>
> So far, we seem to forgot to update it to reflect changes in Guix,
> while
> we do try to keep the manual in sync with the codebase.
>
> Instead, we could put the TLDR at the beginning of the manual section
> Building From Git, and then we'll have less trouble remembering to
> update it.

Agreed. This would have been useful.
L
L
Ludovic Courtès wrote on 17 Feb 2022 11:38
(name . Leo Famulari)(address . leo@famulari.name)
87iltdok1g.fsf@gnu.org
Leo Famulari <leo@famulari.name> skribis:

Toggle quote (12 lines)
> On Wed, Feb 16, 2022 at 02:36:00PM +0100, Ludovic Courtès wrote:
>> But maybe we can have both, with cross references.
>
> Sure, but we'll have to increase our efforts to maintain the cookbook.
>
> So far, we seem to forgot to update it to reflect changes in Guix, while
> we do try to keep the manual in sync with the codebase.
>
> Instead, we could put the TLDR at the beginning of the manual section
> Building From Git, and then we'll have less trouble remembering to
> update it.

Sure, why not.

Thanks,
Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 53827@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 53827
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch