-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Resolve prefix injection #11666
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
Resolve prefix injection #11666
Conversation
I think it has to do with how DLL loading works on Windows. DLLs have to be on PATH, and the |
@jaimergp probably but I assume something has improved in this regard since the patch has been removed and since other versions of the Python package don't appear to have this patch |
I think it was removed in 3.9.something and 3.10 (at least in conda-forge). |
I see that CF's Python 3.6 still has the patch, the other versions do not |
227ec1d
to
a6d66e3
Compare
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.
Comments not withstanding, let's merge this as-is and create a follow-up issue to fix the Windows CI setup and/or add support for the tests that are currently not working in the CI setup. It's not ideal, but as long as the manual tests worked, that's better than nothing.
I'd be interested to hear what the VS Code people think abut this, maybe they could try the Canary build of this?
Nice sleuthing @kenodegard!! 🥳
a6d66e3
to
23705cc
Compare
b5e5f77
to
9903534
Compare
if( $conda_tmp_status != 0 ) exit ${conda_tmp_status} | ||
eval "${ask_conda}" | ||
rehash | ||
breaksw | ||
default: | ||
$_CONDA_EXE $argv[1-] | ||
setenv PATH "$conda_tmp_path" | ||
# setenv PATH "$conda_tmp_path" |
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.
@kenodegard Didn't you want to clean these things up before merge?
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.
oops missed this one
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.
Description
Depends on #11649
Resolves #11174
When running
conda run
, users discovered that the wrong executable is invoked. This was especially noticeable on Windows. We first attempted to address this issue in #11257 but found that the source of the prefix injection occurred at the shell integration level so trying to do the path deduplication in the Python code would've been ripe for buggy behavior.We narrowed it down to being the prefix injection that occurred in the following locations:
conda/conda/shell/etc/profile.d/conda.sh
Lines 4 to 30 in 8c835dd
conda/conda/shell/etc/profile.d/conda.csh
Lines 29 to 30 in 8c835dd
conda/conda/shell/condabin/conda.bat
Line 25 in 8c835dd
conda/conda/shell/condabin/_conda_activate.bat
Line 23 in 8c835dd
conda/conda/shell/condabin/Conda.psm1
Lines 46 to 73 in 8c835dd
After digging through
conda.activate
and the git history, it appears that the prefix injection code was first introduced inconda 4.4
(April 2017), @kalefranz sums it up well in comments that have unfortunately not withstood the test of time:conda/conda/activate.py
Lines 219 to 225 in c6e8d6a
Subsequent changes indicate that this injection on Python startup was actually a Python 3.6 feedstock patch which appears to have been long since removed (AnacondaRecipes/python-feedstock@ef17e17).
In
conda 4.6.9
(March 2019) the Python package patching was instead replaced (ca77c9c) with the shell interface prefix injection that we see today.Originally all of this prefix injection was unique to Windows but eventually in
conda 4.6.13
(April 2019) it was mirrored over to *nix systems (8ec72dd) which is where we find ourselves now, still wondering WTF.Checklist - did you ...
news
directory (using the template) for the next release's release notes?Add / update outdated documentation?