Add activation script to check for system-libs that override openssl install#56
Add activation script to check for system-libs that override openssl install#56h-vetinari wants to merge 6 commits intoconda-forge:mainfrom
Conversation
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
|
@conda-forge-admin, please rerender |
isuruf
left a comment
There was a problem hiding this comment.
check which libssl-1_1-x64.dll is the first on PATH
It doesn't matter which DLL is the first on PATH. Windows loader looks at C:\Windows\System32 first and then the paths on PATH. So, we should just look at whether the file C:\Windows\System32\libcrypto-1_1-x64.dll exists or not as I mentioned at conda-forge/cryptography-feedstock#37 (comment)
b327e03 to
43da30c
Compare
I wasn't aware of this intricacy of the windows loader. It unfortunately messes up my idea to set I mean, running python and checking the out put of would work in principle (but not for this feedstock). Does someone have an idea on how I could check which library the windows loader would pick up (say, from within python)? |
|
Nevermind, I found & fixed a mistake and repushed. |
|
@conda-forge-admin, please rerender |
…nda-forge-pinning 2020.04.26.19.17.14
|
I had made an oversight while refactoring - |
|
Thinking ahead to implementing a similar activation script for |
|
Why don't we make a common package for this check that both openssl and anything else can depend on? I need to check that activation order is correct though yeah.. |
That's certainly a smart approach, but there are non-python environments that just use openssl (and should see a warning like in this PR). But I'm guessing this could be solved with some additional checks in the activation script of that common dependency? |
|
This warning should always be there because |
This is pretty much what I've done in conda-forge/staged-recipes#11452 :) |
|
Why not merge this as is? |
We can, but once we also add an activation script for cryptography, we'll be duplicating warnings, or having to muck around with order/dependencies of those scripts. It wasn't my idea, but I tend to agree with @mingwandroid that the cleanest solution is common dependency that covers all cases. |
|
Why do we need another warning for cryptography? |
Because only there can we try to activate |
|
Yes, but the warning for openssl should be there regardless. So, the two scripts does two different things. |
That's an option, true. It's just not very user friendly because they'll be getting the same or similar warnings twice, because we (or at least I) don't know in which order the activation scripts will be triggered. That might mean (assuming cryptography comes first and succeeds with The third warning is IMO unnecessarily loud, and can be avoided with the approach in conda-forge/staged-recipes#11452. The openssl block would only get shown if no cryptography is installed. |
I think the order is dependency order and if there's a cycle, alphabetically by the name of the script. |
Assuming we get the order deterministically, we still need to either block or overwrite one or the other (depending on which libraries are present in the environment), if we want to avoid duplicated warnings. This sounds like much more pain than it's worth (especially if there's an easy alternative). |
|
@isuruf Arguably then, this does not need a new common dependency, but the activation script here could just as well probe for the presence of PS. But it's probably harder to get outdated DLLs into the test enviroment (in conda-forge/staged-recipes#11452, I have the luxury of having |
|
Do we still need this? |
Would still be nice to have IMO, but my efforts in staged-recipes stalled for lack of review and then keeping things up to date. I don't know the current status of path-resolution on windows around |
Checklist
0(if the version changed)conda-smithy(Use the phrase@conda-forge-admin, please rerenderin a comment in this PR for automated rerendering)This comes out of discussions with @isuruf and @mingwandroid in conda-forge/cryptography-feedstock#37 and conda-forge/python-feedstock#345.
The short story is that the cryptography test suite luckily picked up that the presence of outdated system libs in
C:\Windows\System32caused a wrong openssl-version to be linked under the hood.While setting
CONDA_DLL_SEARCH_MODIFICATION_ENABLEallows to work around this, it was deemed "too big of a hammer" to be generally enabled. However, in order not to leave affected users (with such outdated libs on the system path) unknowingly vulnerable, the suggestion was to check this in an activation script foropenssl.The script works as follows:
libssl-1_1-x64.dllis the first on PATHlibcrypto-1_1-x64.dllis the first on PATHCONDA_DLL_SEARCH_MODIFICATION_ENABLEis not set: set it and try again