Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

Jee-Bee wrote: Mon Jul 02, 2018 6:39 pm Add just another build to travis. even if it don't compile for the next weeks (// (13/12) = months) than it is clear what happening.
The last python 3 build is 400 commits old :(
I could do it but you wouldn't be able to enter the Sketcher edit mode and things like that. That is why it makes sense to first fix the package on the PPA. We will get there as we are in the aggressive mode now (ETA 2 weeks). :)

@sgrogan

Just hit your personal Ubuntu 16.04 PPA with everything you got and don't worry about it. I can look at the recipe and the build logs after. If there will be issues. And take your time there is no fire yet.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Porting to python3

Post by sgrogan »

Jee-Bee wrote: Mon Jul 02, 2018 6:39 pm Add just another build to travis.
On Travis we have this and the PY3 build passes all non-gui self-tests https://travis-ci.org/FreeCAD/FreeCAD/b ... tification it is Build Job 5598.3 which equals 0.18.14001
The Travis build uses default Trusty 14.04 libs ie PY3.4

In addition I have a locally compiled PY3.4 build on my native Trusty system that works nearly perfect. PY3.4 is not the problem.

The problems are all with how I am packaging the freecad-testing PPA package.
1) It should be import area not import libarea. This doesn't work because I'm not building the Path WB for the freecad-testing package :oops: . Should be and easy fix.
2) The sketch edit problem is due to me not installing the EXT directory in the freecad-testing package. Should also be an easy fix.
3) The desktop file problem needs to be fixed in freecad-testing . I think it should just require the same fixes applied to freecad-daily.

@triplus, if you agree, I think we should hammer a little more on 14.04, so we get as many older distros as possible. I'm pretty sure PY3.4 isn't the problem.
"fight the good fight"
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

sgrogan wrote: Mon Jul 02, 2018 9:48 pm In addition I have a locally compiled PY3.4 build on my native Trusty system that works nearly perfect. PY3.4 is not the problem.
Can confirm. I am not heavily involved in Py3 porting effort therefore if @looo feels some Py3 version is too old i can acknowledge that. Anyway if Ubuntu 14.04 is back as the primary target i feel that is OK too and lets do that and see potential Py3 related version issues after.
1) It should be import area not import libarea. This doesn't work because I'm not building the Path WB for the freecad-testing package :oops: . Should be and easy fix.
When i try to import area i can confirm it is trying to use the Py2 (Boost) version. No problems like that on Ubuntu 16.04. In the next try leave the additional CMake line addressing this issue and enable Path workbench. Likely that should fix the issue for the freecad-testing package.
2) The sketch edit problem is due to me not installing the EXT directory in the freecad-testing package. Should also be an easy fix.
Great. This is likely contributing to most of the issues we are seeing. Like when entering sketcher edit mode, tests issues ...
3) The desktop file problem needs to be fixed in freecad-testing . I think it should just require the same fixes applied to freecad-daily.
Yes. There is a tool on Ubuntu available by default:

Code: Select all

desktop-file-validate freecad-testing.desktop
Basically no errors should be reported.
@triplus, if you agree, I think we should hammer a little more on 14.04, so we get as many older distros as possible. I'm pretty sure PY3.4 isn't the problem.
We are in aggressive mode now. Therefore whatever will get us to results first has my agreement. :)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

Can confirm. I am not heavily involved in Py3 porting effort therefore if @looo feels some Py3 version is too old i can acknowledge that. Anyway if Ubuntu 14.04 is back as the primary target i feel that is OK too and lets do that and see potential Py3 related version issues after.
I never tested 3.4. There was only a comment in the cmake (I guess from yorik) which disallowed building with 3.4. So I never tried this. I think wmayer made some changes to build freecad with py3.4 on windows with vs 12 or 13.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

Hi @sgrogan

I noticed you triggered a new build. I did some tests and import area now works and Path workbench is available. Trying to enter sketcher edit mode still result in issues(Extension: Extension type not set). In addition i forgot to mention it again but in the desktop file there is a line:

Code: Select all

Exec=/usr/bin/freecad-testing --single-instance %U
The /usr/bin part should be omitted or the AppImage build process will look for it at the wrong place.

Code: Select all

Exec=freecad-testing --single-instance %U
Tomorrow likely i won't have much time but what i guess is next on the todo list is to compare what the "debian folder" is doing compared to the local build. Hopefully clues will emerge.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

triplus wrote:Extension: Extension type not set
https://github.com/FreeCAD/FreeCAD/blob ... on.cpp#L78

I guess we need some help from the c++ experts.
wmayer wrote:
ickby wrote:
DeepSOIC wrote:
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Porting to python3

Post by sgrogan »

looo wrote: Wed Jul 04, 2018 1:32 am I guess we need some help from the c++ experts.
It has to be due to dependencies/packaging. My local build doesn't have this problem and I think I'm using the same libs? I'll try to run ldd and campare my local build with FreeCAD testing.
"fight the good fight"
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

strange.

I don't want to interrupt you with packaging, but I found another problem today:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7fdccb47c4b0]
#1  0x7fdcd1b9c3af in Gui::CallTipsList::extractTipsFromObject(Py::Object&, Py::List&, QMap<QString, Gui::CallTip>&) const from /home/lo/conda/envs/freecad/bin/../lib/libFreeCADGui.so+0x7f
#2  0x7fdcd1b9dd46 in Gui::CallTipsList::extractTips(QString const&) const from /home/lo/conda/envs/freecad/bin/../lib/libFreeCADGui.so+0x716
#3  0x7fdcd1b9e539 in Gui::CallTipsList::showTips(QString const&) from /home/lo/conda/envs/freecad/bin/../lib/libFreeCADGui.so+0x119
#4  0x7fdcd1ba9d0b in Gui::PythonConsole::keyPressEvent(QKeyEvent*) from /home/lo/conda/envs/freecad/bin/../lib/libFreeCADGui.so+0x44b
happens on inspecting a object.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Porting to python3

Post by sgrogan »

looo wrote: Fri Jul 06, 2018 11:51 am happens on inspecting a object.
What are the steps to reproduce this?
looo wrote: Wed Jul 04, 2018 1:32 am Tomorrow likely i won't have much time but what i guess is next on the todo list is to compare what the "debian folder" is doing compared to the local build. Hopefully clues will emerge.
I am stuck :oops: I can't find the difference :(
"fight the good fight"
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

Didn't have much free time in the past days. Will look into it more in depth in the following days and report back.
Post Reply