New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove base environment PATH
components from conda run environment
#11257
Conversation
This is to have more consistency between dev and prod envs.
@@ -78,7 +78,7 @@ jobs: | |||
--rm -v ${PWD}:/opt/conda-src | |||
-e TEST_SPLITS | |||
-e TEST_GROUP | |||
ghcr.io/conda/conda-ci:master-linux-python${{ matrix.python-version }} | |||
ghcr.io/conda/conda-ci:pr-11257-linux-python${{ matrix.python-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This'll need to be changed back to master, but is needed since the addition of /opt/conda/bin to PATH in the Dockerfile below made testing this impossible.
I don't think this is the fix we want. This change will blindly remove the In non-stacked cases (see Case 1 & 2) this fix will correctly handle the problem but in stacked cases (see Case 3) this fix will incorrectly strip out the stacked base env. Case 1: No environments activated (I think we all agree with this one)$ conda run -n haspy which -a python # expect haspy python
$CONDA_ROOT/envs/haspy/bin/python
/usr/bin/python
$ conda run -n notpy which -a python # expect system python
/usr/bin/python Case 2:
|
__conda_exe() ( | |
__add_sys_prefix_to_path | |
"$CONDA_EXE" $_CE_M $_CE_CONDA "$@" | |
) |
conda/conda/shell/etc/profile.d/conda.sh
Lines 4 to 25 in cb97f86
__add_sys_prefix_to_path() { | |
# In dev-mode CONDA_EXE is python.exe and on Windows | |
# it is in a different relative location to condabin. | |
if [ -n "${_CE_CONDA}" ] && [ -n "${WINDIR+x}" ]; then | |
SYSP=$(\dirname "${CONDA_EXE}") | |
else | |
SYSP=$(\dirname "${CONDA_EXE}") | |
SYSP=$(\dirname "${SYSP}") | |
fi | |
if [ -n "${WINDIR+x}" ]; then | |
PATH="${SYSP}/bin:${PATH}" | |
PATH="${SYSP}/Scripts:${PATH}" | |
PATH="${SYSP}/Library/bin:${PATH}" | |
PATH="${SYSP}/Library/usr/bin:${PATH}" | |
PATH="${SYSP}/Library/mingw-w64/bin:${PATH}" | |
PATH="${SYSP}:${PATH}" | |
else | |
PATH="${SYSP}/bin:${PATH}" | |
fi | |
\export PATH | |
} |
conda/conda/shell/condabin/conda.bat
Line 25 in cb97f86
@SET PATH=!_sysp!;!_sysp!\Library\mingw-w64\bin;!_sysp!\Library\usr\bin;!_sysp!\Library\bin;!_sysp!\Scripts;!_sysp!\bin;%PATH% |
So I'm thinking that we need to be looking into understanding why the prefix is being re-injected into the PATH
prior to calling conda
.
We've talked a bit more and think this is best solved differently by looking at the changes made in #8528. Given that the ticket #11174 isn't the highest priority we shouldn't block the 4.12.0 release, either. @kenodegard in case you find anything new, feel free to reopen of course! |
Fix #11174.