Conda hardcodes guix hash in .bashrc

  • Open
  • quality assurance status badge
Details
One participant
  • Hugo Buddelmeijer
Owner
unassigned
Submitted by
Hugo Buddelmeijer
Severity
normal
H
H
Hugo Buddelmeijer wrote on 2 Dec 2022 14:09
(address . bug-guix@gnu.org)
CA+Jv8O1u-EcNuAqU-3QrpxgEuPKJHHB5B4bSREaS19A77oTONg@mail.gmail.com
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:

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
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 59776@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59776
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch