diff mbox series

[bug#53827] Add a TLDR entry to the cookbook for building Guix from Git.

Message ID 20220206213344.3117861-1-contact@phfrohring.com
State New
Headers show
Series [bug#53827] Add a TLDR entry to the cookbook for building Guix from Git. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Pierre-Henry Fröhring Feb. 6, 2022, 9:33 p.m. UTC
---
 doc/guix-cookbook.texi | 68 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

2.34.0

Comments

M Feb. 6, 2022, 10:02 p.m. UTC | #1
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?
M Feb. 6, 2022, 10:02 p.m. UTC | #2
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> +@code{./pre-inst-env} let's you distinguish between this installation of

"lets", not "let's"
M Feb. 6, 2022, 10:03 p.m. UTC | #3
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> +guix environment guix --pure

Nowadays it's "guix shell":

"guix shell --pure -D guix"
M Feb. 6, 2022, 10:06 p.m. UTC | #4
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> +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.

> +./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

> +@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.
M Feb. 6, 2022, 10:07 p.m. UTC | #5
Pierre-Henry Fröhring schreef op zo 06-02-2022 om 22:33 [+0100]:
> +cd ~/src

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

> +git clone https://git.savannah.gnu.org/git/guix.git

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

Greetings,
Maxime.
M Feb. 6, 2022, 10:09 p.m. UTC | #6
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
Pierre-Henry Fröhring Feb. 6, 2022, 11:10 p.m. UTC | #7
Thank you for your comments.

An updated patch is on its way.

On Sun, 2022-02-06 at 23:09 +0100, Maxime Devos wrote:
> 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
Ludovic Courtès Feb. 15, 2022, 9:20 a.m. UTC | #8
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’.
Pierre-Henry Fröhring Feb. 15, 2022, 10:10 a.m. UTC | #9
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:

  https://guix.gnu.org/manual/devel/en/html_node/Building-from-Git.html

with the TLDR version of it:

 
https://transient.blog/1/tutoriel-guix-devel/ea10580e-9750-463a-aff4-9a3e90809ad4/54fcc4f606

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:
> 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’.
Ludovic Courtès Feb. 16, 2022, 1:36 p.m. UTC | #10
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.

But maybe we can have both, with cross references.

Thoughts?

Ludo’.
Simon Tournier Feb. 16, 2022, 2:36 p.m. UTC | #11
Hi,

On Wed, 16 Feb 2022 at 14:39, Ludovic Courtès <ludo@gnu.org> wrote:
>
> 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:

<https://simon.tournier.info/posts/2021-10-12-add-guix-package.html>

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
Pierre-Henry Fröhring Feb. 16, 2022, 3:50 p.m. UTC | #12
Envoyé de mon iPhone

> 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.
> 
> But maybe we can have both, with cross references.
Yes! It’s implicit in our workflow, the documentation _is_ the reference.
> 
> Thoughts?
Yes. I can add cross references in the patch and in the so called transient.blog
> 
> Ludo’.
Leo Famulari Feb. 16, 2022, 4:16 p.m. UTC | #13
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.
Pierre-Henry Fröhring Feb. 16, 2022, 8:37 p.m. UTC | #14
> 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.
Ludovic Courtès Feb. 17, 2022, 10:38 a.m. UTC | #15
Leo Famulari <leo@famulari.name> skribis:

> 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’.
diff mbox series

Patch

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
--