GNU bug report logs - #36021
[PATCH] search-paths: 'environment-variable-definition' output for fish

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Dan Frumin <dfrumin@HIDDEN>; Keywords: patch; dated Fri, 31 May 2019 10:37:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 4 Jun 2019 07:48:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 04 03:48:20 2019
Received: from localhost ([127.0.0.1]:43801 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hY4B9-0007po-L2
	for submit <at> debbugs.gnu.org; Tue, 04 Jun 2019 03:48:20 -0400
Received: from smtp2.science.ru.nl ([131.174.16.145]:47376)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dfrumin@HIDDEN>) id 1hY4B6-0007pb-5Z
 for 36021 <at> debbugs.gnu.org; Tue, 04 Jun 2019 03:48:17 -0400
Received: from [192.168.1.31] (ip565a9ee0.direct-adsl.nl [86.90.158.224] (may
 be forged)) (authen=dfrumin)
 by smtp2.science.ru.nl (8.14.4/5.32) with ESMTP id x547mDBX027144
 for <36021 <at> debbugs.gnu.org>; Tue, 4 Jun 2019 09:48:13 +0200
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
To: 36021 <at> debbugs.gnu.org
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN> <87o93fkyhs.fsf@HIDDEN>
 <cf1f869c-78c3-68c3-d2ec-4b8faa31cb70@HIDDEN> <87muiy0zxd.fsf@HIDDEN>
From: Dan Frumin <dfrumin@HIDDEN>
Message-ID: <7f3c985d-2f61-e148-0438-d1dbee2df899@HIDDEN>
Date: Tue, 4 Jun 2019 09:48:13 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.7.0
MIME-Version: 1.0
In-Reply-To: <87muiy0zxd.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36021
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

On 04-06-19 05:53, Meiyo Peng wrote:
> Hi Dan,
> 
> Dan Frumin writes:
> 
>>>> Some background on this patch:
>>>> Right now whenever I do any Guix operation that requires me to modify
>>>> environment variables (e.g. installing a Guile library requires me to update
>>>> $GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run
>>>> to update the variables.
>>>>
>>>> However, those commands are currently in bash/POSIX(?) format `export
>>>> VAR=VALUE`. I've modified the `environment-variable-definition` function to
>>>> support the syntax for Fish shell as well. I don't know if this method of
>>>> looking at the $SHELL variable is sound, but it works  on my machine.
>>>>
>>>> Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set
>>>>
>>>> PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch
>>>
>>> I think this patch will cause more trouble than good.  Does this patch
>>> replaces etc/profile with fish syntax script?  etc/profile is supposed
>>> to be in POSIX shell syntax.  Fish shell has it's own configuration
>>> files in /etc/fish/config.fish and /etc/fish/conf.d/*.fish.  If you
>>> really want to generate fish syntax scripts, please put them in
>>> /etc/fish/config.fish or /etc/fish/conf.d/*.fish.
>>>
>>
>> No, this patch doesn't touch etc/profile in any way, it is only concerned with the output that you get from `guix package` on your terminal.
>> So I guess it's kind of orthogonal to the upgraded fish package that you made?
> 
> Alright.  Then that's fine.  But there is an on going discussion about
> change content of the message in bug #35942.  I suggest we hold this
> patch until that bug is closed.
> 


Sure, makes sense to me.

>>> See:
>>> 1. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00071.html
>>> 2. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00333.html
>>> 3. https://issues.guix.gnu.org/issue/34153
>>>
>>> Have you tried the fish-foreign-env package?  You can source bash
>>> scripts in fish via `fenv source ~/.guix-profile/etc/profile`.  That's how
>>> the fish shell in Guix set up environment variables upon login.
>>>
>>
>> Thanks! This is quite nice, I should upgrade my Fish installation.
> 
> Your fish shell is quite old.  Older than Guix 1.0.0!
> 
>>> Perhaps we can handle this better.  Do you have any suggestions?  My
>>> idea:
>>>
>>> 1. The fish-foreign-env package is very useful but it's not installed by
>>> default in order to avoid polluting user's profiles according to the
>>> Guix convention.  In this case I think it's a useful utility rather than
>>> pollution.  Do you want it to be installed together with the fish
>>> package by default?
>>
>> Well, you added it as part of the fish dependency, right? I think it makes sense, especially on Guix SD.
> 
> Yes, it's a dependency of fish.  But it's not a propagated input.  We
> can change it into a propagated input if most users agree.
> 
>>> 2. etc/profile is supposed to be sourced by a login shell.  And we
>>> should avoid sourcing it from a non-login shell.  That's why I made the
>>> fish package in Guix only sources it upon login.  That means starting a
>>> new fish shell won't source it automatically.  So please source it
>>> manually if you need the new environment variables (fenv source
>>> ~/.guix-profile/etc/profile).
>>
>> I am not knowledgeable enough to comment on this, but it seems to me that it is
>> done similarly if you are using bash: e.g. you have to source the profile
>> yourself if you want to get it in a non-login shell.
>>
>>>
>>> 3. We can write better documentations explaining how to deal with fish
>>> shell in Guix.  There's an old discussion about having a Guix wiki or
>>> a Guix book.
>>>
>>
>> Yeah, more documentation is always better :)
> 
> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/
> 




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 4 Jun 2019 03:53:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 03 23:53:53 2019
Received: from localhost ([127.0.0.1]:43602 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hY0WG-0008Nf-TO
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2019 23:53:53 -0400
Received: from mx1.riseup.net ([198.252.153.129]:37884)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <meiyo@HIDDEN>) id 1hY0WC-0008NV-PN
 for 36021 <at> debbugs.gnu.org; Mon, 03 Jun 2019 23:53:50 -0400
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.riseup.net (Postfix) with ESMTPS id D61D91A46B4;
 Mon,  3 Jun 2019 20:53:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1559620427; bh=1fSh5kCFf8EMA4T+tfNnxpUu7rPP0Jvdfc7AP1ZYtmM=;
 h=References:From:To:Cc:Subject:In-reply-to:Date:From;
 b=GQnxTbOFGuNaeiEBxKXYgTMtLKmuLxEYKLIhtRg+1fCoAvnIvfkT9CoCjd73infAC
 eyKdGpQyYDKvEag7EbQ5m++ZqY2EX3bcKObGOglOHthUY7W7B/mPu8Iv8ovdVi2Bqp
 Ujg3BNd36YVXiSjzyGwAgkcMAyGfEMigisynfzAg=
X-Riseup-User-ID: 3DCE674E2720C531FCE929CC4175D8C0D023D5DA504BA0FCF2BAED290C52DC98
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id 0192B1203E4;
 Mon,  3 Jun 2019 20:53:05 -0700 (PDT)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 80da177d;
 Tue, 4 Jun 2019 03:53:02 +0000 (UTC)
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN> <87o93fkyhs.fsf@HIDDEN>
 <cf1f869c-78c3-68c3-d2ec-4b8faa31cb70@HIDDEN>
From: Meiyo Peng <meiyo@HIDDEN>
To: Dan Frumin <dfrumin@HIDDEN>
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
In-reply-to: <cf1f869c-78c3-68c3-d2ec-4b8faa31cb70@HIDDEN>
Date: Tue, 04 Jun 2019 11:53:02 +0800
Message-ID: <87muiy0zxd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 36021
Cc: 36021 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Dan,

Dan Frumin writes:

>>> Some background on this patch:
>>> Right now whenever I do any Guix operation that requires me to modify
>>> environment variables (e.g. installing a Guile library requires me to update
>>> $GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run
>>> to update the variables.
>>>
>>> However, those commands are currently in bash/POSIX(?) format `export
>>> VAR=VALUE`. I've modified the `environment-variable-definition` function to
>>> support the syntax for Fish shell as well. I don't know if this method of
>>> looking at the $SHELL variable is sound, but it works  on my machine.
>>>
>>> Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set
>>>
>>> PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch
>>
>> I think this patch will cause more trouble than good.  Does this patch
>> replaces etc/profile with fish syntax script?  etc/profile is supposed
>> to be in POSIX shell syntax.  Fish shell has it's own configuration
>> files in /etc/fish/config.fish and /etc/fish/conf.d/*.fish.  If you
>> really want to generate fish syntax scripts, please put them in
>> /etc/fish/config.fish or /etc/fish/conf.d/*.fish.
>>
>
> No, this patch doesn't touch etc/profile in any way, it is only concerned with the output that you get from `guix package` on your terminal.
> So I guess it's kind of orthogonal to the upgraded fish package that you made?

Alright.  Then that's fine.  But there is an on going discussion about
change content of the message in bug #35942.  I suggest we hold this
patch until that bug is closed.

>> See:
>> 1. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00071.html
>> 2. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00333.html
>> 3. https://issues.guix.gnu.org/issue/34153
>>
>> Have you tried the fish-foreign-env package?  You can source bash
>> scripts in fish via `fenv source ~/.guix-profile/etc/profile`.  That's how
>> the fish shell in Guix set up environment variables upon login.
>>
>
> Thanks! This is quite nice, I should upgrade my Fish installation.

Your fish shell is quite old.  Older than Guix 1.0.0!

>> Perhaps we can handle this better.  Do you have any suggestions?  My
>> idea:
>>
>> 1. The fish-foreign-env package is very useful but it's not installed by
>> default in order to avoid polluting user's profiles according to the
>> Guix convention.  In this case I think it's a useful utility rather than
>> pollution.  Do you want it to be installed together with the fish
>> package by default?
>
> Well, you added it as part of the fish dependency, right? I think it makes sense, especially on Guix SD.

Yes, it's a dependency of fish.  But it's not a propagated input.  We
can change it into a propagated input if most users agree.

>> 2. etc/profile is supposed to be sourced by a login shell.  And we
>> should avoid sourcing it from a non-login shell.  That's why I made the
>> fish package in Guix only sources it upon login.  That means starting a
>> new fish shell won't source it automatically.  So please source it
>> manually if you need the new environment variables (fenv source
>> ~/.guix-profile/etc/profile).
>
> I am not knowledgeable enough to comment on this, but it seems to me that it is
> done similarly if you are using bash: e.g. you have to source the profile
> yourself if you want to get it in a non-login shell.
>
>>
>> 3. We can write better documentations explaining how to deal with fish
>> shell in Guix.  There's an old discussion about having a Guix wiki or
>> a Guix book.
>>
>
> Yeah, more documentation is always better :)


--
Meiyo Peng
https://www.pengmeiyu.com/




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 3 Jun 2019 15:51:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 03 11:51:01 2019
Received: from localhost ([127.0.0.1]:42754 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hXpEj-00049y-2P
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2019 11:51:01 -0400
Received: from smtp2.science.ru.nl ([131.174.16.145]:56226)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dfrumin@HIDDEN>) id 1hXpEe-00049l-C3
 for 36021 <at> debbugs.gnu.org; Mon, 03 Jun 2019 11:50:57 -0400
Received: from [145.116.191.160] (ip-145-116-191-160.wlan-int.ru.nl
 [145.116.191.160]) (authen=dfrumin)
 by smtp2.science.ru.nl (8.14.4/5.32) with ESMTP id x53FortK007628;
 Mon, 3 Jun 2019 17:50:54 +0200
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
To: Meiyo Peng <meiyo@HIDDEN>
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN> <87o93fkyhs.fsf@HIDDEN>
From: Dan Frumin <dfrumin@HIDDEN>
Message-ID: <cf1f869c-78c3-68c3-d2ec-4b8faa31cb70@HIDDEN>
Date: Mon, 3 Jun 2019 17:50:53 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.7.0
MIME-Version: 1.0
In-Reply-To: <87o93fkyhs.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36021
Cc: 36021 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Meiyo,

On 03-06-19 07:51, Meiyo Peng wrote:
> Hi Dan,
> 
> Dan Frumin writes:
> 
>> Some background on this patch:
>> Right now whenever I do any Guix operation that requires me to modify
>> environment variables (e.g. installing a Guile library requires me to update
>> $GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run
>> to update the variables.
>>
>> However, those commands are currently in bash/POSIX(?) format `export
>> VAR=VALUE`. I've modified the `environment-variable-definition` function to
>> support the syntax for Fish shell as well. I don't know if this method of
>> looking at the $SHELL variable is sound, but it works  on my machine.
>>
>> Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set
>>
>> PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch
> 
> I think this patch will cause more trouble than good.  Does this patch
> replaces etc/profile with fish syntax script?  etc/profile is supposed
> to be in POSIX shell syntax.  Fish shell has it's own configuration
> files in /etc/fish/config.fish and /etc/fish/conf.d/*.fish.  If you
> really want to generate fish syntax scripts, please put them in
> /etc/fish/config.fish or /etc/fish/conf.d/*.fish.
> 

No, this patch doesn't touch etc/profile in any way, it is only concerned with the output that you get from `guix package` on your terminal.
So I guess it's kind of orthogonal to the upgraded fish package that you made?

> See:
> 1. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00071.html
> 2. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00333.html
> 3. https://issues.guix.gnu.org/issue/34153
> 
> Have you tried the fish-foreign-env package?  You can source bash
> scripts in fish via `fenv source ~/.guix-profile/etc/profile`.  That's how
> the fish shell in Guix set up environment variables upon login.
> 

Thanks! This is quite nice, I should upgrade my Fish installation.

> Perhaps we can handle this better.  Do you have any suggestions?  My
> idea:
> 
> 1. The fish-foreign-env package is very useful but it's not installed by
> default in order to avoid polluting user's profiles according to the
> Guix convention.  In this case I think it's a useful utility rather than
> pollution.  Do you want it to be installed together with the fish
> package by default?

Well, you added it as part of the fish dependency, right? I think it makes sense, especially on Guix SD.

> 
> 2. etc/profile is supposed to be sourced by a login shell.  And we
> should avoid sourcing it from a non-login shell.  That's why I made the
> fish package in Guix only sources it upon login.  That means starting a
> new fish shell won't source it automatically.  So please source it
> manually if you need the new environment variables (fenv source
> ~/.guix-profile/etc/profile).

I am not knowledgeable enough to comment on this, but it seems to me that it is done similarly if you are using bash: e.g. you have to source the 
profile yourself if you want to get it in a non-login shell.

> 
> 3. We can write better documentations explaining how to deal with fish
> shell in Guix.  There's an old discussion about having a Guix wiki or
> a Guix book.
> 

Yeah, more documentation is always better :)

Best regards,
-Dan

> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/
> 




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 3 Jun 2019 05:51:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 03 01:51:37 2019
Received: from localhost ([127.0.0.1]:41421 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hXfsc-0005jR-Sq
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2019 01:51:36 -0400
Received: from mx1.riseup.net ([198.252.153.129]:41446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <meiyo@HIDDEN>) id 1hXfsa-0005jH-Ht
 for 36021 <at> debbugs.gnu.org; Mon, 03 Jun 2019 01:51:33 -0400
Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.riseup.net (Postfix) with ESMTPS id 5E98E1A1995;
 Sun,  2 Jun 2019 22:51:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak;
 t=1559541091; bh=v0TobErMAAitzvjI8npQwj4KpDka7dywVvcZ9JBjdnE=;
 h=References:From:To:Cc:Subject:In-reply-to:Date:From;
 b=Qa0XGBU4+OOwW9UTH8LnR+Q8yDYR4C4ruujzSdQFQVLbLahULSmMRSpczfsmpdLfF
 7tA1aahQ/WQiahQgYappMi2SDyTjfb1WpT4r3x0mmTb9jfg0wzlMfbghFb7Noy/rOv
 gMgdlU+XHssOO7kQdRnduO5F2BHE+Tbeex3OJ9dQ=
X-Riseup-User-ID: 66CAC49A7FE8F09D508CB3F9EBD476AD039532295C401C66B7D82E396BA13BC8
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by capuchin.riseup.net (Postfix) with ESMTPSA id B2654120025;
 Sun,  2 Jun 2019 22:51:30 -0700 (PDT)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 3ad4f8fd;
 Mon, 3 Jun 2019 05:51:27 +0000 (UTC)
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN>
From: Meiyo Peng <meiyo@HIDDEN>
To: Dan Frumin <dfrumin@HIDDEN>
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
In-reply-to: <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN>
Date: Mon, 03 Jun 2019 13:51:27 +0800
Message-ID: <87o93fkyhs.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 36021
Cc: 36021 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Dan,

Dan Frumin writes:

> Some background on this patch:
> Right now whenever I do any Guix operation that requires me to modify
> environment variables (e.g. installing a Guile library requires me to update
> $GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run
> to update the variables.
>
> However, those commands are currently in bash/POSIX(?) format `export
> VAR=VALUE`. I've modified the `environment-variable-definition` function to
> support the syntax for Fish shell as well. I don't know if this method of
> looking at the $SHELL variable is sound, but it works  on my machine.
>
> Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set
>
> PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch

I think this patch will cause more trouble than good.  Does this patch
replaces etc/profile with fish syntax script?  etc/profile is supposed
to be in POSIX shell syntax.  Fish shell has it's own configuration
files in /etc/fish/config.fish and /etc/fish/conf.d/*.fish.  If you
really want to generate fish syntax scripts, please put them in
/etc/fish/config.fish or /etc/fish/conf.d/*.fish.

See:
1. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00071.html
2. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00333.html
3. https://issues.guix.gnu.org/issue/34153

Have you tried the fish-foreign-env package?  You can source bash
scripts in fish via `fenv source ~/.guix-profile/etc/profile`.  That's how
the fish shell in Guix set up environment variables upon login.

Perhaps we can handle this better.  Do you have any suggestions?  My
idea:

1. The fish-foreign-env package is very useful but it's not installed by
default in order to avoid polluting user's profiles according to the
Guix convention.  In this case I think it's a useful utility rather than
pollution.  Do you want it to be installed together with the fish
package by default?

2. etc/profile is supposed to be sourced by a login shell.  And we
should avoid sourcing it from a non-login shell.  That's why I made the
fish package in Guix only sources it upon login.  That means starting a
new fish shell won't source it automatically.  So please source it
manually if you need the new environment variables (fenv source
~/.guix-profile/etc/profile).

3. We can write better documentations explaining how to deal with fish
shell in Guix.  There's an old discussion about having a Guix wiki or
a Guix book.


--
Meiyo Peng
https://www.pengmeiyu.com/




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 2 Jun 2019 09:29:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 02 05:29:47 2019
Received: from localhost ([127.0.0.1]:39461 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hXMoF-0007xc-Ba
	for submit <at> debbugs.gnu.org; Sun, 02 Jun 2019 05:29:47 -0400
Received: from smtp2.science.ru.nl ([131.174.16.145]:48350)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dfrumin@HIDDEN>) id 1hXMoD-0007xT-Az
 for 36021 <at> debbugs.gnu.org; Sun, 02 Jun 2019 05:29:46 -0400
Received: from [192.168.4.18] (ip565a9ee0.direct-adsl.nl [86.90.158.224] (may
 be forged)) (authen=dfrumin)
 by smtp2.science.ru.nl (8.14.4/5.32) with ESMTP id x529ThbK001134;
 Sun, 2 Jun 2019 11:29:43 +0200
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN> <87v9xpfo3d.fsf@HIDDEN>
From: Dan Frumin <dfrumin@HIDDEN>
Message-ID: <ff171fad-0650-0967-0bea-154216a7f866@HIDDEN>
Date: Sun, 2 Jun 2019 11:29:42 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <87v9xpfo3d.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36021
Cc: 36021 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Ludovic,

On 01-06-19 15:10, Ludovic Courtès wrote:
> Hi,
> 
> Dan Frumin <dfrumin@HIDDEN> skribis:
> 
>> Some background on this patch:
>> Right now whenever I do any Guix operation that requires me to modify
>> environment variables (e.g. installing a Guile library requires me to
>> update $GUILE_LOAD_PATH afterwards), Guix helpful tells me what
>> commands I have to run to update the variables.
> 
> But see <https://issues.guix.gnu.org/issue/35942>.  :-)
> 

I was actually oblivious to the fact that these environment variables can be set up for you automatically in a new shell -- I guess that's because 
both ~/.guix-profile/etc/profile and `guix package --search-paths` output everything in Bash format, so I didn't use it with Fish.

>> However, those commands are currently in bash/POSIX(?) format `export
>> VAR=VALUE`. I've modified the `environment-variable-definition`
>> function to support the syntax for Fish shell as well. I don't know if
>> this method of looking at the $SHELL variable is sound, but it works
>> on my machine.
> 
> “export VAR=VALUE” is actually Bash-specific.  The POSIX way to do it
> is:
> 
>    VAR=VALUE; export VAR
> 
> Would that work with Fish?

Unfortunately not. I wish they'd support more standard features.

Best,
Dan

> 
> If it does, we might just as well take that route as it will also cater
> to other POSIX-compatible shells.
> 
> If not, your patch sounds like the right way.
> 
> Thanks,
> Ludo’.
> 




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 1 Jun 2019 13:10:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 01 09:10:44 2019
Received: from localhost ([127.0.0.1]:37502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hX3mW-0005mF-9F
	for submit <at> debbugs.gnu.org; Sat, 01 Jun 2019 09:10:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1hX3mV-0005lz-2H
 for 36021 <at> debbugs.gnu.org; Sat, 01 Jun 2019 09:10:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38357)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1hX3mM-0003dG-Iz; Sat, 01 Jun 2019 09:10:35 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=54788 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1hX3mK-0007VF-2z; Sat, 01 Jun 2019 09:10:34 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Dan Frumin <dfrumin@HIDDEN>
Subject: Re: [bug#36021] [PATCH] search-paths:
 'environment-variable-definition' output for fish
References: <20190531103630.6739-1-dfrumin@HIDDEN>
 <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN>
Date: Sat, 01 Jun 2019 15:10:30 +0200
In-Reply-To: <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN> (Dan Frumin's
 message of "Fri, 31 May 2019 12:41:10 +0200")
Message-ID: <87v9xpfo3d.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36021
Cc: 36021 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Dan Frumin <dfrumin@HIDDEN> skribis:

> Some background on this patch:
> Right now whenever I do any Guix operation that requires me to modify
> environment variables (e.g. installing a Guile library requires me to
> update $GUILE_LOAD_PATH afterwards), Guix helpful tells me what
> commands I have to run to update the variables.

But see <https://issues.guix.gnu.org/issue/35942>.  :-)

> However, those commands are currently in bash/POSIX(?) format `export
> VAR=3DVALUE`. I've modified the `environment-variable-definition`
> function to support the syntax for Fish shell as well. I don't know if
> this method of looking at the $SHELL variable is sound, but it works
> on my machine.

=E2=80=9Cexport VAR=3DVALUE=E2=80=9D is actually Bash-specific.  The POSIX =
way to do it
is:

  VAR=3DVALUE; export VAR

Would that work with Fish?

If it does, we might just as well take that route as it will also cater
to other POSIX-compatible shells.

If not, your patch sounds like the right way.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at 36021 <at> debbugs.gnu.org:


Received: (at 36021) by debbugs.gnu.org; 31 May 2019 10:41:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 06:41:13 2019
Received: from localhost ([127.0.0.1]:34865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hWeyH-00033A-Aw
	for submit <at> debbugs.gnu.org; Fri, 31 May 2019 06:41:13 -0400
Received: from smtp2.science.ru.nl ([131.174.16.145]:57948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dfrumin@HIDDEN>) id 1hWeyF-000332-Ky
 for 36021 <at> debbugs.gnu.org; Fri, 31 May 2019 06:41:12 -0400
Received: from [192.168.4.18] (ip565a9ee0.direct-adsl.nl [86.90.158.224] (may
 be forged)) (authen=dfrumin)
 by smtp2.science.ru.nl (8.14.4/5.32) with ESMTP id x4VAfAOV018480
 for <36021 <at> debbugs.gnu.org>; Fri, 31 May 2019 12:41:10 +0200
Subject: Re: [PATCH] search-paths: 'environment-variable-definition' output
 for fish
To: 36021 <at> debbugs.gnu.org
References: <20190531103630.6739-1-dfrumin@HIDDEN>
From: Dan Frumin <dfrumin@HIDDEN>
Message-ID: <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@HIDDEN>
Date: Fri, 31 May 2019 12:41:10 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <20190531103630.6739-1-dfrumin@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36021
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Guix!

Some background on this patch:
Right now whenever I do any Guix operation that requires me to modify environment variables (e.g. installing a Guile library requires me to update 
$GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run to update the variables.

However, those commands are currently in bash/POSIX(?) format `export VAR=VALUE`. I've modified the `environment-variable-definition` function to 
support the syntax for Fish shell as well. I don't know if this method of looking at the $SHELL variable is sound, but it works  on my machine.

Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set

PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch

Best regards,
-Dan




Information forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 May 2019 10:36:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 31 06:36:53 2019
Received: from localhost ([127.0.0.1]:34849 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hWeu4-0002oK-Nb
	for submit <at> debbugs.gnu.org; Fri, 31 May 2019 06:36:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39915)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dfrumin@HIDDEN>) id 1hWeu2-0002nv-P2
 for submit <at> debbugs.gnu.org; Fri, 31 May 2019 06:36:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:41417)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dfrumin@HIDDEN>) id 1hWetx-0007cd-Jz
 for submit <at> debbugs.gnu.org; Fri, 31 May 2019 06:36:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54294)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dfrumin@HIDDEN>) id 1hWetw-0005I0-Cs
 for guix-patches@HIDDEN; Fri, 31 May 2019 06:36:45 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dfrumin@HIDDEN>) id 1hWetv-0007Zz-2P
 for guix-patches@HIDDEN; Fri, 31 May 2019 06:36:44 -0400
Received: from smtp2.science.ru.nl ([131.174.16.145]:41408)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dfrumin@HIDDEN>) id 1hWetu-0007Tq-QW
 for guix-patches@HIDDEN; Fri, 31 May 2019 06:36:43 -0400
Received: from localhost.localdomain (ip565a9ee0.direct-adsl.nl
 [86.90.158.224] (may be forged)) (authen=dfrumin@HIDDEN)
 by smtp2.science.ru.nl (8.14.4/5.32) with ESMTP id x4VAaV7q018080;
 Fri, 31 May 2019 12:36:34 +0200
From: Dan Frumin <dfrumin@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] search-paths: 'environment-variable-definition' output for
 fish
Date: Fri, 31 May 2019 12:36:30 +0200
Message-Id: <20190531103630.6739-1-dfrumin@HIDDEN>
X-Mailer: git-send-email 2.17.1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 131.174.16.145
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Dan Frumin <dfrumin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

---
 guix/search-paths.scm | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 002e6342bb..fe9253e88e 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -177,15 +177,28 @@ current value), or 'suffix (return the definition where VALUE is added as a
 suffix to VARIABLE's current value.)  In the case of 'prefix and 'suffix,
 SEPARATOR is used as the separator between VARIABLE's current value and its
 prefix/suffix."
-  (match (if (not separator) 'exact kind)
-    ('exact
-     (format #f "export ~a=\"~a\"" variable value))
-    ('prefix
-     (format #f "export ~a=\"~a${~a:+~a}$~a\""
-             variable value variable separator variable))
-    ('suffix
-     (format #f "export ~a=\"$~a${~a:+~a}~a\""
-             variable variable variable separator value))))
+  (let* ([shell-env (getenv "SHELL")]
+         [is-fish? (and shell-env
+                        (equal? (last (string-split shell-env #\/))
+                                "fish"))])
+   (match (if (not separator) 'exact kind)
+     ('exact
+      (if is-fish?
+          ;; See <https://fishshell.com/docs/current/commands.html#set> for syntax
+          (format #f "set -x ~a \"~a\"" variable value)
+          (format #f "export ~a=\"~a\"" variable value)))
+     ('prefix
+      (if is-fish?
+          (format #f "set -x ~a \"~a\" $~a"
+                  variable value variable)
+          (format #f "export ~a=\"~a${~a:+~a}$~a\""
+                  variable value variable separator variable)))
+     ('suffix
+      (if is-fish?
+          (format #f "set -x ~a $~a \"~a\""
+                  variable variable value)
+          (format #f "export ~a=\"$~a${~a:+~a}~a\""
+                  variable variable variable separator value))))))
 
 (define* (search-path-definition search-path value
                                  #:key (kind 'exact))
-- 
2.17.1





Acknowledgement sent to Dan Frumin <dfrumin@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#36021; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.