unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Hugo Buddelmeijer <hugo@buddelmeijer.nl>
To: 59776@debbugs.gnu.org
Subject: bug#59776: Conda hardcodes guix hash in .bashrc
Date: Fri, 2 Dec 2022 14:09:51 +0100	[thread overview]
Message-ID: <CA+Jv8O1u-EcNuAqU-3QrpxgEuPKJHHB5B4bSREaS19A77oTONg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3000 bytes --]

                 reply	other threads:[~2022-12-02 13:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+Jv8O1u-EcNuAqU-3QrpxgEuPKJHHB5B4bSREaS19A77oTONg@mail.gmail.com \
    --to=hugo@buddelmeijer.nl \
    --cc=59776@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).