Based on line 395 of this same file, it is clear this is what this code was
intended to look like. It is unclear to me why this was not caught by the GNU
`printf` annotations on `agerr`.
This code had two alternative paths, one that used a heap-allocated array for
edge counts above 20 and one that used a stack-allocated array for edge counts
of 20 or less. The latter was an optimization to avoid heap allocation for
smaller graphs. Modern dynamic allocators are fast enough that this kind of
optimization is no longer relevant.
explicitly specify latin-1 encoding when dealing with PS files in tests
PostScript files are encoded in a character set called CCSID 1276.¹ This code
was working despite not specifying an encoding because the default encoding on
each platform coincidentally lines up with that used in their sample files. More
recent versions of Pylint warn that encoding should always be specified in
`open` calls, and attempting to use either ASCII or UTF-8 encoding fails. The
Linux sample files contain invalid ASCII bytes and the Windows sample files
contain invalid UTF-8 bytes. Using latin-1, which seems to be the closest
available encoding to CCSID 1276, works cross platform.
In future, this code should perhaps be adapted to do I/O in binary mode, thus
avoiding any encoding concerns.
CMake: propagate include flag for harfbuzz on Windows
Pango >=1.44.1 changed the way harfbuzz is included
xref: https://github.com/GNOME/pango/commit/a7b17aa2
This is not required on *nix because the PkgConfig CMake module
already takes care of this. For example, on Ubuntu it adds:
-I/usr/include/harbuzz to PangoCairo_CFLAGS
ci: standardize shell scripts on the same e,u,x,o options
All these scripts have the same expectation, of failing on anything unexpected.
So setting the same options the same way everywhere leads to more consistency
and predictability.
Windows Defender significantly degrades I/O and slows CI tasks to the point that
it is difficult to get a passing result on many of the Windows jobs. It is
unclear what value Windows Defender is adding in CI when the entire environment
is transient and malware has no obvious way of gaining persistence. So far, the
main effect of Windows Defender has been to spuriously block MinGW tools,
preventing CI running altogether.
tests: rewrite 'Popen;communicate' code to use 'check_output'
When this testing code was first written, it looks like it was overlooked that
`check_output` supports the `input` parameter from Python 3.4 onwards. With
this, the relevant code can be written more concisely.
tests: rename 'dot' variables in test_regression.py
An upcoming change will introduce a `dot` function, which these variables will
then shadow, causing warnings. This is a pre-emptive change to avoid this.
Stephen C North [Mon, 6 Dec 2021 13:37:08 +0000 (08:37 -0500)]
Fixes https://gitlab.com/graphviz/graphviz/-/issues/1855 where the SVG view setup needs more than two digits of precision, otherwise clipping may result.
When we are immediately going to the move a created tarball to a new location,
we may as well just save time and create it in the eventual location to begin
with.
The format this plugin produces, Adobe Shockwave, was officially EOLed by Adobe
in April 2019.¹ Legacy support for SWF files was available through Adobe Flash
Player. Flash Player was subsequently EOLed in December 2020 with Adobe
considering it such a security risk they flipped a kill switch in January 2021
making it no longer possible to run Flash Player anywhere.²
[nfc] remove legacy 'STACK_DIRECTION' lines in Windows config.h
This constant was introduced in the initial addition of the precreated Windows
config.h, 76ead5c74029a5ceea61dd6c7600dc1931c275cf, but it is unclear where it
originates from. None of the other build systems appear to define this and no
prior or current state of the Graphviz tree has ever contained use of this
macro. Graphviz does not use `alloca`.
fix: correct Windows release file recognition during deployment
6117abe680037824d134149b0de42f589fb24466 updated the deployment script to add
Windows artifacts that previously needed to be appended locally to the JSON
manifest. However it failed to account for changes made to the packaging
hierarchy that removed release collection and a redundant architecture
component.
The Cygwin CI tasks come very close to the CI timeout ceiling, usually running
for close to an hour. It is hoped that this change (and upcoming caching) will
reduce this time, thus shortening the total CI time as these are the longest
running tasks at present.
ci/build.sh: autotools: excplicitly specify the tclsh for MinGW
Fixes these errors when using autotools with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdtclft.o: in function `tclGdWriteCmd':
C:\Users\magja\graphviz\tclpkg\gdtclft/gdtclft.c:560: undefined reference to `Tcl_GetOpenFile'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdtclft.o: in function `tclGdCreateCmd':
C:\Users\magja\graphviz\tclpkg\gdtclft/gdtclft.c:450: undefined reference to `Tcl_GetOpenFile'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdtclft.o: in function `Gdtclft_Init':
C:\Users\magja\graphviz\tclpkg\gdtclft/gdtclft.c:1278: undefined reference to `Tcl_InitStubs'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdtclft.o:gdtclft.c:(.rdata$.refptr.tclStubsPtr[.refptr.tclStubsPtr]+0x0): undefined reference to `tclStubsPtr'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../../tclpkg/tclstubs/.libs/libtclstubs_C.a(tclStubLib.o): in function `tclstubs_dummy':
C:\Users\magja\graphviz\tclpkg\tclstubs/tclStubLib.c:17: undefined reference to `Tcl_InitStubs'
Without this change, the following error would occur in an upcoming
commit that changes the Windows specific storage-class attributes to
be controlled by GVDLL instead of by _WIN32:
LINK : fatal error LNK1181: cannot open input file 'gvplugin_neato_layout.lib' [C:\GitLab-Runner\builds\magjac\graphviz\cmd\tools\gvpack.vcxproj]
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058
Magnus Jacobsson [Sun, 28 Nov 2021 11:35:20 +0000 (12:35 +0100)]
common: correct storage-class attributes in memory.h
Fixes many errors like this using autotools with MinGW:
CCLD mm2gv.exe
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: matrix_market.o: in function `SparseMatrix_import_matrix_market':
C:\Users\magja\graphviz\cmd\tools/matrix_market.c:99: undefined reference to `__imp_gmalloc'