]> granicus.if.org Git - graphviz/log
graphviz
2 years agotools: remove unused argument in setGlobalEdgeAttr
Costa Shulyupin [Wed, 23 Feb 2022 04:12:51 +0000 (06:12 +0200)]
tools: remove unused argument in setGlobalEdgeAttr

fix warning:
cmd/tools/graphml2gv.c: In function ‘setGlobalEdgeAttr’:
cmd/tools/graphml2gv.c:348:71: warning: unused parameter ‘ud’ [-Wunused-parameter]
  348 | setGlobalEdgeAttr(Agraph_t * g, char *name, char *value, userdata_t * ud)
      |

2 years agotools: remove unused argument in setGlobalNodeAttr
Costa Shulyupin [Wed, 23 Feb 2022 04:11:41 +0000 (06:11 +0200)]
tools: remove unused argument in setGlobalNodeAttr

cmd/tools/graphml2gv.c: In function ‘setGlobalNodeAttr’:
cmd/tools/graphml2gv.c:298:71: warning: unused parameter ‘ud’ [-Wunused-parameter]
  298 | setGlobalNodeAttr(Agraph_t * g, char *name, char *value, userdata_t * ud)
      |                                                          ~~~~~~~~~~~~~^~

2 years agoMerge branch 'aglasterr' into 'main'
Matthew Fernandez [Wed, 23 Feb 2022 03:21:29 +0000 (03:21 +0000)]
Merge branch 'aglasterr' into 'main'

lib/cgraph: use return value of 'fread' in aglasterr

See merge request graphviz/graphviz!2468

2 years agolib/cgraph: use return value of 'fread' in aglasterr
Costa Shulyupin [Tue, 22 Feb 2022 18:58:05 +0000 (20:58 +0200)]
lib/cgraph: use return value of 'fread' in aglasterr

fix warning:
agerror.c: In function ‘aglasterr’:
agerror.c:49:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   49 |     fread(buf, sizeof(char), len, agerrout);

2 years agoMerge branch 'fix' into 'main'
Matthew Fernandez [Wed, 23 Feb 2022 02:18:20 +0000 (02:18 +0000)]
Merge branch 'fix' into 'main'

refactor circularLayout

See merge request graphviz/graphviz!2467

2 years agorefactor circularLayout
Costa Shulyupin [Mon, 21 Feb 2022 20:12:01 +0000 (22:12 +0200)]
refactor circularLayout

cut function cleanup, eliminate warning:
./lib/circogen/circular.c: In function ‘cleanup’:
./lib/circogen/circular.c|56 col 50| warning: unused parameter ‘sp’ [-Wunused-parameter]
||    56 | static void cleanup(block_t * root, circ_state * sp)
||       |                                     ~~~~~~~~~~~~~^~

2 years agoMerge branch 'smattr/46A5B7F0-9139-42B6-90B3-E35965040565' into 'main'
Matthew Fernandez [Tue, 22 Feb 2022 17:20:12 +0000 (17:20 +0000)]
Merge branch 'smattr/46A5B7F0-9139-42B6-90B3-E35965040565' into 'main'

lib/common: [nfc] remove 'nnames' micro-optimization and 'nToName'

See merge request graphviz/graphviz!2453

2 years agolib/common: [nfc] replace 'nToName' with 'itos'
Matthew Fernandez [Wed, 16 Feb 2022 21:39:49 +0000 (08:39 +1100)]
lib/common: [nfc] replace 'nToName' with 'itos'

This code was attempting to avoid dynamic string construction with low numbered
IDs. This is unnecessary when using a modern compiler that understands functions
like `snprintf` as built-ins and can achieve better optimization without this
trick.

Apart from de-duplicating code, this has the effect of making this code thread
safe where it was not before.

2 years agoMerge branch 'fix-C++-API-not-usable-after-install' into 'main'
Magnus Jacobsson [Tue, 22 Feb 2022 08:05:34 +0000 (08:05 +0000)]
Merge branch 'fix-C++-API-not-usable-after-install' into 'main'

fix C++ API not usable after install

Closes #2196

See merge request graphviz/graphviz!2464

2 years agoadd a CHANGELOG entry for the C++ API not usable after install fix
Magnus Jacobsson [Sun, 20 Feb 2022 14:03:03 +0000 (15:03 +0100)]
add a CHANGELOG entry for the C++ API not usable after install fix

2 years agogvc++: include "AGraph.h" instead of <AGraph.h> in GVLayout.h
Magnus Jacobsson [Sun, 20 Feb 2022 10:10:04 +0000 (11:10 +0100)]
gvc++: include "AGraph.h" instead of <AGraph.h> in GVLayout.h

This makes it possible to use GVLayout.h from the install directory
without the need to specify both "include" and "include/graphviz" as
include directories to the compiler.

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

2 years agogvc++: include "gvc.h" instead of <gvc.h> in GVContext.h
Magnus Jacobsson [Sun, 20 Feb 2022 10:08:52 +0000 (11:08 +0100)]
gvc++: include "gvc.h" instead of <gvc.h> in GVContext.h

This makes it possible to use GVContext.h from the install directory
without the need to specify both "include" and "include/graphviz" as
include directories to the compiler.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2196.

2 years agocgraph++: include "cgraph.h" instead of <cgraph.h> in AGraph.h
Magnus Jacobsson [Sun, 20 Feb 2022 10:03:43 +0000 (11:03 +0100)]
cgraph++: include "cgraph.h" instead of <cgraph.h> in AGraph.h

This makes it possible to use AGraph.h from the install directory
without the need to specify both "include" and "include/graphviz" as
include directories to the compiler.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2196.

2 years agogvc++: include AGraph.h without the cgraph++ directory prefix in GVLayout.h
Magnus Jacobsson [Sun, 20 Feb 2022 09:35:39 +0000 (10:35 +0100)]
gvc++: include AGraph.h without the cgraph++ directory prefix in GVLayout.h

This makes it possible to use GVLayout.h from the install directory
where AGraph.h is not located under this prefix.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2196.

2 years agogvc++: include gvc.h without the gvc directory prefix in GVContext.h
Magnus Jacobsson [Sun, 20 Feb 2022 09:34:33 +0000 (10:34 +0100)]
gvc++: include gvc.h without the gvc directory prefix in GVContext.h

This makes it possible to use GVContext.h from the install directory
where gvc.h is not located under this prefix.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2196.

2 years agocgraph++: include cgraph.h without the cgraph directory prefix in AGraph.h
Magnus Jacobsson [Sun, 20 Feb 2022 09:33:45 +0000 (10:33 +0100)]
cgraph++: include cgraph.h without the cgraph directory prefix in AGraph.h

This makes it possible to use AGraph.h from the install directory
where cgraph.h is not located under this prefix.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2196.

2 years agoMerge branch 'smattr/5E2D9BBC-3087-4FC2-8C95-929FC239F0CC' into 'main'
Matthew Fernandez [Mon, 21 Feb 2022 01:58:33 +0000 (01:58 +0000)]
Merge branch 'smattr/5E2D9BBC-3087-4FC2-8C95-929FC239F0CC' into 'main'

diffimg: handle allocation errors

See merge request graphviz/graphviz!2455

2 years agodiffimg: handle allocation errors
Matthew Fernandez [Sat, 19 Feb 2022 18:21:02 +0000 (10:21 -0800)]
diffimg: handle allocation errors

Previously these would be ignored resulting in crashes when allocations failed.

2 years agoMerge branch 'smattr/3ECB75F8-D9B2-4B09-9DD4-DCEF26761D98' into 'main'
Matthew Fernandez [Mon, 21 Feb 2022 00:40:45 +0000 (00:40 +0000)]
Merge branch 'smattr/3ECB75F8-D9B2-4B09-9DD4-DCEF26761D98' into 'main'

cgraph: [nfc] guard 'strcasecmp' definition to avoid duplication

See merge request graphviz/graphviz!2456

2 years agocgraph: [nfc] guard 'strcasecmp' definition to avoid duplication
Matthew Fernandez [Sat, 19 Feb 2022 17:59:06 +0000 (09:59 -0800)]
cgraph: [nfc] guard 'strcasecmp' definition to avoid duplication

When compiling with Microsoft Visual Studio 2019, the compiler emits:

  …\lib\cgraph\strcasecmp.h(12,64): warning C4211: nonstandard extension used:
    redefined extern to static

Investigation reveals libgd defines their own `strcasecmp` shim in gd.h:

  /* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set
     We define inline, and strcasecmp if they're missing
  */
  #ifdef _MSC_VER
  #  define _ALLOW_KEYWORD_MACROS
  #  ifndef inline
  #    define inline __inline
  #  endif
  #  ifndef strcasecmp
  #    define strcasecmp _stricmp
  #  endif
  #endif

To avoid this warning, guard Graphviz’ shim so it is only used when the libgd
shim is not in use.

Note that this also explains why MSVC is able to compile diffimg.c despite the
Graphviz shim file not being included.

2 years agoMerge branch 'smattr/dc60dea5-b999-463f-976a-13c2b7443e26' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 23:26:15 +0000 (23:26 +0000)]
Merge branch 'smattr/dc60dea5-b999-463f-976a-13c2b7443e26' into 'main'

[nfc] remove 'NOTUSED' and propagate its definition everywhere

Closes #2195

See merge request graphviz/graphviz!2457

2 years ago[nfc] remove 'NOTUSED' and propagate its definition everywhere
Matthew Fernandez [Sat, 19 Feb 2022 21:55:41 +0000 (13:55 -0800)]
[nfc] remove 'NOTUSED' and propagate its definition everywhere

Gitlab: closes #2195

2 years agoMerge branch 'smattr/B20B33D7-255E-4435-A2DD-403C0F96EC13' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 22:14:32 +0000 (22:14 +0000)]
Merge branch 'smattr/B20B33D7-255E-4435-A2DD-403C0F96EC13' into 'main'

MS Build: remove references to non-existent ReadMe.txt files

See merge request graphviz/graphviz!2459

2 years agoMS Build: remove references to non-existent ReadMe.txt files
Matthew Fernandez [Sat, 19 Feb 2022 22:30:05 +0000 (14:30 -0800)]
MS Build: remove references to non-existent ReadMe.txt files

2 years agoMerge branch 'smattr/9e779c9a-a15f-478d-b576-789a6bdba462' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 21:03:57 +0000 (21:03 +0000)]
Merge branch 'smattr/9e779c9a-a15f-478d-b576-789a6bdba462' into 'main'

fix 'gvpr' usage output

See merge request graphviz/graphviz!2460

2 years agofix 'gvpr' usage output
Matthew Fernandez [Sat, 19 Feb 2022 21:04:13 +0000 (13:04 -0800)]
fix 'gvpr' usage output

Commit 83eea6075b8f4746d632a792b1d1b97c19797acb altered the calling convention
of `errorv`, but failed to take into account that the local variable `s` was
being used for something else prior to its use as the first unpacked parameter.
Following this commit, the first parameter was being discarded as `s` was
overwritten with `error_info.id` or `id`.

This fix restores the previous behavior.

2 years agoadd a test case demonstrating a GVPR regression
Matthew Fernandez [Sat, 19 Feb 2022 20:41:08 +0000 (12:41 -0800)]
add a test case demonstrating a GVPR regression

2 years agoMerge branch 'smattr/45757D7F-6696-4553-985F-16E4C839E43D' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 19:45:04 +0000 (19:45 +0000)]
Merge branch 'smattr/45757D7F-6696-4553-985F-16E4C839E43D' into 'main'

tclpkg vgpanecmd: remove acceptance of ambiguous abbreviated commands

Closes #1961

See merge request graphviz/graphviz!2458

2 years agotclpkg vgpanecmd: remove acceptance of ambiguous abbreviated commands
Matthew Fernandez [Tue, 8 Feb 2022 10:51:32 +0000 (21:51 +1100)]
tclpkg vgpanecmd: remove acceptance of ambiguous abbreviated commands

`vgpanecmd` accepted abbreviations of commands, e.g. `li` for list. However
these abbreviations were accepted as first match with no disambiguation. So `r`
would always be interpreted as `rotate`, not `remove`. This behavior appears to
be an unintentional side effect of commands being incrementally introduced over
time without this kind of prefix-matching overlap being taken into account,
though this is mostly a guess as all this code was implemented prior to the
first Git commit.

Gitlab: fixes #1961

2 years agoMerge branch 'smattr/294959A0-076C-47FA-AF24-40225D33D7A0' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 03:14:16 +0000 (03:14 +0000)]
Merge branch 'smattr/294959A0-076C-47FA-AF24-40225D33D7A0' into 'main'

CI: remove '$OS_ID'

See merge request graphviz/graphviz!2454

2 years agoCI: [nfc] remove writing of OS_ID file
Matthew Fernandez [Sat, 19 Feb 2022 06:54:56 +0000 (22:54 -0800)]
CI: [nfc] remove writing of OS_ID file

As of the prior commit, nothing uses this.

2 years agoCI: [nfc] remove setting of '$OS_ID'
Matthew Fernandez [Sat, 19 Feb 2022 06:53:42 +0000 (22:53 -0800)]
CI: [nfc] remove setting of '$OS_ID'

As of the prior commit, nothing uses this variable.

2 years agoCI: remove the use of '$OS_ID' during testing
Matthew Fernandez [Sat, 19 Feb 2022 06:48:51 +0000 (22:48 -0800)]
CI: remove the use of '$OS_ID' during testing

This commit alters the CI tests to now pull OS information from /etc/os-release
instead of from an ad hoc environment variable. This makes test case execution
independent from which/whether environment variables have been exported. The
intent with this is to reduce the likelihood of an issue like that fixed in
50db0c5e8da293d816d8b5c4620f2fa2d311d37a being reintroduced.

2 years agoMerge branch 'smattr/4DE02E85-5B6C-45CD-BB3C-4C7183C5DD33' into 'main'
Matthew Fernandez [Sun, 20 Feb 2022 01:51:12 +0000 (01:51 +0000)]
Merge branch 'smattr/4DE02E85-5B6C-45CD-BB3C-4C7183C5DD33' into 'main'

neatogen: [nfc] remove 'DEVDBG' guarded code

See merge request graphviz/graphviz!2452

2 years agoneatogen: [nfc] remove 'DEVDBG' guarded code
Matthew Fernandez [Thu, 17 Feb 2022 04:11:40 +0000 (15:11 +1100)]
neatogen: [nfc] remove 'DEVDBG' guarded code

Nothing in the build systems define this, but it is also unclear how to use this
debugging support as the psdbg.c support functions seem to be something internal
that was never committed to the repository.

2 years agoMerge branch 'smattr/08C6E85C-C8A0-48CB-B812-98567782EBAC' into 'main'
Matthew Fernandez [Sat, 19 Feb 2022 07:08:21 +0000 (07:08 +0000)]
Merge branch 'smattr/08C6E85C-C8A0-48CB-B812-98567782EBAC' into 'main'

upgrade Pylint dependency

See merge request graphviz/graphviz!2442

2 years agoupgrade Pylint dependency
Matthew Fernandez [Sat, 12 Feb 2022 23:15:54 +0000 (10:15 +1100)]
upgrade Pylint dependency

2 years agoMerge branch 'smattr/4F517B52-B8A0-4A70-9E3E-AAB95452CC48' into 'main'
Matthew Fernandez [Sat, 19 Feb 2022 03:17:32 +0000 (03:17 +0000)]
Merge branch 'smattr/4F517B52-B8A0-4A70-9E3E-AAB95452CC48' into 'main'

fix: Run feasible_tree() even if maxiter is zero

Closes #1902

See merge request graphviz/graphviz!2448

2 years agoMove maxiter check after the feasible_tree() call.
Rob Hart [Tue, 8 Dec 2020 13:01:24 +0000 (05:01 -0800)]
Move maxiter check after the feasible_tree() call.

Edit from Matt: changelog entry and un-xfailed the test case.

Quoting the description of MR !1688 if it ever ends up lost to the sands of
time:

  If `nslimit1` is zero, then `rank2` is called with `maxiter=0`. It is likely
  the intent here is to at least compute and return an initial feasible solution
  (though not running any network simplex iterations).

Gitlab: fixes #1902

Co-authored-by: Matthew Fernandez <matthew.fernandez@gmail.com>
2 years agotests: [nfc] conform with double quotes for strings in #1902
Matthew Fernandez [Tue, 15 Feb 2022 20:36:47 +0000 (07:36 +1100)]
tests: [nfc] conform with double quotes for strings in #1902

2 years agotests: [nfc] use newer 'dot' helper in #1902
Matthew Fernandez [Tue, 15 Feb 2022 20:36:13 +0000 (07:36 +1100)]
tests: [nfc] use newer 'dot' helper in #1902

2 years agotests: [nfc] use more modern 'pathlib' in #1902
Matthew Fernandez [Tue, 15 Feb 2022 20:35:23 +0000 (07:35 +1100)]
tests: [nfc] use more modern 'pathlib' in #1902

2 years agoRegression test for issue 1902
Rob Hart [Tue, 8 Dec 2020 16:29:53 +0000 (08:29 -0800)]
Regression test for issue 1902

Edit from Matt: Added `xfail` marker as I have reordered the commits to put this
test case introduction before its fix, as well as aligning with current Pylint
requirements.

Gitlab: #1902

Co-authored-by: Matthew Fernandez <matthew.fernandez@gmail.com>
2 years agoMerge branch 'smattr/5DE18E14-8822-4DB4-96DF-550AEDEBC599' into 'main'
Matthew Fernandez [Sat, 19 Feb 2022 02:06:58 +0000 (02:06 +0000)]
Merge branch 'smattr/5DE18E14-8822-4DB4-96DF-550AEDEBC599' into 'main'

CI: some minor clean up of steps

See merge request graphviz/graphviz!2451

2 years agoCI: [nfc] abbreviate metrics file creation
Matthew Fernandez [Wed, 16 Feb 2022 19:48:40 +0000 (06:48 +1100)]
CI: [nfc] abbreviate metrics file creation

Slightly more efficient and concise.

2 years agoCI: remove log file deletion steps
Matthew Fernandez [Wed, 16 Feb 2022 19:44:41 +0000 (06:44 +1100)]
CI: remove log file deletion steps

The CI environments are transient and start fresh each time, so there is no need
to clean up temporary files.

2 years agoMerge branch 'smattr/C3D5797C-DD58-4F74-AD17-DE8C39AEFA1D' into 'main'
Matthew Fernandez [Wed, 16 Feb 2022 11:19:44 +0000 (11:19 +0000)]
Merge branch 'smattr/C3D5797C-DD58-4F74-AD17-DE8C39AEFA1D' into 'main'

neatogen: some simplification

See merge request graphviz/graphviz!2447

2 years agoneatogen: [nfc] brace a single-line if block
Matthew Fernandez [Wed, 16 Feb 2022 10:11:17 +0000 (21:11 +1100)]
neatogen: [nfc] brace a single-line if block

2 years agoneatogen: [nfc] remove some temporaries
Matthew Fernandez [Tue, 15 Feb 2022 08:35:30 +0000 (19:35 +1100)]
neatogen: [nfc] remove some temporaries

These seemed to be making the code less clear rather than more clear.

2 years agoneatogen max_absf: replace open coded max with a call to 'fmaxf'
Matthew Fernandez [Tue, 15 Feb 2022 08:32:10 +0000 (19:32 +1100)]
neatogen max_absf: replace open coded max with a call to 'fmaxf'

2 years agoneatogen max_abs: replace open coded max with a call to 'fmax'
Matthew Fernandez [Tue, 15 Feb 2022 08:31:45 +0000 (19:31 +1100)]
neatogen max_abs: replace open coded max with a call to 'fmax'

2 years agoneatogen: [nfc] remove a no-op cast
Matthew Fernandez [Tue, 15 Feb 2022 08:24:12 +0000 (19:24 +1100)]
neatogen: [nfc] remove a no-op cast

2 years agoneatogen: replace float-casted calls to 'fabs' with calls to 'fabsf'
Matthew Fernandez [Tue, 15 Feb 2022 08:22:55 +0000 (19:22 +1100)]
neatogen: replace float-casted calls to 'fabs' with calls to 'fabsf'

This is simpler, more efficient, and clearer to the compiler.

2 years agoneatogen: replace float-casted calls to 'sqrt' with calls to 'sqrtf'
Matthew Fernandez [Tue, 15 Feb 2022 08:18:31 +0000 (19:18 +1100)]
neatogen: replace float-casted calls to 'sqrt' with calls to 'sqrtf'

This is simpler, more efficient, and clearer to the compiler.

2 years agoRevert "work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt...
Matthew Fernandez [Tue, 15 Feb 2022 08:12:52 +0000 (19:12 +1100)]
Revert "work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)""

This reverts commit 0dfd6ab3449455907a5a684fb54cb8b54c5befd5.

As of fe3f9411d2c59b463ab1b64eecfd19f2db55d2fc, Graphviz requires a C99
compiler. C99 guarantees `sqrtf` so even if the “bug” discussed in the original
commit still exists, generating a `sqrtf` call is fine on a C99 toolchain.

2 years agoneatogen: [nfc] brace some single-line if blocks
Matthew Fernandez [Wed, 16 Feb 2022 10:07:47 +0000 (21:07 +1100)]
neatogen: [nfc] brace some single-line if blocks

2 years agoRevert "more sqrt"
Matthew Fernandez [Tue, 15 Feb 2022 08:08:30 +0000 (19:08 +1100)]
Revert "more sqrt"

This reverts commit ef77679d9fd51ac7a1a69e5a2635c2280856cd85. This commit was
working around a GCC bug. Quoting its predecessor
0dfd6ab3449455907a5a684fb54cb8b54c5befd5 that gives context:

  work around a bug in GCC: It generates a call to "sqrtf" for "(float)sqrt(d)"
  but sqrtf doesn't exist in libm.a.
  reported by: Aaron Digulla <digulla@hepe.com>

As of fe3f9411d2c59b463ab1b64eecfd19f2db55d2fc, Graphviz requires a C99
compiler. C99 guarantees `sqrtf` so even if this “bug” still exists, generating
a `sqrtf` call is fine on a C99 toolchain.

2 years agoneatogen: [nfc] reflow some code
Matthew Fernandez [Tue, 15 Feb 2022 08:04:42 +0000 (19:04 +1100)]
neatogen: [nfc] reflow some code

This appears to be two copies of the same copy-pasted code.

2 years agoneatogen: [nfc] rephrase some boolean accumulation
Matthew Fernandez [Tue, 15 Feb 2022 08:01:21 +0000 (19:01 +1100)]
neatogen: [nfc] rephrase some boolean accumulation

These operations can be written simpler using bitwise-or assignment.

2 years agoneatogen: [nfc] remove some unnecessary parens
Matthew Fernandez [Tue, 15 Feb 2022 07:46:12 +0000 (18:46 +1100)]
neatogen: [nfc] remove some unnecessary parens

2 years agoneatogen: [nfc] remove unused 'smooth_pivots'
Matthew Fernandez [Tue, 15 Feb 2022 07:35:57 +0000 (18:35 +1100)]
neatogen: [nfc] remove unused 'smooth_pivots'

The only code using this was removed in
0e60b06ea9daebe0ce6e46f7fe8aa9d090617209.

2 years agoMerge branch 'smattr/0F5C00D7-F0E5-4778-873C-20B1C96B5E03' into 'main'
Matthew Fernandez [Wed, 16 Feb 2022 00:28:10 +0000 (00:28 +0000)]
Merge branch 'smattr/0F5C00D7-F0E5-4778-873C-20B1C96B5E03' into 'main'

CMake: add a 'dot2gxl' symlink for 'gxl2gv', mimicking Autotools

See merge request graphviz/graphviz!2445

2 years agoCMake: add a 'dot2gxl' symlink for 'gxl2gv', mimicking Autotools
Matthew Fernandez [Mon, 14 Feb 2022 02:08:50 +0000 (13:08 +1100)]
CMake: add a 'dot2gxl' symlink for 'gxl2gv', mimicking Autotools

Gitlab: #1753, #1836

2 years agoCMake: [nfc] fix indentation in cmd/tools
Matthew Fernandez [Mon, 14 Feb 2022 04:43:11 +0000 (15:43 +1100)]
CMake: [nfc] fix indentation in cmd/tools

It is not clear to me why cmake-lint was not complaining about this. However, an
upcoming commit exposes that this indentation was not compliant.

2 years agoMerge branch 'smattr/C1FE7971-289E-489C-A464-4819A487BB51' into 'main'
Matthew Fernandez [Tue, 15 Feb 2022 21:48:07 +0000 (21:48 +0000)]
Merge branch 'smattr/C1FE7971-289E-489C-A464-4819A487BB51' into 'main'

CMake: detect and enable extra optional GD features with gdlib-config

See merge request graphviz/graphviz!2446

2 years agoCMake: detect and enable extra optional GD features with gdlib-config
Matthew Fernandez [Tue, 8 Feb 2022 03:53:58 +0000 (14:53 +1100)]
CMake: detect and enable extra optional GD features with gdlib-config

This replicates some logic from the Autotools build system, enabling output
formats like `png:gd`. Note that this only enables `png:gd` on CentOS because
other packaging ecosystems do not seem to include `gdlib-config`.

Gitlab: #1786

2 years agoCI: get more precise about when #1786 test case fails
Matthew Fernandez [Wed, 9 Feb 2022 12:11:36 +0000 (23:11 +1100)]
CI: get more precise about when #1786 test case fails

2 years agoCI: [nfc] abstract check for CMake build system
Matthew Fernandez [Wed, 9 Feb 2022 12:01:03 +0000 (23:01 +1100)]
CI: [nfc] abstract check for CMake build system

2 years agomove #1786 test case into CI-only tests
Matthew Fernandez [Wed, 9 Feb 2022 11:50:23 +0000 (22:50 +1100)]
move #1786 test case into CI-only tests

In retrospect, this test case does not make sense in the regular test suite. It
is validating a particular plugin feature is enabled. It is perfectly valid to
build a version of Graphviz without png:gd support, yet it will fail this test
case.

2 years agoMerge branch 'remove-unused' into 'main'
Matthew Fernandez [Tue, 15 Feb 2022 20:34:48 +0000 (20:34 +0000)]
Merge branch 'remove-unused' into 'main'

remove unused in lib/common

See merge request graphviz/graphviz!2443

2 years agoremove unused argument filled in cylinder_draw
Costa Shulyupin [Sun, 13 Feb 2022 09:54:54 +0000 (11:54 +0200)]
remove unused argument filled in cylinder_draw

2 years agoremove unused argument initwid in pathtolines
Costa Shulyupin [Sun, 13 Feb 2022 09:56:42 +0000 (11:56 +0200)]
remove unused argument initwid in pathtolines

2 years agoremove unused argument g in emit_end_graph
Costa Shulyupin [Sun, 13 Feb 2022 09:56:33 +0000 (11:56 +0200)]
remove unused argument g in emit_end_graph

2 years agoMerge branch 'smattr/DE7A1A76-9F51-4A03-BCDD-1ACC26BF6CAB' into 'main'
Matthew Fernandez [Tue, 15 Feb 2022 08:41:10 +0000 (08:41 +0000)]
Merge branch 'smattr/DE7A1A76-9F51-4A03-BCDD-1ACC26BF6CAB' into 'main'

remove MAXFLOAT

See merge request graphviz/graphviz!2441

2 years agoAPI BREAK: remove no longer used 'MAXFLOAT'
Matthew Fernandez [Sat, 12 Feb 2022 03:18:29 +0000 (14:18 +1100)]
API BREAK: remove no longer used 'MAXFLOAT'

2 years agoneatogen: use '-FLT_MAX' as a sentinel instead of '-MAXFLOAT'
Matthew Fernandez [Sat, 12 Feb 2022 03:15:55 +0000 (14:15 +1100)]
neatogen: use '-FLT_MAX' as a sentinel instead of '-MAXFLOAT'

This seems a more correct/appropriate way of achieving this in C99.

2 years agoneatogen: replace 'MAXFLOAT' in clamping logic with 'FLT_MAX'
Matthew Fernandez [Sat, 12 Feb 2022 03:13:49 +0000 (14:13 +1100)]
neatogen: replace 'MAXFLOAT' in clamping logic with 'FLT_MAX'

This seems a more accurate definition of what overflow would mean under C99.
Though as far as I can tell, it is not possible to reach this code with negative
values in the array, so the `< 0` check is always false. The `>= FLT_MAX` is
true for both `FLT_MAX` itself as well as positive infinity.

2 years agocommon: [nfc] remove commented out 'MAXFLOAT' usage
Matthew Fernandez [Sat, 12 Feb 2022 03:10:45 +0000 (14:10 +1100)]
common: [nfc] remove commented out 'MAXFLOAT' usage

2 years agoneatogen: [nfc] remove 'USE_MAXFLOAT' branch
Matthew Fernandez [Sat, 12 Feb 2022 03:09:55 +0000 (14:09 +1100)]
neatogen: [nfc] remove 'USE_MAXFLOAT' branch

This is never defined in the build.

2 years agoMerge branch 'smattr/EAA625F3-EE98-439D-B175-F947666A46F7' into 'main'
Matthew Fernandez [Tue, 15 Feb 2022 03:37:17 +0000 (03:37 +0000)]
Merge branch 'smattr/EAA625F3-EE98-439D-B175-F947666A46F7' into 'main'

fix incorrect clearing of bits in bitarray

See merge request graphviz/graphviz!2440

2 years agofix incorrect clearing of bits in bitarray
Matthew Fernandez [Fri, 11 Feb 2022 10:40:22 +0000 (21:40 +1100)]
fix incorrect clearing of bits in bitarray

The wrong bitwise operations were used here, resulting in e.g. a set of bit 2 of
of `0b011000` updating to `0b011100` instead of being a no-op.

This bug was present since the first introduction of this interface in
3ced90bd756bb8e56920620f2686e0ba6b482bbb, but this has not yet made it into a
release.

2 years agoadd unit tests for bitarray.h
Matthew Fernandez [Thu, 10 Feb 2022 08:45:34 +0000 (19:45 +1100)]
add unit tests for bitarray.h

This demonstrates a current bug in bit clearing.

2 years agoMerge branch 'smattr/3680D475-238E-4402-AFF9-1B68D2860757' into 'main'
Matthew Fernandez [Mon, 14 Feb 2022 21:18:53 +0000 (21:18 +0000)]
Merge branch 'smattr/3680D475-238E-4402-AFF9-1B68D2860757' into 'main'

CI: fix missing 'OS_ID' env var in ctest jobs

See merge request graphviz/graphviz!2436

2 years agoCI: fix missing 'OS_ID' env var in ctest jobs
Matthew Fernandez [Wed, 9 Feb 2022 05:55:00 +0000 (16:55 +1100)]
CI: fix missing 'OS_ID' env var in ctest jobs

Jobs inheriting from this template were attempting to set `$OS_ID` from the file
OS_ID that did not exist before `install-package.sh` was run. The result was
output in the build log like:

  export OS_ID=$( cat OS_ID )
  cat: OS_ID: No such file or directory

Somewhat surprisingly, tests were still passing. The reason is that `$OS_ID` is
only accessed in ci/tests.py and on Ubuntu (the platform used for both ctest
jobs) the only `$OS_ID`-based skip is for `mingle`, that is also coincidentally
skipped due to these jobs using the CMake build system where `mingle` is not
build. That is, the mingle check is meant to be skipped on lines 104-108, but
actually ends up skipped on lines 116-122 due to `$OS_ID` being empty.

In future, all of this should be refactored to use a less brittle technique for
asking “what distro are we running on?” When moving to Python 3.10,
`platform.freedesktop_os_release()` would be the obvious candidate.

2 years agoCI: shell escape echoed output during Windows build
Matthew Fernandez [Wed, 9 Feb 2022 05:53:46 +0000 (16:53 +1100)]
CI: shell escape echoed output during Windows build

Makes it slightly easier to copy and paste these commands if necessary.

2 years agoMerge branch 'smattr/705AB4C9-1D6E-40FF-B0A9-3668FE37D27D' into 'main'
Matthew Fernandez [Mon, 14 Feb 2022 13:09:13 +0000 (13:09 +0000)]
Merge branch 'smattr/705AB4C9-1D6E-40FF-B0A9-3668FE37D27D' into 'main'

CI: redirect stderr→stdout on Windows during build

See merge request graphviz/graphviz!2439

2 years agoCI: redirect stderr→stdout on Windows during build
Matthew Fernandez [Thu, 10 Feb 2022 11:37:45 +0000 (22:37 +1100)]
CI: redirect stderr→stdout on Windows during build

In CI, the Windows environments run ci/build_windows.py to orchestrate
compilation. This is run under PowerShell, which has the surprising behavior of
(1) hiding stderr and (2) considering any output to stderr a signal to abort the
running program. The combined effect of this is that benign CMake logging
statements like:

  message(WARNING "hello world")

abruptly terminate compilation with the baffling output:

  python : CMake Warning at cmake/FindGD.cmake:52 (message):
  At line:1 char:1
  + python ci/build_windows.py --build-system $env:build_system --platfor ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (CMake Warning a...e:52
        (message)::String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError

This behavior appears to be configurable, but it seems simpler to work around
this by avoiding any stderr output. The exit status of any build commands is
sufficient to signal failure.

Gitlab: #2097

2 years agoMerge branch 'smattr/BA5AA4C3-8A8A-42E9-A3C9-F0357D8D7FE9' into 'main'
Matthew Fernandez [Sun, 13 Feb 2022 20:16:34 +0000 (20:16 +0000)]
Merge branch 'smattr/BA5AA4C3-8A8A-42E9-A3C9-F0357D8D7FE9' into 'main'

upgrade Pytest dependency

See merge request graphviz/graphviz!2444

2 years agoupgrade Pytest dependency
Matthew Fernandez [Sat, 12 Feb 2022 23:31:17 +0000 (10:31 +1100)]
upgrade Pytest dependency

This upgrade brings with it a number of bug fixes for running with Python ≥ 3.8.

2 years agoMerge branch 'smattr/E8A2F5A2-2C7D-453C-8D7E-A309515C594E' into 'main'
Matthew Fernandez [Sat, 12 Feb 2022 21:10:08 +0000 (21:10 +0000)]
Merge branch 'smattr/E8A2F5A2-2C7D-453C-8D7E-A309515C594E' into 'main'

add a test case for #1786

Closes #1786

See merge request graphviz/graphviz!2435

2 years agoadd a test case for #1786
Matthew Fernandez [Tue, 8 Feb 2022 03:14:02 +0000 (14:14 +1100)]
add a test case for #1786

2 years agofix 'dot' test helper failing to encode string input
Matthew Fernandez [Tue, 8 Feb 2022 04:15:27 +0000 (15:15 +1100)]
fix 'dot' test helper failing to encode string input

When asking the `dot` helper function to process a graph from inline input to a
binary output format, the `universal_newlines=True` parameter would not be
passed to the underlying `subprocess.check_output` call, resulting in failure to
encode the input. That is, something like the following:

  dot("png:gd", source="digraph { a -> b; }")

would result in:

  self = <subprocess.Popen object at 0x7fbb862ae390>
      def _communicate(self, input, endtime, orig_timeout):
  …
  >           input_view = memoryview(self._input)
  E           TypeError: memoryview: a bytes-like object is required, not 'str'
  /usr/lib64/python3.6/subprocess.py:1519: TypeError

Note that this problem was latent, as no usage fitting the above scenario
currently exists. Something like this will be introduced in a future commit.

Gitlab: related to #1786

2 years agoMerge branch 'smattr/5DC1591E-4531-4D4F-AA8A-BD596A1D2C0B' into 'main'
Matthew Fernandez [Sat, 12 Feb 2022 19:58:25 +0000 (19:58 +0000)]
Merge branch 'smattr/5DC1591E-4531-4D4F-AA8A-BD596A1D2C0B' into 'main'

sfdpgen: some clean up

See merge request graphviz/graphviz!2437

2 years agosfdpgen: remove dead store of 'DistanceMatrix_restrict_matching' result
Matthew Fernandez [Thu, 10 Feb 2022 04:43:50 +0000 (15:43 +1100)]
sfdpgen: remove dead store of 'DistanceMatrix_restrict_matching' result

The returned value is immediately overwritten after being stored.

2 years agosfdpgen: [nfc] remove DistanceMatrix_restrict_cluster no-op
Matthew Fernandez [Thu, 10 Feb 2022 04:43:11 +0000 (15:43 +1100)]
sfdpgen: [nfc] remove DistanceMatrix_restrict_cluster no-op

2 years agosfdpgen: [nfc] remove duplicated comment
Matthew Fernandez [Thu, 10 Feb 2022 04:27:43 +0000 (15:27 +1100)]
sfdpgen: [nfc] remove duplicated comment

2 years agosfdpgen: [nfc] remove unnecessary casts
Matthew Fernandez [Thu, 10 Feb 2022 04:27:13 +0000 (15:27 +1100)]
sfdpgen: [nfc] remove unnecessary casts

2 years agoMerge branch 'smattr/14DF9C3A-34FA-4052-AAE4-D6D57F7D1D11' into 'main'
Matthew Fernandez [Wed, 9 Feb 2022 07:08:32 +0000 (07:08 +0000)]
Merge branch 'smattr/14DF9C3A-34FA-4052-AAE4-D6D57F7D1D11' into 'main'

enable 'dot_builtins' in RPM package

Closes #1839

See merge request graphviz/graphviz!2434

2 years agoenable 'dot_builtins' in RPM package
Matthew Fernandez [Mon, 7 Feb 2022 06:49:36 +0000 (17:49 +1100)]
enable 'dot_builtins' in RPM package

It is not clear why this was excluded. This partially reverts
e5f514b283fa5fe8690f7d82fe7555e8ce74e371.

Gitlab: closes #1839

2 years agoCI: on RHEL distros, install all RPMs
Matthew Fernandez [Mon, 7 Feb 2022 07:44:11 +0000 (18:44 +1100)]
CI: on RHEL distros, install all RPMs

Commit c334e4e81aad15d3092d7c25038a4d2cf1cbff05 altered this step to only
install RPMs necessary for the test suite at the time. However, an upcoming
commit that enables `dot_builtins` causes graphviz-nox-* to depend on
libgvplugin_webp.so.6 that was not being installed. For simplicity, the present
commit reverts c334e4e81aad15d3092d7c25038a4d2cf1cbff05.

Note that this more closely matches the only reasonable way to use the
CI-produced RPMs: install all of them.

Gitlab: related to #1839