unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mikhail Kryshen <mikhail@kryshen.net>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>,
	Guix-devel <guix-devel@gnu.org>
Subject: Re: qt-build-system: prefix or suffix env-variables in wrap-program
Date: Tue, 17 Dec 2019 19:56:21 +0300	[thread overview]
Message-ID: <87fthidh6y.fsf@e6230.localdomain> (raw)
In-Reply-To: <2dd04e9b-2988-6415-c7ec-df4a6ef91920@crazy-compilers.com>

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

Sorry for the late reply.

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 11.12.19 um 21:25 schrieb Mikhail Kryshen:
>> So the correct way to extend XDG_DATA_DIRS would be
>>
>>   export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:/gnu/store/…-kate-…"
>
> I'm quite confident, adding /usr/share etc. here as default would be
> wrong from a guix point of view: This would break isolation of
> environments. On a foreign distribution this would even give the foreign
> distribution's installation precedence over guix's.

The problem is that conforming programs treat empty or unset
XDG_DATA_DIRS as "/usr/local/share/:/usr/share/", for such programs
XDG_DATA_DIRS="" and XDG_DATA_DIRS="/usr/local/share/:/usr/share/" are
equivalent, and thus their extensions should be equivalent too.  Empty
or unset XDG_DATA_DIRS already breaks isolation: when it is empty, it
means (according to the spec) that programs are supposed to refer to
/usr in the current environment.  Because of this, I think that in pure
Guix environment XDG_*_DIRS variables should never be left unset (and so
/usr will not be referred to implicitly and will not appear in the
extended value).

Overriding the value (including the implicit
"/usr/local/share/:/usr/share/") will cause problems when wrapped
program launches a non-guix program from the host system (e.g. MUA
opening an attachment) that will inherit its environment.

> Anyway: Let me ask my question differently: Should the user be able to
> *overrule* or only to *extend* guix's installation?

Allowing to overrule will be problematic, because XDG_*_DIRS may be set
by the system and include directories with conflicting files (e.g. from
different version of the same program installed in the system profile or
in the host non-guix system).

So I suggest prefixing XDG_*_DIRS like this:

  XDG_DATA_DIRS="/gnu/store/…:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}"

So the added path gets higher priority, and the other paths are
preserved, including the implicit "/usr/local/share/:/usr/share/" in
case of initially empty variable.

--
Mikhail

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

      reply	other threads:[~2019-12-17 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  8:33 qt-build-system: prefix or suffix env-variables in wrap-program Hartmut Goebel
2019-12-11 20:25 ` Mikhail Kryshen
2019-12-14 17:26   ` Hartmut Goebel
2019-12-17 16:56     ` Mikhail Kryshen [this message]

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87fthidh6y.fsf@e6230.localdomain \
    --to=mikhail@kryshen.net \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).