Magnus Jacobsson [Wed, 24 Jun 2020 11:07:14 +0000 (13:07 +0200)]
Change to use patch version in the Windows installer
This changes the version in the Graphviz installer .exe produced by
CMake to use the patch version number instead of the build
date. Still, if the patch version is "$GRAPHVIZ_VERSION_DATE", the
patch version will be set to the build date. This conforms with how
the Linux packages are created.
This change affects the filename of the installer, the version
presented to the user in the installer GUI, the installation path and
the version presented by the running software.
Magnus Jacobsson [Thu, 18 Jun 2020 11:08:04 +0000 (13:08 +0200)]
Make CMake get Graphviz version from autogen.sh by parsing it
This will make autotools and CMake builds have a single source of
truth for the Graphviz version.
First, the major, minor and patch versions are retrieved. If the patch
version is "$GRAPHVIZ_VERSION_DATE", the patch version is set to the
committer date of the latest commit. This effectively repeals part of
the intention of 266ff5ee80b2d91231907e90ec650154f5225aa5: "Don't
encode build date stamp in it to be able to create reproducable
builds".
The function being called here, gmalloc, now exits on allocation failure. None
of setPrefix's callers can tolerate failure anyway, so this error handling seems
to have been incomplete previously.
exit on failure of any of the lib/common malloc wrappers
Previously, when these wrappers exhausted memory they would return a null
pointer leading to follow on memory corruption and debugging confusion. It seems
simpler to just stop when we run out of memory as we have no reasonable recovery
path at this time.
refactor a RALLOC call that can tolerate failure to realloc
We are about to make the RALLOC wrapper exit on allocation failure, so this
preserves the semantics of this call which handles allocation failure locally.
refactor calls to NEW that can tolerate failure into calloc
We are about to make the NEW wrapper exit on allocation failure, so this
preserves the existing semantics of allowing these calls to handle allocation
failure locally.
refactor any N_GNEW calls that can tolerate allocation failure to calloc
We are about to change the N_GNEW wrapper to exit on failure, so this preserves
the semantics of allowing these few locations to handle allocation failure
locally.
refactor a GNEW call that can tolerate failure into a direct malloc
We are about to make the GNEW wrapper exit on allocation failure, so this
preserves the existing semantics of allocation failure being non-fatal to this
call. This is the only GNEW call I can see that can tolerate allocation failure.
The header for this library was not being installed and we do not want users
directly accessing this data, so the PDF documentation was not useful to them.
The function being called here, gmalloc, now exits on allocation failure. None
of setPrefix's callers can tolerate failure anyway, so this error handling seems
to have been incomplete previously.
exit on failure of any of the lib/common malloc wrappers
Previously, when these wrappers exhausted memory they would return a null
pointer leading to follow on memory corruption and debugging confusion. It seems
simpler to just stop when we run out of memory as we have no reasonable recovery
path at this time.
refactor a RALLOC call that can tolerate failure to realloc
We are about to make the RALLOC wrapper exit on allocation failure, so this
preserves the semantics of this call which handles allocation failure locally.
refactor calls to NEW that can tolerate failure into calloc
We are about to make the NEW wrapper exit on allocation failure, so this
preserves the existing semantics of allowing these calls to handle allocation
failure locally.
refactor any N_GNEW calls that can tolerate allocation failure to calloc
We are about to change the N_GNEW wrapper to exit on failure, so this preserves
the semantics of allowing these few locations to handle allocation failure
locally.
refactor a GNEW call that can tolerate failure into a direct malloc
We are about to make the GNEW wrapper exit on allocation failure, so this
preserves the existing semantics of allocation failure being non-fatal to this
call. This is the only GNEW call I can see that can tolerate allocation failure.
The code in mkdef.c gets compiled and executed during Graphviz compilation. When
building with Address Sanitizer enabled, instrumentation is also applied to this
utility during compilation. Usually this is not a problem, but when configuring
ASan to exit with an error on leak detection it would cause the build step that
runs mkdefs to erroneously fail. We now explicitly clean up before exiting
mkdefs, making ASan happy in all configurations. Closes #1741.
The only possible lib/graph header imported by any of the tools is agxbuf.h, but
this is shadowed by the same named header in lib/cgraph. Having lib/graph in the
list of include directories here was a little dangerous as reordering would have
caused the tools to pick up lib/graph's copy. Furthermore as we are not
currently building lib/graph, this likely would have caused link failures.
Related to #1549.
Unfortunately a definition/declaration with no parameters in older C is
ambiguous. Explicitly saying 'void' tells the compiler this takes no arguments.
This silences a -Wstrict-prototypes warning on GCC 8.3.