From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#20255: 'search-paths' should respect both user and system profile. Date: Sat, 21 Nov 2015 21:10:17 +0100 Message-ID: <87wptb5d1y.fsf@gnu.org> References: <877ftschjt.fsf@gmail.com> <87fv8fip01.fsf@gnu.org> <87d23j1bxk.fsf@gmail.com> <871tjyfnl8.fsf@gnu.org> <876199q4z1.fsf@gmail.com> <87ioca4ojo.fsf@gnu.org> <87lh9tvcws.fsf@gnu.org> <87h9kguwc4.fsf@gmail.com> <87ziy7d90z.fsf@gnu.org> <874mgfkxee.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0EV0-0002L6-3k for bug-guix@gnu.org; Sat, 21 Nov 2015 15:11:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0EUw-0004Yx-Sn for bug-guix@gnu.org; Sat, 21 Nov 2015 15:11:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0EUw-0004Yt-PG for bug-guix@gnu.org; Sat, 21 Nov 2015 15:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a0EUw-0007ev-CZ for bug-guix@gnu.org; Sat, 21 Nov 2015 15:11:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <874mgfkxee.fsf@gmail.com> (Alex Kost's message of "Sat, 21 Nov 2015 21:41:45 +0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Alex Kost Cc: 20255@debbugs.gnu.org Alex Kost skribis: > Ludovic Court=C3=A8s (2015-11-21 11:57 +0300) wrote: > >> Alex Kost skribis: >> >>> Ludovic Court=C3=A8s (2015-11-20 01:32 +0300) wrote: >>> >>>> -# Load the system profile's settings. >>>> +if [ -x /run/current-system/profile/bin/guix ] >>>> +then >>>> + # Crucial variables such as 'MANPATH' or 'INFOPATH' may be missing = from the >>>> + # profiles' individual 'etc/profile'. Thus, combine both profiles = when >>>> + # computing the search paths. >>>> + # >>>> + # This may take a few hundred milliseconds, but it's OK because thi= s is >>>> + # performed for log-in shells only. >>>> + eval `/run/current-system/profile/bin/guix package \\ >>>> + -p /run/current-system/profile \\ >>>> + -p \"$HOME/.guix-profile\" --search-paths` >>> >>> Sorry, but it's not OK for me. As a user, I'm *strongly* against >>> running 'guix' (or any other program) in /etc/profile. >> >> Why? (Honest question.) > > At first, because of the slowdown: it may be a few hundred milliseconds > for you, but it's several seconds for me. Really? Can you show the output of: time guix package -p /run/current-system/profile \ -p ~/.guix-profile --search-paths ? > But actually, even if it was several milliseconds, I still wouldn't > like it, as (IMHO) /etc/profile should only set variables, and not run > external programs. I don=E2=80=99t buy this =E2=80=9Cprinciple=E2=80=9D: /etc/profile is a pro= gram, and the output of --search-paths is trusted to contain only environment variable setting. In the discussion of this bug, we tried hard to avoid resorting to invoking a program, but ultimately no other solution came out. >>> I would really like to have an option to avoid this. Is it possible? >> >> Not that I know of. Please read . > > What about making some environment variable which will be honored by > 'operating-system-etc-service' procedure. So depending on this variable > that 'eval ...' command will or will not be added to "/etc/profile" > during 'guix system ...' process. > > For example, when I do: > > GUIX_IGNORE_SYSTEM_PROFILE_ENV=3D1 guix system build my-config.scm > > the "etc/profile" of the built system will not contain those 'eval ...' > lines. WDYT? This would be unreasonable. We=E2=80=99re talking about a basic feature he= re. If basic features are broken to the point that we prefer to offer ways to bypass them, and have a semi-broken system, then there=E2=80=99s a probl= em, IMO. Ludo=E2=80=99.