Upgrade Win to PY2.7.14

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Upgrade Win to PY2.7.14

Postby sgrogan » Sat Jan 27, 2018 7:09 pm

In response to issue #3295
I have been able to build PY2.7.14 release and debug versions and attempt to add to the Libpack. https://github.com/sgrogan/FreeCAD/rele ... py_2.17.14 (debug build for FreeCAD won't work due to VTK and other stuff)
I get the following when starting FreeCAD (Start WB is my default)

Code: Select all

'module' object has no attribute 'openssl_md_meth_names'
I suspect some conflict with mysql/ssl/mariadb due to using the pre-compiled QT 4.8.7(VS2013) binaries from here: https://www.npcglib.org/~stathis/blog/p ... d-qt4-qt5/
I tried to profile with depends but didn't see anything obvious to me.
Any suggestions?
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Postby sgrogan » Thu Feb 01, 2018 11:11 pm

I found this: https://github.com/Homebrew/legacy-home ... sues/36346
so I ran

Code: Select all

>>> print _hashlib.__file__
C:\Users\Chris\GitHub\FCAutoBuild\var\build_x64_VC12\bin\DLLs\_hashlib.pyd
>>> 
I haven't updated these file since peterl94's original VS2013 libpacks. Do I need to update them? And from which package are they created from? Still this symbol should exist in the older python they came from?
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: Upgrade Win to PY2.7.14

Postby wmayer » Fri Feb 02, 2018 11:48 am

All what I have replaced in the libpack are two files:
* the python27.dll in the bin directory
* patchlevel.h in the include directory (this is required when running cmake so that interpreter version matches with the C defines)

I haven't replaced any other files i.e. I left all the .pyd files. And so far I haven't noticed any problems.
'module' object has no attribute 'openssl_md_meth_names'
Not sure but do you lack of the file _ssl.pyd?
I haven't updated these file since peterl94's original VS2013 libpacks. Do I need to update them? And from which package are they created from? Still this symbol should exist in the older python they came from?
All these files are part of the Python sources. When loading the .sln file into VS you should get a list of all targets.
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Postby sgrogan » Fri Feb 02, 2018 12:20 pm

wmayer wrote:
Fri Feb 02, 2018 11:48 am
* the python27.dll in the bin directory
* patchlevel.h in the include directory (this is required when running cmake so that interpreter version matches with the C defines)
Ahh, I have replaced everything, all the headers, libs, and .py files. I will try to build the addition dll's and replace them as well.
Thanks as always for the help.
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: Upgrade Win to PY2.7.14

Postby wmayer » Fri Feb 02, 2018 12:56 pm

sgrogan wrote:
Fri Feb 02, 2018 12:20 pm
wmayer wrote:
Fri Feb 02, 2018 11:48 am
* the python27.dll in the bin directory
* patchlevel.h in the include directory (this is required when running cmake so that interpreter version matches with the C defines)
Ahh, I have replaced everything, all the headers, libs, and .py files. I will try to build the addition dll's and replace them as well.
Thanks as always for the help.
It might be safer to replace all Python related files because there are also a lot of changes inside the .py files.
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Postby sgrogan » Fri Feb 02, 2018 5:53 pm

wmayer wrote:
Fri Feb 02, 2018 12:56 pm
It might be safer to replace all Python related files because there are also a lot of changes inside the .py files.
Is it desirable to include the debug (and pdb's) versions in the libpack of the .pyd's?
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Postby sgrogan » Fri Feb 02, 2018 6:16 pm

'openssl_md_meth_names' was added to _hashlib.pyd in Python 2.7.9, so this explains the error.
It seems when building _hashlib.pyd the Python project tries to build it's own openssl as part of the process. I think I now understand @peterl94's patches mentioned in the issue tracker.
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: Upgrade Win to PY2.7.14

Postby wmayer » Fri Feb 02, 2018 7:10 pm

sgrogan wrote:
Fri Feb 02, 2018 5:53 pm
wmayer wrote:
Fri Feb 02, 2018 12:56 pm
It might be safer to replace all Python related files because there are also a lot of changes inside the .py files.
Is it desirable to include the debug (and pdb's) versions in the libpack of the .pyd's?
If they take too much space you can omit them.
User avatar
sgrogan
Posts: 5321
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Postby sgrogan » Sat Feb 24, 2018 4:07 pm

wmayer wrote:
Fri Feb 02, 2018 12:56 pm
It might be safer to replace all Python related files because there are also a lot of changes inside the .py files.
I am almost there.
Only _sqlite3.pyd remains. I'm linking against sqlite3.lib (version 3.8.5) in the 11.x series libpacks, but I get the following.

Code: Select all

1>------ Build started: Project: _sqlite3, Configuration: Release x64 ------
1>LINK : warning LNK4001: no object files specified; libraries used
1>LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup
1>C:\Users\Chris\Downloads\Python-2.7.14-copy\PCBuild\\amd64\_sqlite3.pyd : fatal error LNK1120: 1 unresolved externals
Any ideas?
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: Upgrade Win to PY2.7.14

Postby wmayer » Mon Feb 26, 2018 12:36 pm

I never tried to build the _sqlite3 module and I don't think that we really need it.