From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YM4aNBPDQl/jYgAA0tVLHw (envelope-from ) for ; Sun, 23 Aug 2020 19:27:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SO/FLxPDQl+dKwAAbx9fmQ (envelope-from ) for ; Sun, 23 Aug 2020 19:27:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C5979403CB for ; Sun, 23 Aug 2020 19:27:14 +0000 (UTC) Received: from localhost ([::1]:33170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9ve5-0003vg-Rw for larch@yhetil.org; Sun, 23 Aug 2020 15:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9vdu-0003vO-GY for bug-guix@gnu.org; Sun, 23 Aug 2020 15:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9vdu-0003r2-6z for bug-guix@gnu.org; Sun, 23 Aug 2020 15:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k9vdu-0005Ab-35 for bug-guix@gnu.org; Sun, 23 Aug 2020 15:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42920: conda 4.8.3 on guix cannot activate environments Resent-From: Hugo Buddelmeijer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 23 Aug 2020 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42920 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ricardo Wurmus X-Debbugs-Original-Cc: bug-guix@gnu.org, 42920@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159821081819858 (code B ref -1); Sun, 23 Aug 2020 19:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Aug 2020 19:26:58 +0000 Received: from localhost ([127.0.0.1]:55152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9vdp-0005AC-NV for submit@debbugs.gnu.org; Sun, 23 Aug 2020 15:26:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:41072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9vdn-00059y-KF for submit@debbugs.gnu.org; Sun, 23 Aug 2020 15:26:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9vdn-0003v2-Dr for bug-guix@gnu.org; Sun, 23 Aug 2020 15:26:55 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:33096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9vdk-0003qq-MS for bug-guix@gnu.org; Sun, 23 Aug 2020 15:26:55 -0400 Received: by mail-pj1-f54.google.com with SMTP id q93so2421419pjq.0 for ; Sun, 23 Aug 2020 12:26:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sJUq2M0TUo575Kc0WiPrzMKym4LaG3lqNqxH6LmdSY8=; b=uCubvFi5BlfKTcf1KPL//4Jtii4D3oyjReXZGE36DkMcaCalaevdbnfYZ+4Maecagq LEQ58KLx94xmLx4ziBwQq9CeSbVmWvnEPQYRsfgWb1LN6r0k9EVqkYmrRvtRonGDBqMT IBTDLUHNFJdDeRVfMl8cePTjpqW5AvjU50oKO/6RSiHfpuSnwf6lZ2cdKd4KxOlzWtm0 5QMBGsvuMAAHPoBfZqI6Sl2ri3ah09IZsSnx9eeV8jR34xuulTxZzviRQEIrI2m3ovLx F4bQfwyxm0m/g8XePP7Q2U8rBr+c828i5p2ljflfqdLkO3gIA1xltDcMZYhbDinrxPX/ UP4A== X-Gm-Message-State: AOAM532LQ6cy9uBBNyPVsrGzoJA+Goe33Psh12rtWAy+JXZcMBqWb+5K GDpKuF4KryQquOWWAHkGGTGIZaKOwx60ShWo7xw= X-Google-Smtp-Source: ABdhPJz3tz4XJRo+zXjqUyBDn83Gisp0RbQ+UEvDOPhiahNorN1QBUNvKisdEUOV9nyVWKxyYT/aTyelp+priL1nAKI= X-Received: by 2002:a17:902:523:: with SMTP id 32mr1532046plf.176.1598210810265; Sun, 23 Aug 2020 12:26:50 -0700 (PDT) MIME-Version: 1.0 References: <87blj7x841.fsf@elephly.net> <87364gy7tw.fsf@elephly.net> In-Reply-To: <87364gy7tw.fsf@elephly.net> From: Hugo Buddelmeijer Date: Sun, 23 Aug 2020 21:26:39 +0200 Message-ID: Content-Type: multipart/alternative; boundary="0000000000009f441605ad907366" Received-SPF: pass client-ip=209.85.216.54; envelope-from=blackshift@gmail.com; helo=mail-pj1-f54.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/23 15:26:50 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.8 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42920@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: VcRUPRJl0khV --0000000000009f441605ad907366 Content-Type: text/plain; charset="UTF-8" Just sharing a bit of more info about why the conda prompt breaks. On Fri, 21 Aug 2020 at 05:52, Ricardo Wurmus wrote: > > Hugo Buddelmeijer writes: > > > 2. The prompt is not set correctly, as in, what should happen is that the > > current conda environment is added to the prompt. Instead, the prompt is > > replaced entirely by the environment. This shouldn't be too hard to fix > > manually though. > > Weird! Is this something Conda does wrong because it assumes too much > about the existing prompt? > This is what happens, reducing the files to the essence: 1) .bashrc runs __conda_setup="$('/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" eval "$__conda_setup" 2) __conda_setup runs __conda_activate() { ask_conda="$(PS1="$PS1" "$CONDA_EXE" $_CE_M $_CE_CONDA shell.posix "$cmd" "$@")" || \return $? \eval "$ask_conda" } conda activate base 3) ask_conda will contain the new PS1 definition. The command ran to create ask_conda is PS1="\u@\h \w\$" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/conda" shell.posix "activate" "base" 4) conda runs #!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash export PYTHONPATH="/gnu/store....." exec -a "$0" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/.conda-real" "$@" 5) .conda.real generates the prompt in Python: from conda.cli import main sys.exit(main()) 6) .conda.real outputs PS1='(base) ' export PATH='... The problem with the prompt arises from step 4), because 'conda' has bash as interpreter, and "non-interactive bashes go out of their way to unset PS1": https://superuser.com/questions/663069/why-does-subshell-not-inherit-exported-variable-ps1 https://tldp.org/HOWTO/Bash-Prompt-HOWTO/setps.html So .conda.real never gets the PS1 variable and it disappears. I don't really understand why there is a bash function, a conda bash script and a .conda-real python script. My local miniconda 4.8.3 installation on an Ubuntu machine (in my home directory) does not have a ".conda-real": "conda" directly is the Python script, so everything works. Maybe more later. Hugo > -- > Ricardo > --0000000000009f441605ad907366 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Just sharing a bit of more info about why the conda p= rompt breaks.

On Fri, 21 Aug 2020 at 05:52, Ricardo Wurmus <rekado@elephly.net> wrote:

Hugo Buddelmeijer <hugo@buddelmeijer.nl> writes:

> 2. The prompt is not set correctly, as in, what should happen is that = the
> current conda environment is added to the prompt. Instead, the prompt = is
> replaced entirely by the environment. This shouldn't be too hard t= o fix
> manually though.

Weird!=C2=A0 Is this something Conda does wrong because it assumes too much=
about the existing prompt?

This is what= happens, reducing the files to the essence:

1) .b= ashrc runs

__conda_setup=3D"$('/gnu/s= tore/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/conda' 'shell= .bash' 'hook' 2> /dev/null)"
eval "$__conda_set= up"

2) __conda_setup runs
<= br>
__conda_activate() {
=C2=A0 =C2=A0 ask_conda=3D"$(PS1= =3D"$PS1" "$CONDA_EXE" $_CE_M $_CE_CONDA shell.posix &q= uot;$cmd" "$@")" || \return $?
=C2=A0 =C2=A0 \eval = "$ask_conda"
}
conda activate base

3) ask_conda will contain the new PS1 definition. The comma= nd ran to create ask_conda=C2=A0 is

PS1=3D&quo= t;\u@\h \w\$" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-= 4.8.3/bin/conda" =C2=A0 shell.posix "activate" "base&qu= ot;

4) conda runs

#!/= gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash
export PYTHONPATH=3D"/gnu/store....."
exec -a &q= uot;$0" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/= bin/.conda-real" "$@"

5) .conda= .real generates the prompt in Python:

from con= da.cli import main
sys.exit(main())

6) .con= da.real outputs
PS1=3D'(base) '
export PATH=3D'...=

The problem with the prompt arises from step 4), = because 'conda' has bash as interpreter, and "non-interactive = bashes go out of their way to unset PS1":

So .conda.real never gets the PS1 variab= le and it disappears.

I don't really understan= d why there is a bash function, a conda bash script and a .conda-real pytho= n script.

My loca= l miniconda 4.8.3 installation on an Ubuntu machine (in my home directory) = does not have a ".conda-real": "conda" directly is the = Python script, so everything works.
=C2=A0
Maybe m= ore later.

Hugo



--
Ricardo
--0000000000009f441605ad907366--