From unknown Sun Jun 22 07:55:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59776: Conda hardcodes guix hash in .bashrc Resent-From: Hugo Buddelmeijer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 02 Dec 2022 13:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59776 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 59776@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166998661420208 (code B ref -1); Fri, 02 Dec 2022 13:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2022 13:10:14 +0000 Received: from localhost ([127.0.0.1]:46642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p15ny-0005Fr-4y for submit@debbugs.gnu.org; Fri, 02 Dec 2022 08:10:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:45024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p15nv-0005Fl-SN for submit@debbugs.gnu.org; Fri, 02 Dec 2022 08:10:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p15nu-00029u-2E for bug-guix@gnu.org; Fri, 02 Dec 2022 08:10:11 -0500 Received: from mail-ej1-f43.google.com ([209.85.218.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p15np-0001jj-Aa for bug-guix@gnu.org; Fri, 02 Dec 2022 08:10:09 -0500 Received: by mail-ej1-f43.google.com with SMTP id vv4so11421915ejc.2 for ; Fri, 02 Dec 2022 05:10:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RJ7tly0lkVkWUO9FQ6j8vyRMWDF2h2o8ae/xcnGMDmY=; b=cKlYCTEgxhW/Td72mZKYIPR8AV0aPXL/t15ZbTIBcp43ID9+5Koi+3KV38qpsPPjLO +oMgqtJ1gpiQt5WNKlkPBqyMDw5oJssGi7jYE4ySCxfRCe3h8GUCJH62IvHXUlaj2j/9 DwMLx8HvgFHWG8XSP9aMVX1UvDY2lbUIJPAhrNNPZbRTRVkP9fpG3VnhPzAJyU+jfnes vlg5CUbUx5nKXddKCNNNMy19ce4C+Oac6GBAmf/aQPIVhfYWlki6gUr02Rq9xiVXMy47 m881z96H6W6ymBT+F7ob9xEi1/mJRdpy406Ti/P5X/yor2YLR+VjT9zODTN2TBca6WtO Xqnw== X-Gm-Message-State: ANoB5pnZ2eCwKPB16hd/9OfI3gPtTS/Wr/VSWJJPEXvirIlwUGMEq0ej 1ROzKv6jchima4tV8dejFyCgWlq9ySt8n01R2FNSrlXpOdTlWA== X-Google-Smtp-Source: AA0mqf7dIxgKSw4a/I27voTb9HdHCRit9ZMShZRHRtpSAPAMyirfsAt13sreTvnenvpwkIP5QfE6RagezJA+DB6nYCc= X-Received: by 2002:a17:906:43d0:b0:78d:a01b:b474 with SMTP id j16-20020a17090643d000b0078da01bb474mr47207338ejn.8.1669986603138; Fri, 02 Dec 2022 05:10:03 -0800 (PST) MIME-Version: 1.0 From: Hugo Buddelmeijer Date: Fri, 2 Dec 2022 14:09:51 +0100 Message-ID: Content-Type: multipart/alternative; boundary="00000000000042839405eed80e91" Received-SPF: pass client-ip=209.85.218.43; envelope-from=blackshift@gmail.com; helo=mail-ej1-f43.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --00000000000042839405eed80e91 Content-Type: text/plain; charset="UTF-8" Hi all, Conda adds some bash functions to ~/.bashrc, but those contain a hardcoded guix hash. That means that conda will break between upgrades: hugo@alex ~/t$ guix shell -C conda hugo@alex ~/t [env]$ conda init bash # ignore errors hugo@alex ~/t [env]$ echo "$(<~/.bashrc)" # no coreutils # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/gnu/store/kihiw0r9r595jwhxlydkl0f5vvn53r1z-conda-22.9.0/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/gnu/store/kihiw0r9r595jwhxlydkl0f5vvn53r1z-conda-22.9.0/etc/profile.d/conda.sh" ]; then . "/gnu/store/kihiw0r9r595jwhxlydkl0f5vvn53r1z-conda-22.9.0/etc/profile.d/conda.sh" else export PATH="/gnu/store/kihiw0r9r595jwhxlydkl0f5vvn53r1z-conda-22.9.0/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< It seems that the contents of ~/.bashrc are based on the file conda/core/initialize.py: https://github.com/conda/conda/blob/main/conda/core/initialize.py It refers to a conda_prefix (and conda_exe) variable. These should somehow refer to the guix profile, not to the packages in the store. I'm not yet experienced enough to propose how to tackle this. It seems hard to do this in a generic way, because guix and conda kinda collide here. E.g. different guix profiles (with different conda packages) could share the same home directory. However, it would already be nice if conda would work (between updates) for the scenario of only one guix profile per user. That is, perhaps we can simply refer to "${HOME}/.guix-profile" as conda_prefix. This is the last of the conda-related bugs I planned to submit. My goal is to get conda to work well enough within guix so we can convince conda-users to try guix, and then, over time, hopefully switch over to guix entirely. Hugo --00000000000042839405eed80e91 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

Conda adds some bash= functions to ~/.bashrc, but those contain a hardcoded guix hash. That mean= s that conda will break between upgrades:

hugo@ale= x ~/t$ guix shell -C conda
hugo@alex ~/t [env]$ conda init ba= sh
# ignore errors
hugo@alex ~/t [env]$ echo "$(<= ;~/.bashrc)" # no coreutils

# >>> conda initialize >= ;>>
# !! Contents within this block are managed by 'conda init= ' !!
__conda_setup=3D"$('/gnu/store/kihiw0r9r595jwhxlydkl0f= 5vvn53r1z-conda-22.9.0/bin/conda' 'shell.bash' 'hook' 2= > /dev/null)"
if [ $? -eq 0 ]; then
=C2=A0 =C2=A0 eval "= $__conda_setup"
else
=C2=A0 =C2=A0 if [ -f "/gnu/store/kihi= w0r9r595jwhxlydkl0f5vvn53r1z-conda-22.9.0/etc/profile.d/conda.sh" ]; t= hen
=C2=A0 =C2=A0 =C2=A0 =C2=A0 . "/gnu/store/kihiw0r9r595jwhxlydkl= 0f5vvn53r1z-conda-22.9.0/etc/profile.d/conda.sh"
=C2=A0 =C2=A0 else=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 export PATH=3D"/gnu/store/kihiw0r9r595= jwhxlydkl0f5vvn53r1z-conda-22.9.0/bin:$PATH"
=C2=A0 =C2=A0 fi
fi=
unset __conda_setup
# <<< conda initialize <<<= ;


It seems that the contents of ~/.= bashrc are based on the file conda/core/initialize.py:
It refers to a conda_prefix (and co= nda_exe) variable. These should somehow refer to the guix profile, not to t= he packages in the store.

<= /span>
I'm not yet experienced eno= ugh to propose how to tackle this. It seems hard to do this in a generic wa= y, because guix and conda kinda collide here. E.g. different guix profiles = (with different conda packages) could share the same home directory.=

However, it would already be nice if conda would work (between = updates) for the scenario of only one guix profile per user. That is, perha= ps we can simply refer to "${HOME}/.guix-profile" as conda_prefix= .



This is the last of the conda-re= lated bugs I planned to submit. My goal is to get conda to work well enough= within guix so we can convince conda-users to try guix, and then, over tim= e, hopefully switch over to guix entirely.

= Hugo





=

--00000000000042839405eed80e91--