all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Package request inxi
Date: Thu, 12 Apr 2018 01:53:34 -0700	[thread overview]
Message-ID: <87muy8dcvl.fsf@gmail.com> (raw)
In-Reply-To: <873700hoq4.fsf@gmail.com> (Pierre Neidhardt's message of "Thu, 12 Apr 2018 12:54:03 +0530")

[-- Attachment #1: Type: text/plain, Size: 2134 bytes --]

Pierre Neidhardt <ambrevar@gmail.com> writes:

> Basically inxi sets a 'paths' variable with the usual Unix paths and
> then forces the environment PATH to the same value.
>
> My suggestion instead: set 'paths' to /run/current-system/* and
> ~/.guix-profile/{sbin,bin}.
>
> What do you think?  Is this generic enough?  Is ~/.guix-profile a
> guaranteed location for the user profile?

No, ~/.guix-profile is not guaranteed.  Users can and do create profiles
in various places, e.g. with "guix package -p my-profile -i hello".  In
addition, /run/current-system/* would not work on foreign distros.

Is inxi a program, or a library?  If it's a program, then a better
solution is to bind PATH to the required dependencies at build time.  An
easy way to accomplish that would be to use the wrap-program procedure
from (guix build utils).  Read its docstring and grep for wrap-program
in the gnu/packages directories to see how it's used.  The basic idea is
that we can create a wrapper script for inxi which launches inxi in an
environment where PATH is set to exactly the things it needs.

There are other ways to accomplish the same thing.  For example, we
could replace references in the source code with references that point
to precisely the things required.  Generally we would add or modify a
build phase to accomplish this; read the docstring for the substitute*
procedure (also defined in (guix build utils) and grep for it in the
gnu/packages directories to see this technique in action.

Inxi has been written, like much software, to be composed with other
software at runtime; the composition is normally achieved via
environment variables.  The techniques above allow us to compose inxi
with its dependencies at build time, which is desirable because it means
that the built program will behave the same on my machine as it does on
yours, regardless of how my environment is configured.  This is known as
"static composition" of software components (see Section 7.1.1,
"Principles", in the Nix thesis [1]).

Footnotes: 
[1]  https://nixos.org/~eelco/pubs/phd-thesis.pdf

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-04-12  8:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:02 Package requests: fortune, gifsicle, inxi, uncrustify, unrar, vsftp, xss-lock Pierre Neidhardt
2018-03-28 15:27 ` Package request inxi Oleg Pykhalov
2018-03-28 17:26   ` Pierre Neidhardt
2018-04-11 16:17     ` Pierre Neidhardt
2018-04-11 17:23       ` Oleg Pykhalov
2018-04-11 17:29         ` Pierre Neidhardt
2018-04-11 17:34           ` Pierre Neidhardt
2018-04-11 18:14             ` Oleg Pykhalov
2018-04-12  7:15               ` Pierre Neidhardt
2018-04-12  7:24                 ` Pierre Neidhardt
2018-04-12  8:53                   ` Chris Marusich [this message]
2018-04-12  9:09                     ` Pierre Neidhardt
2018-04-11 17:42           ` Oleg Pykhalov
2018-04-12  5:29             ` Pierre Neidhardt
2018-04-12  8:25       ` Chris Marusich
2018-04-12  8:39         ` Pierre Neidhardt
2018-04-12 17:07           ` inxi and inxi-full Oleg Pykhalov
2018-04-12 17:19             ` Pierre Neidhardt
2018-04-13  3:41               ` Chris Marusich
2018-04-13  4:00                 ` Pierre Neidhardt
2018-04-13  5:11                   ` Chris Marusich
2018-04-13  5:52                     ` Pierre Neidhardt
2018-04-13  6:13                       ` Chris Marusich
2018-04-13  6:24                         ` Pierre Neidhardt
2018-04-14  6:22                           ` Pierre Neidhardt
2018-04-16  6:59                             ` Chris Marusich
2018-04-16  7:16                               ` Pierre Neidhardt
2018-04-16 10:26                               ` gnu: Add inxi (old Shell script version) Oleg Pykhalov
2018-04-16 10:31                                 ` Pierre Neidhardt
2018-03-31  5:15 ` Package requests: fortune, gifsicle, inxi, uncrustify, unrar, vsftp, xss-lock Pierre Neidhardt
2018-04-01 12:15   ` Pierre Neidhardt
2018-04-12 13:04 ` Ricardo Wurmus
2018-04-12 17:00   ` Leo Famulari
2018-04-12 17:13 ` Clément Lassieur
2018-04-12 17:17   ` Pierre Neidhardt
2018-04-12 17:23     ` Marius Bakke
2018-04-12 17:34       ` Pierre Neidhardt
2018-04-12 17:41       ` Clément Lassieur
2018-04-12 17:53         ` Pierre Neidhardt
2018-04-21 19:18     ` File sharing with GNU Guix (was: Re: Package requests: fortune, gifsicle, inxi, uncrustify, unrar, vsftp, xss-lock) Chris Marusich
2018-04-22  5:58       ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muy8dcvl.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=ambrevar@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.