Skip to content
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

Removing prefix injection breaks DLL loading if the Python DLL patch is missing #12240

Open
1 of 7 tasks
travishathaway opened this issue Jan 12, 2023 · 2 comments
Open
1 of 7 tasks
Labels
epic a highlevel collection of smaller related issues source::anaconda created by members of Anaconda, Inc. spike issue is for doing research work or prototyping; outcome is optional and not required

Comments

@travishathaway
Copy link
Contributor

travishathaway commented Jan 12, 2023

What is the idea?

This is the continuation of the work initially completed in this pull request:

To address issues brought up by this pull request (#11795 & #12161), we are currently entertaining different approaches to resolving, one of which may be reverting the changes. But first, we need better test coverage to prove we are doing the Right Things™️.

History

  1. conda shell function injects $CONDA_PREFIX into $PATH causing incorrect behavior in conda run #11174
    • initial issue reported by VSCode/Microsoft
  2. Remove base environment PATH components from conda run environment #11257
    • first attempt to fix the issue
    • doesn't remove the prefix injection that occurred on the shell interface level but removes the prefix injected (by the shell interface) just before executing the conda run script
    • discovered conda (de)activate didn't work as expected, specifically SHLVL 0 on Windows wasn't as untouched as expected (e.g., the %PATH% included more than just the condabin path)
    • identified 3 different cases of how environment activation should work Remove base environment PATH components from conda run environment #11257 (comment)
    • PR closed as it didn't solve the root problem
  3. Resolve prefix injection #11666
    • second attempt to fix the issue
    • includes a detailed history of how the prefix injection code got added to conda in the first place Resolve prefix injection #11666 (comment)
    • discovered that the Python package on defaults and conda-forge both implement a DLL patch that made the prefix injection unnecessary
    • discovered that the DLL patch was missing in newer Python versions, this was corrected since the patch allows Python programs to run on Windows without activating the environment (an important nice to have)
    • PR merged as it removed complex shell-level code that complicated the Python code
  4. CondaSSLError: OpenSSL appears to be unavailable on this machine. #11795 & Conda update failing on git bash (libmamba-solver issue) #12161

Other related issues

Tasks

#12240 (comment)

#12240 (comment)

#12240 (comment)

@travishathaway travishathaway added the type::feature request for a new feature or capability label Jan 12, 2023
@kenodegard kenodegard added source::anaconda created by members of Anaconda, Inc. backlog issue has been triaged but has not been earmarked for any upcoming release labels Jan 12, 2023
@kenodegard
Copy link
Contributor

cc @mbargull @jezdez

@kenodegard kenodegard changed the title Add tests to better coverage for conda run checking for correct PATH/prefix Removing prefix injection breaks DLL loading if the Python DLL patch is missing Jan 12, 2023
@kenodegard kenodegard added epic a highlevel collection of smaller related issues spike issue is for doing research work or prototyping; outcome is optional and not required and removed type::feature request for a new feature or capability labels Jan 12, 2023
@travishathaway
Copy link
Contributor Author

travishathaway commented Jan 19, 2023

I added a new issue under "Other related issues" that also show the side-effects of removing sys path injection:

It's not directly related to DLLs, but I figured it would be good to group here.

@beeankha beeankha removed the backlog issue has been triaged but has not been earmarked for any upcoming release label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic a highlevel collection of smaller related issues source::anaconda created by members of Anaconda, Inc. spike issue is for doing research work or prototyping; outcome is optional and not required
Projects
Status: 🧞 Wishlist
Development

No branches or pull requests

3 participants