]> granicus.if.org Git - graphviz/log
graphviz
4 years agoMerge branch 'fix-test-examples-exit-status-check' into 'master'
Magnus Jacobsson [Wed, 26 Aug 2020 14:53:06 +0000 (14:53 +0000)]
Merge branch 'fix-test-examples-exit-status-check' into 'master'

Fix test examples exit status check

See merge request graphviz/graphviz!1542

4 years agoMerge branch 'fix-1770-warning-path-too-long-using-cmake-windows-installer' into...
Magnus Jacobsson [Wed, 26 Aug 2020 14:52:16 +0000 (14:52 +0000)]
Merge branch 'fix-1770-warning-path-too-long-using-cmake-windows-installer' into 'master'

Fix path too long using Windows CMake build .exe-installer

Closes #1770

See merge request graphviz/graphviz!1541

4 years agoFix test examples exit status check
Magnus Jacobsson [Wed, 26 Aug 2020 12:58:11 +0000 (14:58 +0200)]
Fix test examples exit status check

4 years agoFix path too long using Windows CMake build .exe-installer
Magnus Jacobsson [Wed, 26 Aug 2020 04:48:11 +0000 (06:48 +0200)]
Fix path too long using Windows CMake build .exe-installer

Fixed by using updated preinstalled NSIS with string length 8192.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1770.

4 years agoMerge branch 'add-linux-cmake-builds' into 'master'
Magnus Jacobsson [Wed, 26 Aug 2020 05:25:53 +0000 (05:25 +0000)]
Merge branch 'add-linux-cmake-builds' into 'master'

Add ubuntu18-04-cmake-build

See merge request graphviz/graphviz!1539

4 years agoMerge branch 'use-updated-winflexbison' into 'master'
Magnus Jacobsson [Wed, 26 Aug 2020 04:56:41 +0000 (04:56 +0000)]
Merge branch 'use-updated-winflexbison' into 'master'

Use updated winflexbison version 2.5.22

See merge request graphviz/graphviz!1538

4 years agoAdd ubuntu18-04-cmake-build
Magnus Jacobsson [Thu, 2 Jul 2020 21:07:25 +0000 (23:07 +0200)]
Add ubuntu18-04-cmake-build

4 years agoAdapt MSBuild project files to renamed win_flex and win_bison
Magnus Jacobsson [Tue, 25 Aug 2020 18:25:33 +0000 (20:25 +0200)]
Adapt MSBuild project files to renamed win_flex and win_bison

4 years agoAdapt setup-build-utilities.ps1 to to renamed win_flex and win_bison
Magnus Jacobsson [Tue, 25 Aug 2020 18:50:15 +0000 (20:50 +0200)]
Adapt setup-build-utilities.ps1 to to renamed win_flex and win_bison

4 years agoUse updated preinstalled winflexbison version 2.5.22
Magnus Jacobsson [Tue, 25 Aug 2020 18:11:12 +0000 (20:11 +0200)]
Use updated preinstalled winflexbison version 2.5.22

Updates bison to version 3.5.0 and flex to version 2.6.4.

4 years agoMerge branch 'execute-test-examples' into 'master'
Magnus Jacobsson [Tue, 25 Aug 2020 16:36:56 +0000 (16:36 +0000)]
Merge branch 'execute-test-examples' into 'master'

Execute test examples

See merge request graphviz/graphviz!1532

4 years agoSkip execution of segfaulting neatopack.c in test examples
Magnus Jacobsson [Thu, 20 Aug 2020 14:14:27 +0000 (16:14 +0200)]
Skip execution of segfaulting neatopack.c in test examples

Fails because of https://gitlab.com/graphviz/graphviz/-/issues/1800

4 years agoAdd execution of compiled test examples
Magnus Jacobsson [Tue, 18 Aug 2020 19:49:10 +0000 (21:49 +0200)]
Add execution of compiled test examples

4 years agoUse dynamic linking on Windows in test_examples.py
Magnus Jacobsson [Tue, 18 Aug 2020 17:51:57 +0000 (19:51 +0200)]
Use dynamic linking on Windows in test_examples.py

4 years agoMerge branch 'add-windows-build-ps1-scripts-and-refactor-ci' into 'master'
Magnus Jacobsson [Tue, 25 Aug 2020 15:58:03 +0000 (15:58 +0000)]
Merge branch 'add-windows-build-ps1-scripts-and-refactor-ci' into 'master'

Add windows build PowerShell scripts and refactor CI

See merge request graphviz/graphviz!1529

4 years agoMerge branch '01a7249f-7db1-4539-81e5-eb2016375520' into 'master'
Matthew Fernandez [Tue, 25 Aug 2020 15:18:21 +0000 (15:18 +0000)]
Merge branch '01a7249f-7db1-4539-81e5-eb2016375520' into 'master'

use fabs() instead of ABS() for taking the absolute value of a double

See merge request graphviz/graphviz!1531

4 years agouse fabs() instead of ABS() for taking the absolute value of a double
Matthew Fernandez [Thu, 20 Aug 2020 00:03:10 +0000 (17:03 -0700)]
use fabs() instead of ABS() for taking the absolute value of a double

The fabs() function is available via math.h, even prior to C89 so there's no
reason not to use it. Avoiding the macro eliminates some mental overhead for the
reader. Also fabs has some more lenient semantics with respect to denormal
inputs, so this change results in slightly more efficient code.

4 years agoReplace Windows build code in CI config with new build script
Magnus Jacobsson [Mon, 17 Aug 2020 09:55:00 +0000 (11:55 +0200)]
Replace Windows build code in CI config with new build script

4 years agoAdd windows/bin/setup-and-build.ps1
Magnus Jacobsson [Sun, 16 Aug 2020 08:51:02 +0000 (10:51 +0200)]
Add windows/bin/setup-and-build.ps1

4 years agoAdd windows/bin/build.ps1
Magnus Jacobsson [Mon, 17 Aug 2020 14:22:11 +0000 (16:22 +0200)]
Add windows/bin/build.ps1

4 years agoAdd windows/bin/setup-build-utilities.ps1
Magnus Jacobsson [Sun, 16 Aug 2020 15:03:47 +0000 (17:03 +0200)]
Add windows/bin/setup-build-utilities.ps1

4 years agoUse updated preinstalled grep
Magnus Jacobsson [Mon, 17 Aug 2020 10:36:26 +0000 (12:36 +0200)]
Use updated preinstalled grep

4 years agoMerge branch 'f05c0222-3ab9-4bbc-9951-4e62fbf682f1' into 'master'
Magnus Jacobsson [Mon, 24 Aug 2020 05:12:27 +0000 (05:12 +0000)]
Merge branch 'f05c0222-3ab9-4bbc-9951-4e62fbf682f1' into 'master'

use a cleaner pattern for temporary directory management in tests

See merge request graphviz/graphviz!1537

4 years agoRefactor some code to be the same for cmake & msbuild
Magnus Jacobsson [Mon, 17 Aug 2020 17:40:55 +0000 (19:40 +0200)]
Refactor some code to be the same for cmake & msbuild

4 years agouse a cleaner pattern for temporary directory management in tests
Matthew Fernandez [Sun, 23 Aug 2020 20:42:19 +0000 (13:42 -0700)]
use a cleaner pattern for temporary directory management in tests

This switches a pattern of:

  tmp = tempfile.mkdtemp()
  atexist.register(shutil.rmtree, tmp)
  ...

to:

  with tempfile.TemporaryDirectory() as tmp:
    ...

Apart from being less error prone, this also unconditionally cleans up the
temporary directory, even when an uncaught exception is thrown.

4 years agoMerge branch 'fix-windows-artifacts-directory-platform-name' into 'master'
Magnus Jacobsson [Sun, 23 Aug 2020 18:41:59 +0000 (18:41 +0000)]
Merge branch 'fix-windows-artifacts-directory-platform-name' into 'master'

Fix windows artifacts directory platform name

Closes #1803

See merge request graphviz/graphviz!1536

4 years agoMerge branch '4f254459-24e2-4a5d-8064-05fe425fec0d' into 'master'
Matthew Fernandez [Sun, 23 Aug 2020 18:11:44 +0000 (18:11 +0000)]
Merge branch '4f254459-24e2-4a5d-8064-05fe425fec0d' into 'master'

fix macOS lexer compilation

See merge request graphviz/graphviz!1535

4 years agoFix platform name in Windows CI artifacts directory
Magnus Jacobsson [Sat, 22 Aug 2020 08:27:06 +0000 (10:27 +0200)]
Fix platform name in Windows CI artifacts directory

By renaming $Env:platform to $Env:project_platform. This avoids a
clash with the environment set up with vcvarsall.bat which changes
$Env:platform to the *architecture* which is 'x86' or 'x64' while we
use 'Win32' or 'x64' as the *project-level* platform.

From
https://docs.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2019:

"Note

The Win32 platform name is used for C++ projects, and it means
x86. Visual Studio considers both project-level platforms and
solution-level platforms, and the project platforms come from the
language-specific project systems. C++ projects use Win32 and x64, but
the solution platforms use x86 and x64. When you choose x86 as the
solution configuration, Visual Studio selects the Win32 platform for
C++ projects."

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1803.

4 years agoMake parsing of vcvarsall.bat output more robust
Magnus Jacobsson [Sun, 23 Aug 2020 08:25:50 +0000 (10:25 +0200)]
Make parsing of vcvarsall.bat output more robust

Only consider variable names with alpanumeric characters, underscore
and parentheses. This avoids most problems when parsing output
containing multi-line variable values with arbitrary text.

In GitLab CI, one of the environment variables is CI_COMMIT_MESSAGE. In the commit immediately following this commit there is an URL containing an equal sign that caused the error below:

Set-Content : An object at the specified path
env:\https://docs.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view does not
exist, or has been filtered by the -Include or -Exclude parameter.
At line:3 char:5
+     Set-Content "env:\$($matches[1])" $matches[2];
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (System.String[]:String[]) [Set-Content], Exception
    + FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.SetContentCommand

4 years agofix macOS lexer compilation
Matthew Fernandez [Sat, 22 Aug 2020 20:12:16 +0000 (13:12 -0700)]
fix macOS lexer compilation

Commits 3b00c1fc6b949cc9744d075e0d2b2ed4b1c46763 and
5162bfe8e72624ef7988b217e289476325365810 removed find-and-replace of an isatty
string, which exposed the following compilation error on macOS:

  [ 69%] Building C object lib/cgraph/CMakeFiles/cgraph.dir/grammar.c.o
  [ 70%] Building C object lib/cgraph/CMakeFiles/cgraph.dir/scan.c.o
  /Users/north/src/graphviz/build/lib/cgraph/scan.c:1706:12: error: expected
        identifier or '('
  extern int isatty (int );
             ^
  scan.l:44:19: note: expanded from macro 'isatty'
  #define isatty(x) 0
                    ^
  1 error generated.
  make[2]: *** [lib/cgraph/CMakeFiles/cgraph.dir/scan.c.o] Error 1
  make[1]: *** [lib/cgraph/CMakeFiles/cgraph.dir/all] Error 2
  make: *** [all] Error 2

which conveniently explained why this find-and-replace had existed in the first
place. Rather than reverting this, the present change uses a more principled way
of instructing Flex not to call isatty().

This reverts 40a5a33ac76e4d3d22662fd51e7c0e1d2be3100b. Related to #1796, !1522,
!1523.

4 years agoMerge branch '615aeb22-3c3f-43de-a7d4-e4d13756436f' into 'master'
Matthew Fernandez [Sat, 22 Aug 2020 16:18:11 +0000 (16:18 +0000)]
Merge branch '615aeb22-3c3f-43de-a7d4-e4d13756436f' into 'master'

suppress two compiler warnings

See merge request graphviz/graphviz!1528

4 years agosuppress two compiler warnings
Matthew Fernandez [Sun, 16 Aug 2020 17:14:19 +0000 (10:14 -0700)]
suppress two compiler warnings

Commits 02d2cacf8730f1e4347afd72b159c91fafed2182 and
80a9dc3a3d7a1bff49db3f8e40fc03e91ca2261e accidentally introduced two new
compiler warnings to the build. Following this change, the CMake build returns
to warning-free on Linux with GCC 8.3.0. The Autotools build still sprays
warnings, but I think it's worth taking proactive steps like this to never
introduce new warnings.

Though this change looks like it has a semantic effect, it does not. The base
member of these structs is the first member, used as an inheritance-style
pattern.

4 years agoMerge branch '74fde7bb-0d55-48c9-9685-97ba876159e9' into 'master'
Matthew Fernandez [Fri, 21 Aug 2020 14:34:53 +0000 (14:34 +0000)]
Merge branch '74fde7bb-0d55-48c9-9685-97ba876159e9' into 'master'

use a dynamic buffer in strdup_and_subst_obj0

See merge request graphviz/graphviz!1527

4 years agouse a dynamic buffer when expanding text replacements
Matthew Fernandez [Sat, 15 Aug 2020 21:13:34 +0000 (14:13 -0700)]
use a dynamic buffer when expanding text replacements

This change is intended to guard against bugs like that fixed in
fbefeb31989130c48b965cc9a2f0ad0cac07015c. The buffer used to construct the
result string now dynamically expands so we do not need to manually calculate
its extent in advance. Related to #1676.

4 years agofix: use of size_t in agxbuf.h with no definition
Matthew Fernandez [Sat, 15 Aug 2020 21:04:28 +0000 (14:04 -0700)]
fix: use of size_t in agxbuf.h with no definition

This worked so far because files #including this always included something else
that brought in stddef.h prior to #including agxbuf.h

4 years agoreplace agxbuse/alloc pattern with agxbdisown
Matthew Fernandez [Sat, 15 Aug 2020 20:30:48 +0000 (13:30 -0700)]
replace agxbuse/alloc pattern with agxbdisown

Instead of retrieving the contents of a (possibly dynamically allocated) buffer
and then allocating new space for a copy, we can simply take ownership of the
original buffer. This saves an extra unnecessary allocation.

4 years agoadd a new 'disown' API for agxbuf
Matthew Fernandez [Sat, 15 Aug 2020 20:06:43 +0000 (13:06 -0700)]
add a new 'disown' API for agxbuf

4 years agoMerge branch 'fix-test_1767-fails-on-agread-on-Windows' into 'master'
Magnus Jacobsson [Tue, 18 Aug 2020 10:09:17 +0000 (10:09 +0000)]
Merge branch 'fix-test_1767-fails-on-agread-on-Windows' into 'master'

Fix test 1767 fails on agread on windows

Closes #1794

See merge request graphviz/graphviz!1524

4 years agoEnable test_1767 on Windows for CMake builds
Magnus Jacobsson [Tue, 11 Aug 2020 15:46:46 +0000 (17:46 +0200)]
Enable test_1767 on Windows for CMake builds

The test is still skipped for MSBuild builds because of
https://gitlab.com/graphviz/graphviz/-/issues/1777

4 years agoUse dynamic run-time library in test_1767
Magnus Jacobsson [Thu, 13 Aug 2020 15:54:05 +0000 (17:54 +0200)]
Use dynamic run-time library in test_1767

From
https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2019:

/MD
Causes the application to use the multithread-specific and
DLL-specific version of the run-time library.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1794

4 years agoMerge branch 'remove-obsolete-and-incorrect-yacc-mangling' into 'master'
Magnus Jacobsson [Tue, 18 Aug 2020 09:43:24 +0000 (09:43 +0000)]
Merge branch 'remove-obsolete-and-incorrect-yacc-mangling' into 'master'

Remove obsolete and incorrect mangling of yacc output

Closes #1796

See merge request graphviz/graphviz!1523

4 years agoRemove obsolete autotools isatty mangling of yacc output
Magnus Jacobsson [Fri, 14 Aug 2020 08:45:14 +0000 (10:45 +0200)]
Remove obsolete autotools isatty mangling of yacc output

4 years agoRemove obsolete autotools unsigned long mangling of yacc output
Magnus Jacobsson [Fri, 14 Aug 2020 08:44:57 +0000 (10:44 +0200)]
Remove obsolete autotools unsigned long mangling of yacc output

4 years agoRemove obsolete CMake isatty mangling of yacc output
Magnus Jacobsson [Fri, 14 Aug 2020 07:32:01 +0000 (09:32 +0200)]
Remove obsolete CMake isatty mangling of yacc output

4 years agoRemove obsolete and incorrect CMake unsigned long mangling of yacc output
Magnus Jacobsson [Thu, 13 Aug 2020 11:11:06 +0000 (13:11 +0200)]
Remove obsolete and incorrect CMake unsigned long mangling of yacc output

It is (no longer?) necessary and it was anyway incorrect in that it
converted unsigned long to uint_64_t which doesn't exist.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1796

4 years agoMerge branch 'stop-windows-pipeline-on-powershell-cmdlet-failure' into 'master'
Magnus Jacobsson [Tue, 18 Aug 2020 08:56:11 +0000 (08:56 +0000)]
Merge branch 'stop-windows-pipeline-on-powershell-cmdlet-failure' into 'master'

Make the Windows pipeline stop on PowerShell cmdlet failure

See merge request graphviz/graphviz!1526

4 years agoMake the Windows pipeline stop on PowerShell cmdlet failure
Magnus Jacobsson [Fri, 14 Aug 2020 12:55:30 +0000 (14:55 +0200)]
Make the Windows pipeline stop on PowerShell cmdlet failure

Note that this doesn't affect failures from .exe programs (but that is
already handled by the GitLab Shared Windows Runner). See
https://stackoverflow.com/questions/9948517/how-to-stop-a-powershell-script-on-the-first-error.

4 years agoMerge branch 'f9559306-4b8b-48e8-88af-675f1b3b2bd5' into 'master'
Matthew Fernandez [Sat, 15 Aug 2020 17:38:24 +0000 (17:38 +0000)]
Merge branch 'f9559306-4b8b-48e8-88af-675f1b3b2bd5' into 'master'

fix a couple of out-of-bounds reads and writes

Closes #1676

See merge request graphviz/graphviz!1509

4 years agofix incorrect allocation computation in strdup_and_subst_obj0
Matthew Fernandez [Sun, 9 Aug 2020 23:48:30 +0000 (16:48 -0700)]
fix incorrect allocation computation in strdup_and_subst_obj0

The logic in this function does two passes through computing the construction of
a string, the first to determine how many bytes will be written and the second
to write those bytes. Unfortunately the logic in these two passes did not match,
and some cases would cause the first pass to underestimate how many bytes would
be written by the second pass. As a result, the second pass would overrun the
extent of allocated memory and begin writing out of bounds.

As far as I can tell, this bug has existed since at least 2010. I think this
code should be refactored in future to use a dynamically expanding string buffer
(e.g. agxbuf) instead of relying on this fragile pairing of logic.

The test case added in this commit was something found by Google Autofuzz
project that triggered a crash in Graphviz due to reading a NULL pointer. After
fixing the initial crash (the previous commit), this out of bounds write was
observable using ASan. This commit fixes #1676.

4 years agofix: avoid accessing min/max rep on a NULL cluster
Matthew Fernandez [Sun, 9 Aug 2020 23:50:14 +0000 (16:50 -0700)]
fix: avoid accessing min/max rep on a NULL cluster

When entering compile_samerank, the parent cluster could be NULL, which was then
incorrectly dereferenced in the two cases affected in this change. This issue
was found by Google Autofuzz project. Related to #1676.

4 years agoMerge branch 'a279c545-8647-42be-9f46-d9eb8d4f872d' into 'master'
Matthew Fernandez [Sat, 15 Aug 2020 16:49:55 +0000 (16:49 +0000)]
Merge branch 'a279c545-8647-42be-9f46-d9eb8d4f872d' into 'master'

fix segfault when passing a malformed newrank and node

Closes #1724

See merge request graphviz/graphviz!1508

4 years agofix: avoid looking for max/min representative on an invalid edge end
Matthew Fernandez [Sun, 9 Aug 2020 19:51:50 +0000 (12:51 -0700)]
fix: avoid looking for max/min representative on an invalid edge end

This avoids a segfault resulting from using a NULL pointer. Fixes #1724.

4 years agoavoid use of a temporary buffer when constructing an error message
Matthew Fernandez [Sun, 9 Aug 2020 18:57:31 +0000 (11:57 -0700)]
avoid use of a temporary buffer when constructing an error message

agerr() supports printf-style arguments, so it was not necessary to manually
build the error string in a temporary buffer.

4 years agoMerge branch 'fix-windows-artifact-archiving' into 'master'
Magnus Jacobsson [Sat, 15 Aug 2020 05:13:42 +0000 (05:13 +0000)]
Merge branch 'fix-windows-artifact-archiving' into 'master'

Fix windows artifact archiving

Closes #1797

See merge request graphviz/graphviz!1525

4 years agoFix publishing of Windows build artifcats
Magnus Jacobsson [Fri, 14 Aug 2020 10:04:08 +0000 (12:04 +0200)]
Fix publishing of Windows build artifcats

The COLLECTION was missing since we no longer get it from the
portable_source stage because the Windows builds start directly and do
not wait for the portable_source stage. Therefor we generate it in the
Windows builds directly instead.

This regresion was introduced in
https://gitlab.com/magjac/graphviz/-/commit/3ac7e1c54fe5f8f4bb304796ab77901c73401aee.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1797

4 years agoChange autogen.sh to get collection from gen_version.py
Magnus Jacobsson [Fri, 14 Aug 2020 10:01:59 +0000 (12:01 +0200)]
Change autogen.sh to get collection from gen_version.py

4 years agoAdd --collection option
Magnus Jacobsson [Fri, 14 Aug 2020 09:58:18 +0000 (11:58 +0200)]
Add --collection option

4 years agoChange to all-numeric version entry format and add collection
Magnus Jacobsson [Fri, 14 Aug 2020 09:53:22 +0000 (11:53 +0200)]
Change to all-numeric version entry format and add collection

The version is now specified with a new collection variable which
shall be "stable" or "development" and an all-numeric version. The
"~dev" (and the .<commiter date>) suffix will be added by the script.

4 years agoAdd /usr/bin/env python3 shebang to gen_version.py
Magnus Jacobsson [Fri, 14 Aug 2020 09:52:35 +0000 (11:52 +0200)]
Add /usr/bin/env python3 shebang to gen_version.py

4 years agoMerge branch '299df24c-1ec4-4b41-b594-66450f5ae4e8' into 'master'
Matthew Fernandez [Fri, 14 Aug 2020 15:04:55 +0000 (15:04 +0000)]
Merge branch '299df24c-1ec4-4b41-b594-66450f5ae4e8' into 'master'

misc cleanup

See merge request graphviz/graphviz!1504

4 years agoremove register hints
Matthew Fernandez [Sun, 9 Aug 2020 04:33:51 +0000 (21:33 -0700)]
remove register hints

These do little to nothing on modern compilers.

4 years agoremove some compiler warnings from ~-ing bits field
Matthew Fernandez [Sun, 9 Aug 2020 03:32:50 +0000 (20:32 -0700)]
remove some compiler warnings from ~-ing bits field

Suppresses 15 compilers warnings.

4 years agoremove yet another -Wconversion warning
Matthew Fernandez [Sun, 9 Aug 2020 03:17:09 +0000 (20:17 -0700)]
remove yet another -Wconversion warning

4 years agoremove another -Wconversion flags warning
Matthew Fernandez [Sun, 9 Aug 2020 03:16:56 +0000 (20:16 -0700)]
remove another -Wconversion flags warning

4 years agoremove a -Wconversion warning
Matthew Fernandez [Sun, 9 Aug 2020 03:16:32 +0000 (20:16 -0700)]
remove a -Wconversion warning

4 years agosuppress -Wconversion warnings from int promotion due to ~ of flags
Matthew Fernandez [Sun, 9 Aug 2020 02:39:48 +0000 (19:39 -0700)]
suppress -Wconversion warnings from int promotion due to ~ of flags

Squashes 11 warnings.

4 years agoavoid mixing int and short unsigned wrt flags
Matthew Fernandez [Sun, 9 Aug 2020 02:38:07 +0000 (19:38 -0700)]
avoid mixing int and short unsigned wrt flags

4 years agoavoid storing pointer diff in an int
Matthew Fernandez [Sun, 9 Aug 2020 01:48:41 +0000 (18:48 -0700)]
avoid storing pointer diff in an int

The distance between endb and next was being stored in an int variable. While
this should not exceed the bounds of an int during normal usage, it's risky to
store a pointer difference in a narrower type this way.

4 years agouniversally treat SFIO mode flags as unsigned
Matthew Fernandez [Sun, 9 Aug 2020 00:44:22 +0000 (17:44 -0700)]
universally treat SFIO mode flags as unsigned

This squashes 119 -Wsign-conversion compiler warnings.

4 years agoMerge branch 'start-windows-builds-directly' into 'master'
Magnus Jacobsson [Thu, 13 Aug 2020 15:56:55 +0000 (15:56 +0000)]
Merge branch 'start-windows-builds-directly' into 'master'

Start windows builds directly

See merge request graphviz/graphviz!1519

4 years agoMerge branch '1f838978-873d-47d6-a09e-6a8d76e62e4d' into 'master'
Matthew Fernandez [Thu, 13 Aug 2020 14:59:35 +0000 (14:59 +0000)]
Merge branch '1f838978-873d-47d6-a09e-6a8d76e62e4d' into 'master'

fix mismatch in gverrorf signature and callers

See merge request graphviz/graphviz!1503

4 years agoenable GCC and Clang to diagnose misuse of error() and errorf()
Matthew Fernandez [Sat, 8 Aug 2020 01:02:05 +0000 (18:02 -0700)]
enable GCC and Clang to diagnose misuse of error() and errorf()

This is the equivalent of 0a982672e53868cb394743a03b4e7b68951c282b for these
lib/ast functions.

4 years agoadd an explicit format string parameter to error() and errorf()
Matthew Fernandez [Sat, 8 Aug 2020 00:55:45 +0000 (17:55 -0700)]
add an explicit format string parameter to error() and errorf()

4 years agoremove now-unnecessary cast
Matthew Fernandez [Sat, 8 Aug 2020 00:31:23 +0000 (17:31 -0700)]
remove now-unnecessary cast

The function and the pointer it is being stored into now align in their
signature.

4 years agofix: pass format parameter into gverrorf explicitly
Matthew Fernandez [Sat, 8 Aug 2020 00:20:50 +0000 (17:20 -0700)]
fix: pass format parameter into gverrorf explicitly

The gverrorf function was prototyped in a way that did not align with a function
pointer it was stored into. On platforms with more forgiving varargs calling
conventions, everything worked out OK. However, on other platforms calling
gverrorf through this function pointer would result in stack corruption. This
change aligns gverrorf with the type of the function pointer in which it is
stored.

4 years agochange errorv calling convention to explicitly take a format string
Matthew Fernandez [Sat, 8 Aug 2020 00:04:04 +0000 (17:04 -0700)]
change errorv calling convention to explicitly take a format string

This function implicitly assumed its variable arguments contained a format
string as the first argument. This change pushes the assumption into the calling
convention, making it visible to the compiler.

4 years agoMerge branch 'f25b153d-dfca-415f-80f5-4135e26a9fde' into 'master'
Matthew Fernandez [Thu, 13 Aug 2020 02:30:58 +0000 (02:30 +0000)]
Merge branch 'f25b153d-dfca-415f-80f5-4135e26a9fde' into 'master'

make lib/ast/*.c #includes unambiguous

See merge request graphviz/graphviz!1501

4 years agoremove useless spin lock in lib/ast
Matthew Fernandez [Fri, 7 Aug 2020 03:08:26 +0000 (20:08 -0700)]
remove useless spin lock in lib/ast

This spin lock incorrectly implied to the reader that this code was thread safe.
IMHO there are two primary issues with this spin lock and one secondary issue:

  1. The intention of the spin lock is clearly to provide mutual exclusion
     within fmtbuf(). However this function returns a pointer to a static
     (thread-global) buffer. Excluding two threads from being in this function
     concurrently does not help if both exit the function with pointers into the
     same memory.

  2. The spin lock uses no atomics or volatile. As a result, accesses to the
     lock can be freely rearranged or coalesced, with no regard to thread
     interleaving. This can result in one thread never seeing another thread's
     update (unlock) to the lock. Even worse, my local compiler simply
     recognizes what is happening and omits the lock operations entirely.

  3. (secondary) If this lock worked as intended, it would spin writing to the
     lock variable. This would cause fairly pessimistic cache line bouncing as
     all waiting processors try to keep the line containing the lock in
     exclusive state in their local cache. A more performant way to achieve
     this is to spin waiting to see the lock value change *without* modifying
     the lock yourself. This allows multiple waiting processors to have the line
     in shared state, and minimizes cache coherence traffic.

4 years agomake lib/ast/*.c #includes unambiguous
Matthew Fernandez [Fri, 7 Aug 2020 02:30:41 +0000 (19:30 -0700)]
make lib/ast/*.c #includes unambiguous

Unfortunately we cannot also convert the headers because they are #included by
other libraries. We will do this in a future commit. Related to #1785.

4 years agoremove commented out #includes in lib/ast
Matthew Fernandez [Fri, 7 Aug 2020 02:29:36 +0000 (19:29 -0700)]
remove commented out #includes in lib/ast

4 years agoMerge branch 'remove-rtest-workaround-for-non-stable-cluster-order' into 'master'
Magnus Jacobsson [Wed, 12 Aug 2020 15:04:13 +0000 (15:04 +0000)]
Merge branch 'remove-rtest-workaround-for-non-stable-cluster-order' into 'master'

Remove rtest workaround for non stable cluster order

See merge request graphviz/graphviz!1518

4 years agoSpecify that the Windows CI builds dosn't need any previous job
Magnus Jacobsson [Sun, 9 Aug 2020 12:14:58 +0000 (14:14 +0200)]
Specify that the Windows CI builds dosn't need any previous job

4 years agoChanged to generate VERSION in Windows builds
Magnus Jacobsson [Wed, 12 Aug 2020 14:55:07 +0000 (16:55 +0200)]
Changed to generate VERSION in Windows builds

Instead of getting it from the portable_source stage. This allows the
Windows builds to start directly and not wait for the portable_source
stage.

4 years agoUpdate cluster releated nshare files with rtest.py -g
Magnus Jacobsson [Wed, 12 Aug 2020 07:01:10 +0000 (09:01 +0200)]
Update cluster releated nshare files with rtest.py -g

Using Windows MSBuild Graphviz development version
2.44.2~dev.20200812.0541 (20200812.0541).

Since https://gitlab.com/graphviz/graphviz/-/issues/1789 was fixed,
the output is stable.

4 years agoRemove rtest workaround for non stable cluster order
Magnus Jacobsson [Tue, 11 Aug 2020 15:55:48 +0000 (17:55 +0200)]
Remove rtest workaround for non stable cluster order

https://gitlab.com/graphviz/graphviz/-/issues/1789 and
https://gitlab.com/graphviz/graphviz/-/issues/1767

4 years agoMerge branch 'remove-workaround-for-msbuild-executables-have-wrong-version' into...
Magnus Jacobsson [Wed, 12 Aug 2020 06:51:25 +0000 (06:51 +0000)]
Merge branch 'remove-workaround-for-msbuild-executables-have-wrong-version' into 'master'

Remove test workaround for previously wrong version in MSBuild builds

See merge request graphviz/graphviz!1517

4 years agoRemove workaround for previously wrong version in MSBuild builds
Magnus Jacobsson [Tue, 11 Aug 2020 15:37:41 +0000 (17:37 +0200)]
Remove workaround for previously wrong version in MSBuild builds

https://gitlab.com/graphviz/graphviz/-/issues/1745

4 years agoMerge branch 'remove-config6-at-uninstall' into 'master'
Magnus Jacobsson [Wed, 12 Aug 2020 05:41:00 +0000 (05:41 +0000)]
Merge branch 'remove-config6-at-uninstall' into 'master'

Remove config6 when uninstalling Windows CMake Graphviz

Closes #1752

See merge request graphviz/graphviz!1516

4 years agoMerge branch 'B47EF71C-B166-4F10-96FD-B06894B84010' into 'master'
Matthew Fernandez [Wed, 12 Aug 2020 02:40:30 +0000 (02:40 +0000)]
Merge branch 'B47EF71C-B166-4F10-96FD-B06894B84010' into 'master'

remove legacy Travis CI config

See merge request graphviz/graphviz!1497

4 years agoremove legacy Travis CI config
Matthew Fernandez [Thu, 6 Aug 2020 00:20:29 +0000 (17:20 -0700)]
remove legacy Travis CI config

CI testing now happens on Gitlab.

4 years agoRemove config6 when uninstalling Windows CMake Graphviz
Magnus Jacobsson [Tue, 11 Aug 2020 15:23:58 +0000 (17:23 +0200)]
Remove config6 when uninstalling Windows CMake Graphviz

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1752

4 years agoMerge branch 'fix-missing-version-in-windows-ci-artifacts' into 'master'
Magnus Jacobsson [Tue, 11 Aug 2020 17:49:25 +0000 (17:49 +0000)]
Merge branch 'fix-missing-version-in-windows-ci-artifacts' into 'master'

Correct filename of Windows exe installer and zip archive

Closes #1792

See merge request graphviz/graphviz!1514

4 years agoMerge branch 'remove-version-from-windows-cmake-install-path' into 'master'
Magnus Jacobsson [Tue, 11 Aug 2020 17:48:55 +0000 (17:48 +0000)]
Merge branch 'remove-version-from-windows-cmake-install-path' into 'master'

Set CPack installation directory to "Graphviz"

Closes #1748

See merge request graphviz/graphviz!1515

4 years agoMerge branch 'fix-cmake-exe-installer-package-version' into 'master'
Magnus Jacobsson [Tue, 11 Aug 2020 17:48:05 +0000 (17:48 +0000)]
Merge branch 'fix-cmake-exe-installer-package-version' into 'master'

Correct package version in CMake exe installer

Closes #1791

See merge request graphviz/graphviz!1513

4 years agoSet CPack installation directory to "Graphviz"
Magnus Jacobsson [Tue, 11 Aug 2020 12:03:16 +0000 (14:03 +0200)]
Set CPack installation directory to "Graphviz"

The default was to include the version in the installation path.

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1748

4 years agoCorrect filename of Windows exe installer and zip archive
Magnus Jacobsson [Tue, 11 Aug 2020 07:47:20 +0000 (09:47 +0200)]
Correct filename of Windows exe installer and zip archive

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1792

4 years agoCorrect package version in CMake exe installer
Magnus Jacobsson [Tue, 11 Aug 2020 07:36:59 +0000 (09:36 +0200)]
Correct package version in CMake exe installer

Fixes https://gitlab.com/graphviz/graphviz/-/issues/1791

4 years agofix edge attribute order confusion
Matthew Fernandez [Wed, 5 Aug 2020 00:47:15 +0000 (17:47 -0700)]
fix edge attribute order confusion

Certain edge attributes are constructed in advance of their being seen in the
input because Graphviz knows it may need default values for them. Later, if seen
in the input, the values of these attributes are updated.

This all works fine unless the order in which these initially-defaulted edge
attributes appear in the input does not match the order in which the default
versions are constructed by Graphviz internally. In this case, the order in
which the attributes are seen in the input is used to construct a dictionary of
them, but the original copies are used to index into attribute values.

In the particular test case added in this commit,

  digraph {
    { rank=same; n1; n2 }

    n2 -> n1 [ headport=s, arrowhead=normal ]
  }

arrowhead was constructed with symbol ID 0 and headport was constructed with
symbol ID 1. But then the later parsing of these attributes resulted in a
dictionary where the headport value was in ID 0 and the arrowhead value was in
ID 1. Indexing into this dictionary with the initially constructed E_arrowhead
resulted in incorrectly returning the value "s". This caused a spurious error
'Arrow type "s" unknown' as well as incorrect graph output.

Fixes #1444. Note that this may just be one of several issues resulting from
using these initially constructed E_* symbols.

4 years agoMerge branch 'use-preinstalled-grep-in-ci' into 'master'
Magnus Jacobsson [Mon, 10 Aug 2020 07:42:20 +0000 (07:42 +0000)]
Merge branch 'use-preinstalled-grep-in-ci' into 'master'

Use preinstalled grep instead of installing it in CI

See merge request graphviz/graphviz!1512

4 years agoUse preinstalled grep instead of installing it in CI
Magnus Jacobsson [Sun, 9 Aug 2020 20:28:13 +0000 (22:28 +0200)]
Use preinstalled grep instead of installing it in CI

Final step that fixes
https://gitlab.com/graphviz/graphviz/-/issues/1759.