I was able to build 0.17 pre-release but got this error trying to build the 0.17 release.
The only difference I'm aware of on my side is trying to use zipios 2.X instead of the old 0.1.5.9 (it's unbundled on Fedora), but I'm not sure that's relevant to this error.
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Base/GeometryPyCXX.cpp: In member function 'virtual int Base::Vector2dPy::setattro(const Py::String&, const Py::Object&)':
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Base/GeometryPyCXX.cpp:157:31: error: 'const class Py::Object' has no member named 'isNull'; did you mean 'isNone'?
BUILDSTDERR: if (name == "x" && !value.isNull()) {
BUILDSTDERR: ^~~~~~
BUILDSTDERR: isNone
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Base/GeometryPyCXX.cpp:161:36: error: 'const class Py::Object' has no member named 'isNull'; did you mean 'isNone'?
BUILDSTDERR: else if (name == "y" && !value.isNull()) {
BUILDSTDERR: ^~~~~~
BUILDSTDERR: isNone
I assume on Fedora the pycxx lib has its own package which you have installed. You can configure FreeCAD to use the system pycxx version by setting PYCXX_INCLUDE_DIR and PYCXX_SOURCE_DIR accordingly.
But I don't think this will fix the first build error inside GeometryPyCXX.cpp.
Another option might be to uninstall the pycxx package and use FreeCAD's one.
Yes, I need to use the Fedora version if at all possible. Bundling exceptions require approval by the Fedora Packaging Committee.
I've been using the PYCXX_* options to build against the system version for some time but Rawhide (f29) has been updated to PyCXX 7.0.3.
I'm working on FindPyCXX.cmake to detect the version and add the extra source if >=7.0.0 but that's a dead end unless the FreeCAD source can be updated to work with either version.
> On 17 Apr 2018, at 14:07, Richard Shaw <hobbes1069@...> wrote:
>
> BUILDSTDERR: throw Py::Exception(Base::BaseExceptionFreeCADError,str.str());
You have two ways to proceed.
1) define PYCXX_6_2_COMPATIBILITY and use the old API
2) port to the V7 API - have a look at CXX/Python2/Exception.hxx
and the PYCXX_USER_EXCEPTION_xxx macros.
Oh and you might find the brief notes in the readme informative.
I'm trying adding a command line definition in the spec file on Fedora for the temporary fix. Can we do some version checking with CXX/Version.hxx and add the define when needed until FreeCAD gets ported to the 7.X API?
Now you get some build failures because Py::Exception(const std::string &) doesn't exist any more. Here you can replace Py::Exception with Py::RuntimeError.
Is there a good way to generalize the last part? Right now I'm trying a brute force grep for one and sed replace with the other.
I've added all the cmake logic to add cxx_exceptions if CXX >= 7.0.0 including adding the definition. Just need to figure out the last part and I can make this a pull request.
Wait! At the moment I am building the master branch against PyCXX 7.0.3 and almost fixed most of the build failures. Just need to wait until it's completed before I can check it in.
Is there a good way to generalize the last part? Right now I'm trying a brute force grep for one and sed replace with the other.
This won't work because it only fails for these cases where Py::Exception is used with a single argument.
wmayer wrote: ↑Wed Apr 18, 2018 4:54 pm
Wait! At the moment I am building the master branch against PyCXX 7.0.3 and almost fixed most of the build failures. Just need to wait until it's completed before I can check it in.
Is there a good way to generalize the last part? Right now I'm trying a brute force grep for one and sed replace with the other.
This won't work because it only fails for these cases where Py::Exception is used with a single argument.
I should probably submit my cmake patch which detects the CXX version from the Version.hxx header and adds cxx_exception.cpp to the sources if >=7 is detected.
Now I'm having a problem with smesh I'm guessing, but I'll post that to another thread.