[vtk-developers] Python Wrapping fails in master build.

David Gobbi david.gobbi at gmail.com
Mon Sep 24 16:40:57 EDT 2018


Hi Andrew,

I've merged a patch that has a minuscule chance of fixing your wrapper
issue:
https://gitlab.kitware.com/vtk/vtk/merge_requests/4697
This is a patch to vtkWrapPython that closes the output *Python.cxx file
prior to exit (of course, the Windows loader should close all open files on
exit automatically, which isn't an excuse for the missing "fclose()" in the
code, but it does suggest that this patch will have no net effect).  The
patch also fixes an instance where an error could occur without an error
message being printed.


With regards to incremental builds, there are deficiencies in the
dependency tracking for wrappers, and even though I don't think they are
related to the build problems that you are seeing, they are worth
mentioning:

When vtkWrapPython reads a header for wrapping, it must also handle all the
#include statements so that it can look for macros and definitions much
like a C++ compiler would.  In other words, each file is #included should
be a dependency, but most build systems can only handle such dependencies
for rules that call the C++ compiler itself, and not for custom commands
like vtkWrapPython.

There actually are two backend-specific ways to handle such dependencies in
cmake:
(1) For the "Makefile" generator, cmake can generate the dependencies on
the first build but the dependency list becomes out-of-date on subsequent
builds.
(2) For the "Ninja" generator, and only for very recent versions of cmake,
it would be possible to add a customized dependency-generation rule, but I
haven't looked into it in much detail (it would be a lot of work to
implement, and wouldn't work on any other backends).

However, the kinds of incremental build changes that cause wrapper builds
to fail are rare, and the build errors that you saw are not indicative of a
dependency problem.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20180924/411c5f7a/attachment-0001.html>


More information about the vtk-developers mailing list