]> granicus.if.org Git - graphviz/log
graphviz
3 years agoadd MR test coverage visualization based on gcovr to CI
Magnus Jacobsson [Sun, 11 Apr 2021 22:10:19 +0000 (00:10 +0200)]
add MR test coverage visualization based on gcovr to CI

See
https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html

3 years agoenable lcov branch coverage
Magnus Jacobsson [Mon, 19 Apr 2021 15:35:07 +0000 (17:35 +0200)]
enable lcov branch coverage

3 years agouse absolute paths to lex & yacc files in lib/expr for CMake
Magnus Jacobsson [Sat, 17 Apr 2021 04:58:09 +0000 (06:58 +0200)]
use absolute paths to lex & yacc files in lib/expr for CMake

With relative paths, gcovr has trouble finding them.

3 years agouse absolute paths to lex & yacc files in cmd/tools for CMake
Magnus Jacobsson [Sat, 17 Apr 2021 04:58:09 +0000 (06:58 +0200)]
use absolute paths to lex & yacc files in cmd/tools for CMake

With relative paths, gcovr has trouble finding them.

3 years agouse absolute paths to lex & yacc files in lib/common for CMake
Magnus Jacobsson [Tue, 6 Apr 2021 19:55:02 +0000 (21:55 +0200)]
use absolute paths to lex & yacc files in lib/common for CMake

With relative paths, lcov has trouble finding them.

3 years agouse absolute paths to lex & yacc files in lib/cgraph for CMake
Magnus Jacobsson [Tue, 6 Apr 2021 19:55:02 +0000 (21:55 +0200)]
use absolute paths to lex & yacc files in lib/cgraph for CMake

With relative paths, lcov has trouble finding them.

3 years agoMerge branch 'smattr/691F2C8C-E52A-405A-BC63-563A870A32A2' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 16:06:17 +0000 (16:06 +0000)]
Merge branch 'smattr/691F2C8C-E52A-405A-BC63-563A870A32A2' into 'main'

remove GVPR Vim syntax

See merge request graphviz/graphviz!2043

3 years agoremove GVPR Vim syntax
Matthew Fernandez [Fri, 9 Jul 2021 00:03:25 +0000 (17:03 -0700)]
remove GVPR Vim syntax

This file was upstreamed into Vim itself in Vim commit
2346a6378483c9871016f9fc821ec5cbea638f13. The version in Vim can now be
considered authoritative and we can cease maintaining a copy here in Graphviz.
Related to #1762.

3 years agoMerge branch 'add-changelog-entry-for-c++-test-suite' into 'main'
Magnus Jacobsson [Sat, 10 Jul 2021 14:40:47 +0000 (14:40 +0000)]
Merge branch 'add-changelog-entry-for-c++-test-suite' into 'main'

Add a CHANGELOG entry for the new C++ test infrastructure

Closes #2002

See merge request graphviz/graphviz!2042

3 years agoadd a CHANGELOG entry for the new C++ test infrastructure
Magnus Jacobsson [Sun, 4 Jul 2021 07:35:11 +0000 (09:35 +0200)]
add a CHANGELOG entry for the new C++ test infrastructure

3 years agoMerge branch 'smattr/D7F767FB-3F78-438A-A920-F170636B7AC7' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 05:44:52 +0000 (05:44 +0000)]
Merge branch 'smattr/D7F767FB-3F78-438A-A920-F170636B7AC7' into 'main'

remove unnecessary casts around usage of cgraph functions

See merge request graphviz/graphviz!2032

3 years agoremove unnecessary casts of agbindrec return values
Matthew Fernandez [Sat, 3 Jul 2021 17:08:23 +0000 (10:08 -0700)]
remove unnecessary casts of agbindrec return values

The return type of agbindrec is void*, which implicitly coerces to all other
pointer types.

3 years agoremove unnecessary casts of parameters to agget
Matthew Fernandez [Sat, 3 Jul 2021 17:03:52 +0000 (10:03 -0700)]
remove unnecessary casts of parameters to agget

The first argument to agget is a void*, to which other pointers implicitly
coerce.

3 years agoremove unnecessary casts of parameters to agnameof
Matthew Fernandez [Sat, 3 Jul 2021 16:57:27 +0000 (09:57 -0700)]
remove unnecessary casts of parameters to agnameof

The argument to agnameof is a void*, to which other pointers implicitly coerce.

3 years agoremove unnecessary casts of parameters to agraphof
Matthew Fernandez [Sat, 3 Jul 2021 16:50:06 +0000 (09:50 -0700)]
remove unnecessary casts of parameters to agraphof

The argument to agraphof is a void*, to which other pointers implicitly coerce.

3 years agoremove unnecessary casts of parameters to agwrite
Matthew Fernandez [Sat, 3 Jul 2021 16:46:35 +0000 (09:46 -0700)]
remove unnecessary casts of parameters to agwrite

The second argument to agwrite is a void*, to which other pointers implicitly
coerce.

3 years agoMerge branch 'smattr/128a62cb-cb82-43ad-9429-2955339a66b6' into 'main'
Matthew Fernandez [Sat, 10 Jul 2021 01:00:56 +0000 (01:00 +0000)]
Merge branch 'smattr/128a62cb-cb82-43ad-9429-2955339a66b6' into 'main'

some sfio-based clean up

See merge request graphviz/graphviz!2040

3 years agoremove sfio versioning mechanism
Matthew Fernandez [Wed, 7 Jul 2021 01:49:03 +0000 (18:49 -0700)]
remove sfio versioning mechanism

The sfio library versioned its format structure, _sffmt_s. This allowed multiple
format structures of differing versions to exist in memory at once,¹ with sfio
able to distinguish between a structure created by itself vs a structure created
by a different version of sfio. In theory, this allows multiple versions of the
sfio library to be loaded at once.

In practice, Graphviz does not take advantage of any of this. In fact, it is not
possible to do this within Graphviz as SFIO_VERSION has not been bumped when
lib/sfio is changed. It still claims to be compatible with a version developed
in 2001.

This commit removes the versioning mechanism entirely, in order to both reduce
maintenance overhead as well as remove the runtime cost associated with managing
this data. The latter is trivial in terms of runtime, but it is also work that
has no purpose.

¹ This kind of design often also allows you to serialize a structure to disk or
  network to later be read back in by a potentially differing version of the
  library. In the case of sfio however, this use case was not possible because
  the structure contains function pointers.

3 years agoremove KPVDEL guards
Matthew Fernandez [Wed, 7 Jul 2021 01:37:22 +0000 (18:37 -0700)]
remove KPVDEL guards

I believe these were used by Kiem-Phong Vo to remind themselves to expose these
definitions unconditionally in future. However, it seems they were never
followed up on. We remove them now to ease ongoing maintenance.

3 years agoremove NoF-guarded code
Matthew Fernandez [Wed, 7 Jul 2021 01:35:08 +0000 (18:35 -0700)]
remove NoF-guarded code

Nothing in the build systems define this.

3 years agoremove unused SF_BUFCONST
Matthew Fernandez [Wed, 7 Jul 2021 01:33:20 +0000 (18:33 -0700)]
remove unused SF_BUFCONST

3 years agoremove sfio EOF etc definitions and use libc instead
Matthew Fernandez [Wed, 7 Jul 2021 01:32:00 +0000 (18:32 -0700)]
remove sfio EOF etc definitions and use libc instead

All of these are defined in ISO C.

3 years agoremove unused noop field of _sffmt_s
Matthew Fernandez [Wed, 7 Jul 2021 01:23:22 +0000 (18:23 -0700)]
remove unused noop field of _sffmt_s

3 years agoremove UNUSED-guarded sfio definitions
Matthew Fernandez [Wed, 7 Jul 2021 01:16:55 +0000 (18:16 -0700)]
remove UNUSED-guarded sfio definitions

Nothing in the build systems define UNUSED.

3 years agoMerge branch 'smattr/103BBEBC-73DC-4EB8-B323-AEAAAA43FD78' into 'main'
Matthew Fernandez [Fri, 9 Jul 2021 15:26:24 +0000 (15:26 +0000)]
Merge branch 'smattr/103BBEBC-73DC-4EB8-B323-AEAAAA43FD78' into 'main'

Python clean up

See merge request graphviz/graphviz!2031

3 years agoadd a gating errors-only Pylint check to CI
Matthew Fernandez [Sat, 3 Jul 2021 03:24:23 +0000 (20:24 -0700)]
add a gating errors-only Pylint check to CI

As of the previous commit, the Docker image on which Pylint checks are run in CI
has all Python module dependencies available, so import-error warnings are no
longer an issue. This change adds a build-failing more relaxed Pylint check to
the existing (non-build-failing) one, that only checks for conclusive errors. It
should no longer be possible to introduce broken Python code into Graphviz –
even when it is uncalled – without breaking CI.

3 years agobump Pylint requirement to 2.7.1
Matthew Fernandez [Fri, 9 Jul 2021 14:25:01 +0000 (07:25 -0700)]
bump Pylint requirement to 2.7.1

This avoids a Pylint bug¹ that prevents adding a --errors-only check that would
fail the build on failure.

¹ https://github.com/PyCQA/pylint/issues/3882

3 years agomove Pylint CI task to the latest Ubuntu image
Matthew Fernandez [Fri, 9 Jul 2021 04:51:49 +0000 (21:51 -0700)]
move Pylint CI task to the latest Ubuntu image

We should keep this task always on the latest Ubuntu in order to pick up the
most recent version of Pylint.

3 years agoalso install doc/infosrc Python dependencies in Ubuntu 21.04 Docker image
Matthew Fernandez [Sat, 3 Jul 2021 02:53:56 +0000 (19:53 -0700)]
also install doc/infosrc Python dependencies in Ubuntu 21.04 Docker image

This makes dependencies like jinja2 available for the Pylint CI task.

3 years agoremove MarkupSafe as a claimed dependency of doc/infosrc
Matthew Fernandez [Sat, 3 Jul 2021 03:08:58 +0000 (20:08 -0700)]
remove MarkupSafe as a claimed dependency of doc/infosrc

Nothing in Graphviz uses MarkupSafe. Its last use was removed in
38e3b019bb1b73f273beec66ee2d79e814a97251, but it was incorrectly left behind as
a dependency. I only discovered this by trying to use
doc/infosrc/requirements.txt and finding that MarkupSafe 1.0 is uninstallable.

3 years agoremove unnecessary parens on Python classes
Matthew Fernandez [Sat, 3 Jul 2021 02:42:14 +0000 (19:42 -0700)]
remove unnecessary parens on Python classes

New-style Python 3 classes do not need parens if they are not inheriting from
any other class.

3 years agodisable Pylint’s line-too-long warning for reference test list
Matthew Fernandez [Sat, 3 Jul 2021 02:39:14 +0000 (19:39 -0700)]
disable Pylint’s line-too-long warning for reference test list

IMHO this list is more readable as it is, unwrapped.

3 years agodisable Pylint’s missing-function-docstring warnings on main
Matthew Fernandez [Sat, 3 Jul 2021 02:38:42 +0000 (19:38 -0700)]
disable Pylint’s missing-function-docstring warnings on main

Documenting main does not really make sense.

3 years agoupdate file comments on some Python files so they are recognized by Pylint
Matthew Fernandez [Sat, 3 Jul 2021 02:37:59 +0000 (19:37 -0700)]
update file comments on some Python files so they are recognized by Pylint

Deals with some Pylint missing-module-docstrings.

3 years agoremove quirky use of bitwise AND in Python
Matthew Fernandez [Sat, 3 Jul 2021 02:18:13 +0000 (19:18 -0700)]
remove quirky use of bitwise AND in Python

3 years agoremove legacy use of addition to construct Python strings
Matthew Fernandez [Sat, 3 Jul 2021 02:17:54 +0000 (19:17 -0700)]
remove legacy use of addition to construct Python strings

3 years agofix a Python indentation issue
Matthew Fernandez [Sat, 3 Jul 2021 02:11:54 +0000 (19:11 -0700)]
fix a Python indentation issue

4 spaces is standard for Python, but we set 2 spaces in our .pylintrc.

3 years agodisable Pylint import-error warnings for gv
Matthew Fernandez [Sat, 3 Jul 2021 02:10:26 +0000 (19:10 -0700)]
disable Pylint import-error warnings for gv

This is the Graphviz module itself which is not necessarily expected to be built
and available when the test suite is run.

3 years agoremove use of Python 2 syntax in some demo files
Matthew Fernandez [Sat, 3 Jul 2021 02:03:38 +0000 (19:03 -0700)]
remove use of Python 2 syntax in some demo files

The last remnants of Python 2 support were removed in
61ae0419198465b457df875881a2dae0aadc8bfd. So it makes sense to update these
examples to be Python 3 only.

3 years agoMerge branch 'gentoo-patches' into 'main'
Matthew Fernandez [Thu, 8 Jul 2021 00:54:20 +0000 (00:54 +0000)]
Merge branch 'gentoo-patches' into 'main'

Upstream gentoo patches

See merge request graphviz/graphviz!2038

3 years agochangelog entries for the prior two commits
Matthew Fernandez [Thu, 8 Jul 2021 00:25:36 +0000 (17:25 -0700)]
changelog entries for the prior two commits

3 years agoRemove bashism
David Seifert [Tue, 6 Jul 2021 11:46:13 +0000 (13:46 +0200)]
Remove bashism

* `==` only works in bash, whereas a shell like
  dash is significantly faster for running the
  configure script.

3 years agoDo not install `command_line`
David Seifert [Tue, 6 Jul 2021 11:46:10 +0000 (13:46 +0200)]
Do not install `command_line`

* `command_line` is solely for testing and
  shouldn't be installed to the prefix.

3 years agoMerge branch 'smattr/1482fbac-25eb-4ccc-a9ae-3f15b5b5850c' into 'main'
Matthew Fernandez [Wed, 7 Jul 2021 15:17:07 +0000 (15:17 +0000)]
Merge branch 'smattr/1482fbac-25eb-4ccc-a9ae-3f15b5b5850c' into 'main'

more lib/sparse clean up

See merge request graphviz/graphviz!2028

3 years agoremove now unused dense_transpose
Matthew Fernandez [Thu, 1 Jul 2021 03:18:51 +0000 (20:18 -0700)]
remove now unused dense_transpose

3 years agoremove unused res_transposed argument to SparseMatrix_multiply_dense1
Matthew Fernandez [Thu, 1 Jul 2021 03:18:01 +0000 (20:18 -0700)]
remove unused res_transposed argument to SparseMatrix_multiply_dense1

3 years agoremove unused transposed argument to SparseMatrix_multiply_dense1
Matthew Fernandez [Thu, 1 Jul 2021 03:09:13 +0000 (20:09 -0700)]
remove unused transposed argument to SparseMatrix_multiply_dense1

3 years agoremove the ability to transpose the result of SparseMatrix_multiply_dense
Matthew Fernandez [Thu, 1 Jul 2021 03:06:47 +0000 (20:06 -0700)]
remove the ability to transpose the result of SparseMatrix_multiply_dense

Neither of the two callers was using this functionality.

3 years agoremove now unused SparseMatrix_multiply_dense2
Matthew Fernandez [Thu, 1 Jul 2021 03:01:51 +0000 (20:01 -0700)]
remove now unused SparseMatrix_multiply_dense2

3 years agoremove support for transposed matrix v in SparseMatrix_multiply_dense
Matthew Fernandez [Thu, 1 Jul 2021 02:17:52 +0000 (19:17 -0700)]
remove support for transposed matrix v in SparseMatrix_multiply_dense

The only use of this function is with not-transposed matrices.

3 years agoremove support for transposed matrix A in SparseMatrix_multiply_dense
Matthew Fernandez [Thu, 1 Jul 2021 02:15:37 +0000 (19:15 -0700)]
remove support for transposed matrix A in SparseMatrix_multiply_dense

The only use of this function is with not-transposed matrices.

3 years agoremove SUM_REPEATED_REAL_PART option
Matthew Fernandez [Thu, 1 Jul 2021 02:07:35 +0000 (19:07 -0700)]
remove SUM_REPEATED_REAL_PART option

This is a configuration option to
SparseMatrix_from_coordinate_arrays_not_compacted that is never used. The
leading comment that is also removed in this commit seems to have been a
mistake. If refers to incorrect constants, repeats variables, and contains
numerous typographical errors.

3 years agoremove SUM_REPEATED_IMAGINARY_PART option
Matthew Fernandez [Thu, 1 Jul 2021 02:04:49 +0000 (19:04 -0700)]
remove SUM_REPEATED_IMAGINARY_PART option

This is a configuration option to
SparseMatrix_from_coordinate_arrays_not_compacted that is never used.

3 years agoremove SUM_IMGINARY_KEEP_LAST_REAL option
Matthew Fernandez [Thu, 1 Jul 2021 02:00:40 +0000 (19:00 -0700)]
remove SUM_IMGINARY_KEEP_LAST_REAL option

This is a configuration option to
SparseMatrix_from_coordinate_arrays_not_compacted that is never used. Curiously
it also seems misspelled.

3 years agoremove configurability from SparseMatrix_from_coordinate_arrays_not_compacted
Matthew Fernandez [Thu, 1 Jul 2021 01:57:37 +0000 (18:57 -0700)]
remove configurability from SparseMatrix_from_coordinate_arrays_not_compacted

This function is only ever called with SUM_REPEATED_NONE.

3 years agoremove configurability from SparseMatrix_from_coordinate_format_not_compacted
Matthew Fernandez [Thu, 1 Jul 2021 01:55:55 +0000 (18:55 -0700)]
remove configurability from SparseMatrix_from_coordinate_format_not_compacted

This function is only ever called with SUM_REPEATED_NONE.

3 years agoMerge branch 'add-cpp-test-suite' into 'main'
Magnus Jacobsson [Wed, 7 Jul 2021 05:18:07 +0000 (05:18 +0000)]
Merge branch 'add-cpp-test-suite' into 'main'

Add a C++ test infrastructure

See merge request graphviz/graphviz!2035

3 years agochange the always pass test to a simple Graphviz test
Magnus Jacobsson [Mon, 5 Jul 2021 09:54:05 +0000 (11:54 +0200)]
change the always pass test to a simple Graphviz test

The test now uses the existing C API to render SVG from DOT source
code.

To support this, the commit also adds the necessary Graphviz libraries
and the dot_builtins to the common test library and the necessary
include directories to the macro creating the individual test
executables.

3 years agotemporarily disable ODR violation detection caused by lib/ortho
Magnus Jacobsson [Tue, 6 Jul 2021 06:12:24 +0000 (08:12 +0200)]
temporarily disable ODR violation detection caused by lib/ortho

The next commit in this series triggers this violation otherwise.

This will soon be restored when
https://gitlab.com/graphviz/graphviz/-/issues/2096 has been fixed in
an upcoming MR.

3 years agodon't disable leak detection for ctest based tests
Magnus Jacobsson [Mon, 5 Jul 2021 10:24:02 +0000 (12:24 +0200)]
don't disable leak detection for ctest based tests

The current test does not trigger any memory leaks and we want to
ensure that we don't introduce any new leaks and fix existing leaks as
new tests encounter them.

We still want leak detection disabled when running pytest since those
tests still trigger many memory leaks.

This is accomplished by moving the disabling of the leak detection
into the test template and performing it after ctest has been
executed, but before pytest executes.

This commit also makes the temporary disabling of ODR violation
bacause of lib/ortho to be selectively for ctest only.

3 years agoadd ctest to the Ubuntu 21.04 ASan test in CI
Magnus Jacobsson [Mon, 5 Jul 2021 10:11:57 +0000 (12:11 +0200)]
add ctest to the Ubuntu 21.04 ASan test in CI

This adds a new test template that is based on the default test
template, but replaces the script section in order to be able to set
up and execute ctest without affecting tests on older OSes.

3 years agoarchive all shared libraries in Ubuntu 21.04 build for ctest
Magnus Jacobsson [Mon, 5 Jul 2021 08:03:17 +0000 (10:03 +0200)]
archive all shared libraries in Ubuntu 21.04 build for ctest

The Ubuntu 21.04 build is renamed and modified to be able to run
ctest, which uses the build products directly from where they reside
before installing them.

Adds archiving of all shared libraries produced directly by "cmake
--build". In the test stage, the test executables load them from those
directory locations since LD_LIBRARY_PATH is automatically set up to
contain them.

3 years agoadd optional ctest & catch2 based test infrastructure
Magnus Jacobsson [Mon, 5 Jul 2021 09:44:15 +0000 (11:44 +0200)]
add optional ctest & catch2 based test infrastructure

This commit adds a CMakeLists.txt in the tests directory containing
the foundation for easily creating new test executables. It includes
creation of a shared library that the individual test executables can
be linked to, allowing them to be as small as possible.

The tests are optional and can be enabled with the CMake option
with_cxx_tests.

Also added is a first simple test case that always passes to show how
to create test cases.

3 years agoinstall catch2 in Ubuntu 21.04 Docker image
Magnus Jacobsson [Mon, 5 Jul 2021 07:21:56 +0000 (09:21 +0200)]
install catch2 in Ubuntu 21.04 Docker image

Catch2 is going to be used to create test cases in upcoming commits.

3 years agoMerge branch 'smattr/9ca68f13-5591-4f3c-a488-f3b15c827039' into 'main'
Matthew Fernandez [Tue, 6 Jul 2021 05:13:39 +0000 (05:13 +0000)]
Merge branch 'smattr/9ca68f13-5591-4f3c-a488-f3b15c827039' into 'main'

fix incorrect reference counting of HTML-like strings in gvpack

See merge request graphviz/graphviz!2026

3 years agofix incorrect reference counting of HTML-like strings in gvpack
Matthew Fernandez [Wed, 30 Jun 2021 03:11:13 +0000 (20:11 -0700)]
fix incorrect reference counting of HTML-like strings in gvpack

When duplicating graph attributes, gvpack was calling agstrdup_html to construct
an HTML-like string and then agattr/agset to assign this to an attribute. It did
not anticipate that *both* of these increment the reference count for the string
that has been interned in the graph’s dictionary. The result was a reference
count of 2 for a new HTML-like string, despite only 1 reference to the string
existing.

This was not directly visible to users (hence no changelog entry for this
commit) and the extra reference counts are disposed of when the graph itself is
destroyed. However, this persistent off-by-one issue internally confused some
debugging and potentially retained memory longer than was necessary. The issue
was visible with the following patch applied:

  diff --git cmd/tools/gvpack.c cmd/tools/gvpack.c
  index 16a4ffa5b..8e8fbf3b9 100644
  --- cmd/tools/gvpack.c
  +++ cmd/tools/gvpack.c
  @@ -352,9 +352,13 @@ static void cloneAttrs(void *old, void *new)

       for (a = agnxtattr(g, kind, 0); a; a =  agnxtattr(g, kind, a)) {
    s = agxget (old, a);
  - if (aghtmlstr(s))
  -     agset(new, a->name, agstrdup_html(ng, s));
  - else
  + if (aghtmlstr(s)) {
  +     printf("creating HTML string...\n");
  +     char *scopy = agstrdup_html(ng, s);
  +     agrefcntprint(scopy);
  +     agset(new, a->name, scopy);
  +     agrefcntprint(scopy);
  + } else
        agset(new, a->name, s);
       }
   }
  diff --git lib/cgraph/cgraph.h lib/cgraph/cgraph.h
  index a043fb26d..e2b065e16 100644
  --- lib/cgraph/cgraph.h
  +++ lib/cgraph/cgraph.h
  @@ -305,6 +305,7 @@ CGRAPH_API int agobjkind(void *);
   /* strings */
   CGRAPH_API char *agstrdup(Agraph_t *, char *);
   CGRAPH_API char *agstrdup_html(Agraph_t *, char *);
  +CGRAPH_API void *agrefcntprint(const char *);
   CGRAPH_API int aghtmlstr(char *);
   CGRAPH_API char *agstrbind(Agraph_t * g, char *);
   CGRAPH_API int agstrfree(Agraph_t *, char *);
  diff --git lib/cgraph/refstr.c lib/cgraph/refstr.c
  index b524649ff..d8d7ca468 100644
  --- lib/cgraph/refstr.c
  +++ lib/cgraph/refstr.c
  @@ -9,6 +9,7 @@
    *************************************************************************/

   #include <cgraph/cghdr.h>
  +#include <inttypes.h>
   #include <stddef.h>
   #include <stdio.h>

  @@ -139,6 +140,11 @@ char *agstrdup_html(Agraph_t * g, char *s)
       return r->s;
   }

  +void *agrefcntprint(const char *s) {
  +    refstr_t *key = (refstr_t *) (s - offsetof(refstr_t, store[0]));
  +    printf("reference count: %" PRIu64 "\n", (uint64_t)key->refcnt);
  +}
  +
   int agstrfree(Agraph_t * g, char *s)
   {
       refstr_t *r;

With these changes, attempting to gvpack a graph with an HTML-like string
attribute results in the following output:

  creating HTML string...
  reference count: 1
  reference count: 2

The present commit fixes this issue by replicating the correct pattern for doing
this kind of duplication from lib/gvpr/actions.c:copyAttr.

3 years agoMerge branch 'smattr/32e830af-ed59-441c-9dc6-9eaef9316b04' into 'main'
Matthew Fernandez [Tue, 6 Jul 2021 00:15:26 +0000 (00:15 +0000)]
Merge branch 'smattr/32e830af-ed59-441c-9dc6-9eaef9316b04' into 'main'

work towards solution for round tripping GV→GXL→GV

See merge request graphviz/graphviz!2016

3 years agoremove some unnecessary casts to agxbuf functions
Matthew Fernandez [Thu, 24 Jun 2021 03:07:57 +0000 (20:07 -0700)]
remove some unnecessary casts to agxbuf functions

These functions take const char pointers. There is no need to cast away the
const-ness of the original pointers.

3 years agogv2gxl: in GXL output, indicate when a label originated as an HTML like label
Matthew Fernandez [Thu, 24 Jun 2021 02:55:29 +0000 (19:55 -0700)]
gv2gxl: in GXL output, indicate when a label originated as an HTML like label

When translating Dot to GXL, labels come out as strings. Input something like:
`label="foo"` and the GXL output is something like
`<attr name="label"><string>foo</string></attr>`. This translation is fine and
works well, until you start using HTML like labels.

Graphviz allows `<` and `>` as delimiters to indicate your label string contains
HTML that should be parsed. When you try to use this feature in combination with
gv2gxl, you get a lossy translation. E.g. the labels `label="foo"` and
`label=<foo>` come out identically in GXL.

This commit makes use of the GXL ‘kind’ field on attributes to note that the
source was an HTML like label. If you translate the two labels from above, you
will now get:

  <attr name="label"><string>foo</string></attr>

and

  <attr name="label" kind="HTML-like string"><string>foo</string></attr>

respectively.

This is a partial fix for #517. This makes the translation to GXL no longer
lossy. The other half of this is recognizing the ‘kind’ field during gxl2gv
translation and preserving it on the way back.

3 years agoreflow some text
Matthew Fernandez [Thu, 24 Jun 2021 02:41:26 +0000 (19:41 -0700)]
reflow some text

3 years agoadd a test case for #517
Matthew Fernandez [Thu, 24 Jun 2021 02:04:27 +0000 (19:04 -0700)]
add a test case for #517

3 years agoMerge branch 'smattr/cbc230d2-1896-4082-84b8-df235572234c' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 23:06:31 +0000 (23:06 +0000)]
Merge branch 'smattr/cbc230d2-1896-4082-84b8-df235572234c' into 'main'

branch-tune allocation wrappers

See merge request graphviz/graphviz!2021

3 years agobranch-tune allocation wrappers
Matthew Fernandez [Sat, 26 Jun 2021 19:12:13 +0000 (12:12 -0700)]
branch-tune allocation wrappers

These functions are used extensively within Graphviz. This change tells the
compiler to optimize for the case when allocation succeeds. This may slow the
case when allocation fails, though we do not care about this case as Graphviz is
about to exit with failure in this scenario.

3 years agoMerge branch 'smattr/5d05e2d1-45cd-4422-b78c-122a62fff5c8' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 22:17:51 +0000 (22:17 +0000)]
Merge branch 'smattr/5d05e2d1-45cd-4422-b78c-122a62fff5c8' into 'main'

more gvmap-related clean up

See merge request graphviz/graphviz!2025

3 years agoremove GVIEWER-guarded code
Matthew Fernandez [Tue, 29 Jun 2021 03:57:23 +0000 (20:57 -0700)]
remove GVIEWER-guarded code

Nothing in the build system(s) define this. A lot of this also looks broken.
For example, the GVIEWER alternative of the stress_model function sets up an
argv whose first string entry is not terminated.

3 years agoremove commented out code in stress_model.c
Matthew Fernandez [Tue, 29 Jun 2021 03:59:21 +0000 (20:59 -0700)]
remove commented out code in stress_model.c

3 years agoremove useless flag parameter to remove_overlap
Matthew Fernandez [Tue, 29 Jun 2021 03:51:46 +0000 (20:51 -0700)]
remove useless flag parameter to remove_overlap

This function has no path in which it sets this output parameter to non-zero.

3 years agomark array parameters to get_local_12_norm as const
Matthew Fernandez [Tue, 29 Jun 2021 03:29:05 +0000 (20:29 -0700)]
mark array parameters to get_local_12_norm as const

This makes it clearer that this function does not modify these arrays.

3 years agoremove unused norm variable in improve_antibandwidth_by_swapping
Matthew Fernandez [Tue, 29 Jun 2021 03:23:06 +0000 (20:23 -0700)]
remove unused norm variable in improve_antibandwidth_by_swapping

3 years agoremove unused norm_1 output parameter to country_graph_coloring_internal
Matthew Fernandez [Tue, 29 Jun 2021 03:19:00 +0000 (20:19 -0700)]
remove unused norm_1 output parameter to country_graph_coloring_internal

3 years agoremove unused norm_1 output parameter to country_graph_coloring
Matthew Fernandez [Tue, 29 Jun 2021 03:15:26 +0000 (20:15 -0700)]
remove unused norm_1 output parameter to country_graph_coloring

3 years agoMerge branch 'smattr/B7DD3AE0-829A-49E5-9A94-5518A9FFA6D9' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 21:27:10 +0000 (21:27 +0000)]
Merge branch 'smattr/B7DD3AE0-829A-49E5-9A94-5518A9FFA6D9' into 'main'

remove unused gvfwrite

Closes #1846

See merge request graphviz/graphviz!2029

3 years agoremove unused gvfwrite
Matthew Fernandez [Thu, 1 Jul 2021 14:48:39 +0000 (07:48 -0700)]
remove unused gvfwrite

The last use of gvfwrite was removed in
6e818420cf02ad01d9c976b69d49fb794a661f5e. But more problematically, this
function seems incorrect. By ignoring its size argument it will generate
surprising results if ever called with a non-1 size. Closes #1846.

3 years agoMerge branch 'smattr/12de6328-7c30-45ad-9029-63f88edd6385' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 19:51:32 +0000 (19:51 +0000)]
Merge branch 'smattr/12de6328-7c30-45ad-9029-63f88edd6385' into 'main'

clean up in lib/sfio

See merge request graphviz/graphviz!2027

3 years agoMerge branch 'smattr/F16DEFA3-B7E0-4DC8-BDD5-C4D2C9D8242F' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 19:18:55 +0000 (19:18 +0000)]
Merge branch 'smattr/F16DEFA3-B7E0-4DC8-BDD5-C4D2C9D8242F' into 'main'

port deploy script from os.path to pathlib

See merge request graphviz/graphviz!2024

3 years agoremove _SFBINARY_H-conditional code
Matthew Fernandez [Thu, 1 Jul 2021 00:24:58 +0000 (17:24 -0700)]
remove _SFBINARY_H-conditional code

Nothing in the build defines this.

3 years agoremove unused SETCLOEXEC and FD_CLOEXEC
Matthew Fernandez [Thu, 1 Jul 2021 00:24:51 +0000 (17:24 -0700)]
remove unused SETCLOEXEC and FD_CLOEXEC

The last use of these was removed in f552c0dece1435773de62334dee3310d1728e22f.

3 years agoremove unused ESPIPE
Matthew Fernandez [Thu, 1 Jul 2021 00:24:49 +0000 (17:24 -0700)]
remove unused ESPIPE

ESPIPE has never been used in sfio.

3 years agoremove unused ENOMEM
Matthew Fernandez [Thu, 1 Jul 2021 00:24:46 +0000 (17:24 -0700)]
remove unused ENOMEM

The last use of this in sfio was removed in
bb04aad8c6e033b6fef9cecd424a4d02758d661a.

3 years agoremove cbrt configuration check
Matthew Fernandez [Thu, 1 Jul 2021 00:24:44 +0000 (17:24 -0700)]
remove cbrt configuration check

Graphviz is built with C99 which requires cbrt.

3 years agoremove unlink configuration check and Windows shim
Matthew Fernandez [Thu, 1 Jul 2021 00:24:41 +0000 (17:24 -0700)]
remove unlink configuration check and Windows shim

Nothing in Graphviz uses unlink.

3 years agoremove remove/unlink declarations in sfio
Matthew Fernandez [Thu, 1 Jul 2021 00:24:39 +0000 (17:24 -0700)]
remove remove/unlink declarations in sfio

The last use of these was removed in 751ab539a2531b5459ef709946ea0642ce2c44e8.

3 years agoremove fork/vfork detection
Matthew Fernandez [Thu, 1 Jul 2021 00:24:35 +0000 (17:24 -0700)]
remove fork/vfork detection

As of the previous commit, nothing uses these configuration variables.

3 years agoremove unused sfio fork/vfork declarations
Matthew Fernandez [Thu, 1 Jul 2021 00:24:33 +0000 (17:24 -0700)]
remove unused sfio fork/vfork declarations

The last usage of fork in this library was removed in
f552c0dece1435773de62334dee3310d1728e22f.

3 years agoremove unnecessary errno declaration
Matthew Fernandez [Thu, 1 Jul 2021 00:24:30 +0000 (17:24 -0700)]
remove unnecessary errno declaration

The errno variable/macro is part of ISO C.

3 years agoremove unused MAXSHORT
Matthew Fernandez [Thu, 1 Jul 2021 00:24:25 +0000 (17:24 -0700)]
remove unused MAXSHORT

3 years agoremove unused MAXLONG
Matthew Fernandez [Thu, 1 Jul 2021 00:24:21 +0000 (17:24 -0700)]
remove unused MAXLONG

3 years agosquash Pylint warning in deploy script smattr/F16DEFA3-B7E0-4DC8-BDD5-C4D2C9D8242F
Matthew Fernandez [Tue, 29 Jun 2021 02:41:49 +0000 (19:41 -0700)]
squash Pylint warning in deploy script

With this tweak, deploy.py is Pylint-warning-free. I do not think it makes sense
to write docstrings on a main function.

3 years agoport deploy script from os.path to pathlib
Matthew Fernandez [Tue, 29 Jun 2021 02:39:40 +0000 (19:39 -0700)]
port deploy script from os.path to pathlib

While this does not look like a win in terms of conciseness, I think the trade
off is worth it for stronger typing within this script. It is hard to test this
script without actually running a deployment, so we heavily rely on Pylint to
validate what it is doing. Giving Pylint some more hints as to what is going on
seems like a good idea.

3 years agoMerge branch 'smattr/77f377e7-e733-48ca-8003-6de107b48820' into 'main'
Matthew Fernandez [Mon, 5 Jul 2021 04:24:07 +0000 (04:24 +0000)]
Merge branch 'smattr/77f377e7-e733-48ca-8003-6de107b48820' into 'main'

test cases for #2089

See merge request graphviz/graphviz!2023