[PATCH] website: Add post about guix shell fhs option.

  • Done
  • quality assurance status badge
Details
3 participants
  • John Kehayias
  • Ludovic Courtès
  • jman
Owner
unassigned
Submitted by
John Kehayias
Severity
normal
J
L
L
Ludovic Courtès wrote on 26 Dec 2022 00:58
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 60112@debbugs.gnu.org)
87lemvujbo.fsf@gnu.org
Hi John,

I’m seeing this only now, apologies! (I thought the discussion was
continuing in the guix-devel thread, my bad. :-/)

John Kehayias <john.kehayias@protonmail.com> skribis:

Toggle quote (8 lines)
> From e13d5a92a98680bf0d0b30fbd124a5e7725f7475 Mon Sep 17 00:00:00 2001
> From: John Kehayias <john.kehayias@protonmail.com>
> Date: Fri, 16 Dec 2022 02:22:17 -0500
> Subject: [PATCH] website: Add post about guix shell fhs option.
>
> * website/posts/guix-shell-fhs.md: New file.
> website/static/blog/img/guix-shell-fhs.gif: New file.

Overall looks great to me and pretty much ready to go. Minor
suggestions.

Toggle quote (5 lines)
> +++ b/website/posts/guix-shell-fhs.md
> @@ -0,0 +1,140 @@
> +title: FHS Comes to Guix Containers


Should we spell “FHS” out?

Toggle quote (2 lines)
> +GNU Guix is different from most other GNU/Linux distributions and perhaps nowhere is that more obvious than the organization of the filesystem: Guix does not conform to the [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/fhs.shtml)(FHS). In practical terms, this means there is no global `/lib` containing libraries, `/bin` containing binaries, sup a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink" 1 /a /sup and so on. This is very much at the core of how Guix works and some of the convenient features, like per-user installation of programs (different versions, for instance) and a declarative system configuration where the system is determined from a configuration file.

Haunt uses Guile-Commonmark, and I don’t think we can use inline HTML
nor footnotes actually. A bit of a bummer, but maybe you can
approximate that with:

`/bin` containing binaries¹, …

and at the bottom:

¹ Blah.

It might be worth mentioning somewhere that the feature is included in
the just-released 1.4.0 now.

Toggle quote (14 lines)
> +Here is a very simple example:
> +
> + $ guix shell --container --emulate-fhs coreutils -- ls /bin | head
> + [
> + b2sum
> + base32
> + base64
> + basename
> + basenc
> + cat
> + catchsegv
> + chcon
> + chgrp

Example examples in triple backquotes (i.e., ```), without extra
indentation.

Toggle quote (2 lines)
> +[![img](guix-shell-fhs.gif "Or, if you like to see it more in motion, here's a gif.")](guix-shell-fhs.gif)

The syntax is:

![Alt text.](/static/blog/img/…)

Note that the alt text is not shown unless one disables pictures or
hovers over the picture. So “Or, if you like […]” should probably be
written above the image.

You can test the web site with:

guix shell

and then:

export GUIX_WEB_SITE_LOCAL=y
haunt build
haunt serve

Should we publish it after Jan. 1st, since people are more likely to
miss it during the holiday season?

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 3 Jan 2023 23:54
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 60112@debbugs.gnu.org)
87wn635iw7.fsf_-_@gnu.org
Hello!

ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (3 lines)
> Should we publish it after Jan. 1st, since people are more likely to
> miss it during the holiday season?

FWIW I think now would be a good time to publish. Lemme know if/when
you have time for those final touches!

Thanks,
Ludo’.
J
J
John Kehayias wrote on 4 Jan 2023 00:07
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 60112@debbugs.gnu.org)
87fscrb4ks.fsf@protonmail.com
Hi,

On Tue, Jan 03, 2023 at 11:54 PM, Ludovic Courtès wrote:

Toggle quote (11 lines)
> Hello!
>
> ludovic Courtès <ludo@gnu.org> skribis:
>
>> Should we publish it after Jan. 1st, since people are more likely to
>> miss it during the holiday season?
>
> FWIW I think now would be a good time to publish. Lemme know if/when
> you have time for those final touches!
>

Yes, I think now will be a good time. Sorry I didn't get to this earlier (some unfortunate urgent situations), but I did make most of the changes already. I think just the footnotes, or rewriting them into the text, is all that's left.

Is there anything else I should add, like other images or screen recordings? I think I'll quickly test and add the Tor browser example mentioned on the mailing list at least.

John
L
L
Ludovic Courtès wrote on 4 Jan 2023 11:31
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 60112@debbugs.gnu.org)
87mt6y616t.fsf_-_@gnu.org
Hi!

John Kehayias <john.kehayias@protonmail.com> skribis:

Toggle quote (2 lines)
> Yes, I think now will be a good time. Sorry I didn't get to this earlier (some unfortunate urgent situations), but I did make most of the changes already. I think just the footnotes, or rewriting them into the text, is all that's left.

Cool!

Toggle quote (2 lines)
> Is there anything else I should add, like other images or screen recordings? I think I'll quickly test and add the Tor browser example mentioned on the mailing list at least.

The Tor Browser example would be nice. No other suggestions from me!

Thanks,
Ludo’.
J
J
John Kehayias wrote on 4 Jan 2023 18:43
Re: bug#60112: [PATCH v2] website: Add post about guix shell fhs option.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 60112@debbugs.gnu.org)
87h6x6jivq.fsf@protonmail.com
Hello,

On Wed, Jan 04, 2023 at 11:31 AM, Ludovic Courtès wrote:

Toggle quote (3 lines)
> The Tor Browser example would be nice. No other suggestions from me!
>

Added, with a slight tweak from the original mailing list message (and with credit given). The gcc:lib input is smaller than libgccjit and I believe the DISPLAY/XAUTHORITY sharing is more general (or at least works for me, the original related to GDM which I don't use).

From your previous comments:

On Mon, Dec 26, 2022 at 12:58 AM, Ludovic Courtès wrote:

Toggle quote (7 lines)
>> +++ b/website/posts/guix-shell-fhs.md
>> @@ -0,0 +1,140 @@
>> +title: FHS Comes to Guix Containers
>
> Should we spell “FHS” out?
>

I did now, which is more descriptive and I don't think too long. I didn't include the (FHS) abbreviation though (we could).

Toggle quote (21 lines)
>> +GNU Guix is different from most other GNU/Linux distributions and perhaps nowhere is
>> that more obvious than the organization of the filesystem: Guix does not conform to the
>> [Filesystem Hierarchy Standard](<https://refspecs.linuxfoundation.org/fhs.shtml>) (FHS).
>> In practical terms, this means there is no global `/lib` containing libraries, `/bin`
>> containing binaries,<sup><a id="fnr.1" class="footref" href="#fn.1"
>> role="doc-backlink">1</a></sup> and so on. This is very much at the core of how Guix
>> works and some of the convenient features, like per-user installation of programs
>> (different versions, for instance) and a declarative system configuration where the
>> system is determined from a configuration file.
>
> Haunt uses Guile-Commonmark, and I don’t think we can use inline HTML
> nor footnotes actually. A bit of a bummer, but maybe you can
> approximate that with:
>
> `/bin` containing binaries¹, …
>
> and at the bottom:
>
> ¹ Blah.
>

Ah. I did just that, no links to jump back and forth then. The second note I could just have as a parenthetical paragraph, but the first would be a bit cluttered. So I kept them both as notes, but I'm not attached to the style if we want to change it.

Toggle quote (4 lines)
> It might be worth mentioning somewhere that the feature is included in
> the just-released 1.4.0 now.
>

Good idea, noted and linked to the release announcement post.

Toggle quote (18 lines)
>> +Here is a very simple example:
>> +
>> + $ guix shell --container --emulate-fhs coreutils -- ls /bin | head
>> + [
>> + b2sum
>> + base32
>> + base64
>> + basename
>> + basenc
>> + cat
>> + catchsegv
>> + chcon
>> + chgrp
>
> Example examples in triple backquotes (i.e., ```), without extra
> indentation.
>

Fixed (guess the org exporter defaulted to a different style). I didn't see any change in appearance with marking all of these as 'sh' examples, but added that in case it is useful at some point.

Toggle quote (12 lines)
>> +[![img](guix-shell-fhs.gif "Or, if you like to see it more in motion, here's a
>> gif.")](guix-shell-fhs.gif)
>
> The syntax is:
>
> ![Alt text.](/static/blog/img/…)
>
> Note that the alt text is not shown unless one disables pictures or
> hovers over the picture. So “Or, if you like […]” should probably be
> written above the image.
>

Correct, that was supposed to be a caption or before the image. Fixed and added credit for the image.

Toggle quote (11 lines)
> You can test the web site with:
>
> guix shell
>
> and then:
>
> export GUIX_WEB_SITE_LOCAL=y
> haunt build
> haunt serve
>

Thanks, that was handy.

Other than these fixes, adding the Tor Browser example, and some stylistic changes (added some links too), the content should be basically the same as the first version.

Happy to add/subtract anything and anything else if anyone has suggestions.

John
J
J
John Kehayias wrote on 4 Jan 2023 19:23
Re: bug#60112: [PATCH v3] website: Add post about guix shell fhs option.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 60112@debbugs.gnu.org)
87cz7ujh0b.fsf@protonmail.com
Slight tweak to the Tor Browser example and just using 'expose' rather than 'share' for XAUTHORITY, as discussed on guix-devel. I tested VSCodium and Tor with that last change and they opened just fine.

Also added a brief comment about the more minimal inputs for the Tor example and how one usually finds it (a lot of trial and error usually).
J
Re: Drafting a Guix blog post on the FHS container
(address . 60112@debbugs.gnu.org)
87lemiyx4d.fsf@city17.xyz
Hello and sorry for getting into this comment thread.

I have posted a few days ago a question about preserving env vars
when creating a container with FHS emulation:

I think it's something about me not understanding how it works. By
reading my question, is there anything useful to add to the blog post to
clarify its usage?

If not, simply discard this comment :-)

thanks
L
L
Ludovic Courtès wrote on 5 Jan 2023 22:00
Re: bug#60112: [PATCH] website: Add post about guix shell fhs option.
(name . jman)(address . srht@city17.xyz)
87pmbs3de0.fsf_-_@gnu.org
Hi jman,

jman <srht@city17.xyz> skribis:

Toggle quote (6 lines)
> Hello and sorry for getting into this comment thread.
>
> I have posted a few days ago a question about preserving env vars
> when creating a container with FHS emulation:
> https://lists.gnu.org/archive/html/help-guix/2023-01/msg00002.html

The ‘PATH’ environment variable, and only this one, is overridden
unconditionally when using ‘--emulate-fhs’; quoth ‘environment.scm’:

(when emulate-fhs?
;; When running in a container with EMULATE-FHS?, override $PATH
;; (optional, but to better match FHS expectations), and generate
;; /etc/ld.so.cache.
(setenv "PATH" "/bin:/usr/bin:/sbin:/usr/sbin")
(invoke "ldconfig" "-X"))

Other variables are preserved, as in this example:

Toggle snippet (4 lines)
$ FOO=bar guix shell -CF -E ^FOO coreutils -- env | grep FOO
FOO=bar

HTH!

Ludo’.
J
J
John Kehayias wrote on 5 Jan 2023 22:03
(name . Ludovic Courtès)(address . ludo@gnu.org)
878rigk82r.fsf@protonmail.com
On Thu, Jan 05, 2023 at 10:00 PM, Ludovic Courtès wrote:

Toggle quote (29 lines)
> Hi jman,
>
> jman <srht@city17.xyz> skribis:
>
>> Hello and sorry for getting into this comment thread.
>>
>> I have posted a few days ago a question about preserving env vars
>> when creating a container with FHS emulation:
>> <https://lists.gnu.org/archive/html/help-guix/2023-01/msg00002.html>
>
> The ‘PATH’ environment variable, and only this one, is overridden
> unconditionally when using ‘--emulate-fhs’; quoth ‘environment.scm’:
>
> (when emulate-fhs?
> ;; When running in a container with EMULATE-FHS?, override $PATH
> ;; (optional, but to better match FHS expectations), and generate
> ;; /etc/ld.so.cache.
> (setenv "PATH" "/bin:/usr/bin:/sbin:/usr/sbin")
> (invoke "ldconfig" "-X"))
>
> Other variables are preserved, as in this example:
>
> $ FOO=bar guix shell -CF -E ^FOO coreutils -- env | grep FOO
> FOO=bar
>
> HTH!
>
> Ludo’.

Now filed by jman as https://issues.guix.gnu.org/60566 after discussion on #guix. I think it is a bug (say you want to preserve PATH as you have some scripts in ~/.local/bin for example) and I have a patch to fix. I'll send it to that bug and CC you (Ludo’) as well.

John
L
L
Ludovic Courtès wrote on 6 Jan 2023 13:49
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 60112@debbugs.gnu.org)
875ydjzv2u.fsf_-_@gnu.org
Howdy,

John Kehayias <john.kehayias@protonmail.com> skribis:

Toggle quote (8 lines)
> From 79eed4b16c56adbdfddd5f516c793599d54d8d4f Mon Sep 17 00:00:00 2001
> From: John Kehayias <john.kehayias@protonmail.com>
> Date: Fri, 16 Dec 2022 02:22:17 -0500
> Subject: [PATCH] website: Add post about guix shell fhs option.
>
> * website/posts/guix-shell-fhs.md: New file.
> website/static/blog/img/guix-shell-fhs.gif: New file.

Wonderful. It’s on-line now, spread the word!


Thanks for your work and for your patience!

Ludo’.
L
L
Ludovic Courtès wrote on 6 Jan 2023 13:50
control message for bug #60112
(address . control@debbugs.gnu.org)
874jt3zv2c.fsf@gnu.org
close 60112
quit
?