toolmanager bombed out , all tools gone.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

The FreeCAD info you have provided shows that you are using PY2. Without modification to the code the tool table won't work with PY2.
Thanks, so it is confirmed that FreeCAD will no longer correctly build with the default build parameters ! That does not make sense to me. Either officially bin py2 and make py3 the default build or make py2 work. This is neither one nor the other and seems a bit crazy to have py2 default when it is know not to work and there is a de facto policy not to support it.

This really needs to be stopped straight away in the build process with an assert. I should not have wasted the last day and a half discussing the issue and desperately trying different builds and options when this is known not to work. If you write py3 only code at least ensure py3 when building or stop the build with an explanation.

Thanks for the info on this. At least I'm a lot clearer what is going on now. What sort of changes need to be made for this to build on py2? Is it complicated and far reaching or just a few standard compatibility fixes?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: toolmanager bombed out , all tools gone.

Post by DeepSOIC »

dubstar-04 wrote: Tue Oct 08, 2019 6:57 am
mlampert wrote:
IMHO there is really no point in doing anything for py2 or qt4 in the 0.19 development. The major focus for 0.18 was to become py3 and qt5 compatible because the older versions are practically obsolete.
This is also my understanding. I have no intention of testing the development branch with PY2 when the intention is to drop support for it.

That been said if there is an official requirement to maintain support for PY2 for the 0.19 cycle I can revisit the tooltable and make the necessary changes.
Has it been announced by main devs that 0.19 drops support of Py2? If not, I assume Py2 support is required.
In Release_notes_0.19, I see this:
Any existing dependence on Python 2 or Qt4 will not be supported beyond 1st January 2020 when Python 2 officially became unsupported by the Python Foundation.
And looking at builds we have on GitHub, Py2 is indeed abandoned, as there is only one py2 build there that is quite old (pre big merge, by the looks of it). I would love to stop supporting Py2, as it is getting painful.


wmayer wrote:Ding!
Werner, can you please clear up the current state of things?
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

Just tried the py3/qt4 build it segfaults straight off the bat. This may be related to the inclusion of python 2.7 during cmake which I pointed about above .

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib64/libc.so.6(+0x38600) [0x7f327ab20600]
#1  /lib64/libpython2.7.so.1.0(Py_InitModule4_64+0x42) [0x7f3277679e42]
#2  /usr/lib64/python3.7/site-packages/PySide/QtCore.so(PyInit_QtCore+0x4f) [0x7f32682b0ddf]
#3  /lib64/libpython3.7m.so.1.0(_PyImport_LoadDynamicModuleWithSpec+0x182) [0x7f327f42b382]
#4  /lib64/libpython3.7m.so.1.0(+0x22469e) [0x7f327f42b69e]
#5  /lib64/libpython3.7m.so.1.0(_PyMethodDef_RawFastCallDict+0x2f7) [0x7f327f33a8d7]
Here is what I noted in cmake output:

Code: Select all

-- Checking for module 'Coin'
--   Package 'Coin', required by 'virtual:world', not found
-- Coin3D libraries found
-- Found Spnav: /usr/lib64/libspnav.so  
-- Using default python: -python2.7
-- libshiboken built for Release
-- Using default python: .cpython-37m-x86_64-linux-gnu
-- Found PySide Tools: /bin/pyside-uic, /bin/pyside-rcc
-- -- matplotlib-2.2.4 has been found.

Code: Select all

 python -V
Python 2.7.16
CompileOnUnix:
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 ../freecad-source
default python is indeed py2 on this machine, it seems that the cmake option is not ensuring py3 in all places. Is this an oversight?


Can anyone explain what this is all about? I built coin, pivy, occt and opencamlib locally, do I need to rebuild any / all of those if I use py3 build of FreeCAD?
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: toolmanager bombed out , all tools gone.

Post by dubstar-04 »

vocx wrote: Mon Oct 07, 2019 5:48 pm
freman wrote: Mon Oct 07, 2019 6:56 am ...Googling the errors seemed to indicate qttools et al but already have those installed. Any ideas on what is missing?
Compiling requires you to install many dependencies, not only one qttools package. See again CompileOnUnix.
Have you followed the instructions on the wiki?
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

Do you have any specific point to make ? I have build FC a score of times on this machine over the last year. Clearly I have all the various packages in place for py2/qt4. It has never presented the kind of problems I've been having in the last couple of months.

I do not see anything on CompileOnUnix relating to moving to qt5 , other than the cmake option, and none of the package names in the Fedora specific sections even relate to qt5 packages. I am ahead of the info given there.

py2 is now broken, py3/qt4 segfaults and qt5 does not get through cmake. For the moment I have no way forward to build FreeCAD on this machine.

I have provided specific output on all these issues and have yet to see anything more relevant than "did you read the guide?".
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: toolmanager bombed out , all tools gone.

Post by dubstar-04 »

freman wrote: Tue Oct 08, 2019 11:38 am I have provided specific output on all these issues and have yet to see anything more relevant than "did you read the guide?".
I do apologise, following the instructions on the wiki and using cmake-gui to check all the settings I haven't faced any issues.

You could always ask in the install / compile part of the forum: https://forum.freecadweb.org/viewforum.php?f=4
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

thanks,

It seems those working on the code using linux seem to be focused on Ubuntu and there is little testing beyond that. All snapshot builds depend on PPA Ubuntu specific installation.

Package naming is one thing which changes with different distros and I am still trying to find out what package is ( apparently ) missing to build FC using qt5 on Fedora 29. There is no help on that in the guide.
wmayer
Founder
Posts: 20244
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: toolmanager bombed out , all tools gone.

Post by wmayer »

Looks like more py3 stuff not tested on py2.
Sooner or later you have to switch to a py3 build because py2 officially expires in less than three months.
Again this highlights the need for basic testing on a python2 build. Folks messing with code using only python3 are breaking stuff.
I guess most developers have moved to the Py3/Qt5 combination on their systems which is good. And it's recommended that they should no longer worry about Py2 or Qt4 because it is and always was a nightmare to maintain all the combinations Py2/Qt4, Py2/Qt5 or Py3/Qt5 (Py3/Qt4 was never officially supported).

Nevertheless, if someone runs into a Py2 or Qt4 problem that can be easily fixed I am still open to make a fix for it. As DeepSOIC already said there are systems where Qt5 causes quite some problems whereas Qt4 worked perfectly well.
thanks for the replies. If that is the state for python2 then the default build should be python3. I never had any need or reason to prefer py2, I just used the default build.
The problem is that the executable "python" on most systems still points to python2. You have to manually change this entry to python3.
Program received signal SIGSEGV, Segmentation fault.
#0 /lib64/libc.so.6(+0x38600) [0x7f6a6db43600]
#1 /lib64/libpython2.7.so.1.0(Py_InitModule4_64+0x42) [0x7f6a6a69ce42]
#2 /usr/lib64/python3.7/site-packages/PySide/QtCore.so(PyInit_QtCore+0x4f) [0x7f6a5a8b2ddf]
#3 /lib64/libpython3.7m.so.1.0(_PyImport_LoadDynamicModuleWithSpec+0x182) [0x7f6a7244e382]

Look at your call stack. You have a mix-up of Py2 and Py3 which is not going to work. Apparently the problem is the existence of PySide which is built for Py2. You have to un-install it completely and instead install PySide2.
TypeError: cannot return std::string from Unicode object
This error is raised by PyCXX. For Py2 it does check if the object behind the scene is of type unicode and if yes it raises that error.
ust in case this is clue, it seems I get a spurious extra new on the penultimate line of user.cfg at each run of FC. Also note the lack of newline after the last paramGroup entry. I do not know whether this apparently minor bug has any knock on effects, perhaps when re-reading the file later. I'm guessing the newline is being written at the wrong time inside a loop.
For reading or writing the user.cfg we use the xerces library and for some reason it (sometimes) adds these extra newlines. However, this is not a problem at all because if they are there or not it has no impact on the actual content because they appear between two tags.
Are there any interim releases of 0.19 or does " stable" mean 0.18 ?
The v0.19 at the moment cannot be considered stable at all. Many things have been merged in the recent weeks and it will take several weeks or months to find and fix all the regressions. The last official release is v0.18 and this is can be considered as stable.
Be aware that there is a bug in the 18.x tool table that prevented tools being saved. That was fixed here:
https://github.com/FreeCAD/FreeCAD/comm ... 33b97ed8aa
Is it hard to back port this to 0.18?
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: toolmanager bombed out , all tools gone.

Post by dubstar-04 »

wmayer wrote: Tue Oct 08, 2019 12:04 pm
Be aware that there is a bug in the 18.x tool table that prevented tools being saved. That was fixed here:
https://github.com/FreeCAD/FreeCAD/comm ... 33b97ed8aa
Is it hard to back port this to 0.18?
I added the commit to the 0.18 backport thread: https://forum.freecadweb.org/viewtopic. ... 80#p330071

Is there something I can do to help get it included?

Thanks,

Dan
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: toolmanager bombed out , all tools gone.

Post by DeepSOIC »

wmayer wrote: Tue Oct 08, 2019 12:04 pm...
Thanks, I posted an announcement: https://forum.freecadweb.org/viewtopic.php?f=9&t=39926
Post Reply