Upgrade Win to PY2.7.14

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Upgrade Win to PY2.7.14

Post by sgrogan »

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?
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Post by sgrogan »

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?
"fight the good fight"
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Upgrade Win to PY2.7.14

Post by wmayer »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Post by sgrogan »

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.
"fight the good fight"
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Upgrade Win to PY2.7.14

Post by wmayer »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Post by sgrogan »

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?
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Post by sgrogan »

'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.
"fight the good fight"
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Upgrade Win to PY2.7.14

Post by wmayer »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Upgrade Win to PY2.7.14

Post by sgrogan »

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?
"fight the good fight"
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Upgrade Win to PY2.7.14

Post by wmayer »

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