Open SecT0uch opened 5 years ago
@zooba does the above make sense to you? I thought the C runtime had reached a point where we wouldn't need to change how we were handling it any more?
I would like to add that previous versions of python don't need this dll
VCRuntime140.dll is needed, mostly because extension modules need to use the same one so we can't statically link it (it contains shared state). It's also not versioned the same as ucrtbase, and is not itself part of Windows.
However, it's very small. Including it unconditionally shouldn't hurt, but if the VCRedist has been installed there will already be some copy of it on the system. For Python I decided keeping that one applocal made the most sense.
Thanks! I'm still curious about:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT
vcruntime150.dll
. But that's in some unpredictable future, and the MSVC team is trying very hard to avoid needing that kind of breaking change. (Put another way, I expect there to be other bigger changes before this one hits :) )Would it be possible to ship the necessary DLLs along with the embedded Python distribution? Either included in it, or as a separate bundle alongside each Python release?
I'm grateful for your attempts to explain this to me, but from my perspective it's still a mysterious set of binary blobs I have to cobble together from somewhere, and then everybody who runs a Pynsist-built installer implicitly trusts me and whatever system I got those files off. And I'm not at all sure whether distributing them like this really complies with the license.
The DLLs are, in some situations, an absolute requirement for running Python, but they depend on the OS and the installed updates in ways I don't really understand, and I can't predict when they will change. They're the biggest headache in maintaining Pynsist.
I'd love to see a flavour of the embedded distro which contains everything needed to run Python on any recent Windows platform, regardless of what else is installed on the system. So long as this doesn't exist, I'm effectively trying to maintain the same thing as part of Pynsist. And I'm a Python programmer who works in Linux 99% of the time. I don't have the knowledge to do this well, and it's not a problem that I find interesting.
so just to confirm, pynsist bundles vcruntime140.dll such that the user is not required to install it if it's not present?
It does not. You can see the list of bundled files here:
https://github.com/takluyver/pynsist/tree/master/nsist/msvcrt/x64
And the snippet that decides whether to install them here:
https://github.com/takluyver/pynsist/blob/master/nsist/pyapp_msvcrt.nsi
Thanks for the clarification. It seems that without the bundling of this file, A user of pynsist will also need to bundle and run the redist package for the runtime. I don't understand why this file should be omitted from the list you mention. (Not being snarky, I know even less than you do about this and I'm just trying to understand what the best method of packaging a library is).
I'm not saying that it shouldn't be bundled. Just that it's not at the moment, and I don't plan to do it. ;-)
I've got tired of trying to deal with the C-runtime part. There are lots of interesting challenges in Pynsist: finding Python packages, templating the NSIS script files, working out how to record errors, even how to test parts of it. The C runtime is not interesting. It's some opaque stuff that has to be done to make Python work on some computers, but I don't know whether I'm doing it correctly or when it might need changing. I'm not even sure whether distributing the DLLs with Pynsist is really allowed by whatever license agreement they're governed by.
So from now on, I'm leaving that as a problem for someone else to solve. My ideal answer would be for Python.org to provide the necessary runtime alongside the 'embeddable' Python build, but no-one seems to be pushing for that.
I'm happy in principle to accept PRs, but since I can't audit binary blobs, I'll only accept PRs to add/replace DLLs from people I already know well.
No problem, that makes sense, thanks!
Thanks for being understanding about my tantrum :stuck_out_tongue:
For Python 3.7+ with a vanilla updated Windows10, vcruntime140.dll is needed.
The check is made on ucrtbase.dll in System32. Would it be possible to check on SysWOW64\vcruntime.dll for 32 bits and System32\vcruntime.dll for 64 bits and add the missing DLL from Visual C++ Redistributable for Visual Studio 2015 in the corresponding directory.
This would ensure a compatibility for Python 3.7+