]> granicus.if.org Git - graphviz/log
graphviz
3 years agoxml_isentity: use ctype.h functions for readability
Matthew Fernandez [Sat, 2 Oct 2021 00:16:56 +0000 (17:16 -0700)]
xml_isentity: use ctype.h functions for readability

This has no functional impact, but just makes the code simpler to read and less
error prone.

3 years agoMerge branch 'smattr/949303BC-D384-42CF-A449-3969EA5F0175' into 'main'
Matthew Fernandez [Fri, 8 Oct 2021 04:53:33 +0000 (04:53 +0000)]
Merge branch 'smattr/949303BC-D384-42CF-A449-3969EA5F0175' into 'main'

upgrade Pylint and remove 'whitelist' terminology

See merge request graphviz/graphviz!2201

3 years agoswitch to inclusive terminology 'allow-list' instead of 'whitelist' in Pylint
Matthew Fernandez [Wed, 6 Oct 2021 00:31:00 +0000 (17:31 -0700)]
switch to inclusive terminology 'allow-list' instead of 'whitelist' in Pylint

Pylint commit 12beaa0d3fa050b68dff092520966c63d2f0e437 added this alternative
spelling for this option, in line with the aim of using more inclusive
terminology. This made it into Pylint 2.7.3. As of the prior commit, Graphviz is
upgraded to Pylint 2.7.3 and can use this new spelling.

3 years agoupgrade Pylint 2.7.1 → 2.7.3
Matthew Fernandez [Wed, 6 Oct 2021 00:22:04 +0000 (17:22 -0700)]
upgrade Pylint 2.7.1 → 2.7.3

Commit a9c626e7f6a81f0949b1e4134e17c8968f13256b cherry-picked some upcoming
Pylint changes related to inclusive terminology. This and the remainder of the
changes relevant to Graphviz (the `extension-pkg-allow-list` option) made their
way into Pylint 2.7.3. By upgrading to 2.7.3 “whitelist” terminology can be
removed from Graphviz’ Pylint configuration.

Note that a9c626e7f6a81f0949b1e4134e17c8968f13256b incorrectly quotes Pylint
commit hashes from PR3961¹ that never made their way into the main Pylint branch
as-is but were rebased. The corresponding commit hashes are:

  * 850c442dbda8d332049971d5c38f82b86da44f1d became
    d19c7733717ae9ad0a527233c2950473dce3ffcf
  * 12a76469782fab5c23d78039c4bfb37e3331945a became
    12beaa0d3fa050b68dff092520966c63d2f0e437

¹ https://github.com/PyCQA/pylint/pull/3961

3 years agoMerge branch 'smattr/383BFACC-1BDD-4992-84FB-12ECD80D55FF' into 'main'
Matthew Fernandez [Fri, 8 Oct 2021 01:14:40 +0000 (01:14 +0000)]
Merge branch 'smattr/383BFACC-1BDD-4992-84FB-12ECD80D55FF' into 'main'

remove explicit support for PHP5 SWIG bindings in the Autotools build system

See merge request graphviz/graphviz!2200

3 years agoremove explicit support for PHP5 SWIG bindings in the Autotools build system
Matthew Fernandez [Mon, 4 Oct 2021 23:47:24 +0000 (16:47 -0700)]
remove explicit support for PHP5 SWIG bindings in the Autotools build system

Older versions of SWIG can generate bindings for a variety of PHP versions.
Periodically SWIG bumps the version of PHP targeted by the default flag,
`-php`:¹

  SWIG version       `-php` effect   PHP5 support?   PHP7 support?
  ================================================================
  <1.3.26            `-php4`         no              no
  ≥1.3.26, <1.3.37   `-php4`         yes             no
  ≥1.3.37, <3.0.11   `-php5`         yes             no
  ≥3.0.11, <4.0.0    `-php5`         yes             yes
  ≥4.0.0             `-php7`         yes             yes

This commit changes the behavior under the Autotools build system:

  SWIG version       old behavior     new behavior
  ================================================
  <1.3.26            target PHP4  ==  target PHP4
  ≥1.3.26, <1.3.37   target PHP5  →   target PHP4
  ≥1.3.37, <3.0.11   target PHP5  ==  target PHP5
  ≥3.0.11, <4.0.0    target PHP7  ==  target PHP7
  ≥4.0.0             target PHP7  ==  target PHP7

It seems reasonable to consider the first three rows of the above table
irrelevant. The last version of PHP5, 5.6, was EOLed on 2018-12-31,² so any
users in rows 1-3 of the table have been unsupported for some time. In practice,
only users in row 2 are affected by this change, who are using a version of SWIG
released prior to 2009-01-12.³

In future, it may make sense to drop build system support for the `-php` flag
altogether and *only* support `-php7`, given that using `-php` on an older
version of SWIG that defaults to PHP5 probably produces uncompilable code
anyway.

¹ http://www.swig.org/Doc4.0/Php.html
² https://www.php.net/eol.php
³ https://github.com/swig/swig/releases

3 years agoMerge branch 'smattr/F4CD811A-5132-47F8-A5D3-2208237B457B' into 'main'
Matthew Fernandez [Thu, 7 Oct 2021 16:51:44 +0000 (16:51 +0000)]
Merge branch 'smattr/F4CD811A-5132-47F8-A5D3-2208237B457B' into 'main'

more smyrna dead code removal

See merge request graphviz/graphviz!2199

3 years agosmyrna: remove 'btnToolMove_clicked' no-op
Matthew Fernandez [Sat, 2 Oct 2021 15:40:21 +0000 (08:40 -0700)]
smyrna: remove 'btnToolMove_clicked' no-op

3 years agosmyrna: remove 'btnToolCursor_clicked' no-op
Matthew Fernandez [Sat, 2 Oct 2021 15:39:39 +0000 (08:39 -0700)]
smyrna: remove 'btnToolCursor_clicked' no-op

3 years agosmyrna: remove unused 'btnToolFindEdge_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:38:09 +0000 (08:38 -0700)]
smyrna: remove unused 'btnToolFindEdge_clicked'

3 years agosmyrna: remove unused 'btnToolDeleteEdge_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:37:35 +0000 (08:37 -0700)]
smyrna: remove unused 'btnToolDeleteEdge_clicked'

3 years agosmyrna: remove unused 'btnToolAddEdge_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:36:57 +0000 (08:36 -0700)]
smyrna: remove unused 'btnToolAddEdge_clicked'

3 years agosmyrna: remove unused 'btnToolFindNode_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:36:26 +0000 (08:36 -0700)]
smyrna: remove unused 'btnToolFindNode_clicked'

3 years agosmyrna: remove unused 'btnToolDeleteNode_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:35:54 +0000 (08:35 -0700)]
smyrna: remove unused 'btnToolDeleteNode_clicked'

3 years agosmyrna: remove unused 'btnToolAddNode_clicked'
Matthew Fernandez [Sat, 2 Oct 2021 15:35:17 +0000 (08:35 -0700)]
smyrna: remove unused 'btnToolAddNode_clicked'

3 years agosmyrna: remove prototypes for unimplemented toolbox functions
Matthew Fernandez [Sat, 2 Oct 2021 15:32:55 +0000 (08:32 -0700)]
smyrna: remove prototypes for unimplemented toolbox functions

The implementations of these were all removed in
02e266e74b1cf217c9bc8555e9fd4608c2d3e91a.

3 years agosmyrna: remove commented out code in smyrnadefs.h
Matthew Fernandez [Sat, 2 Oct 2021 15:19:25 +0000 (08:19 -0700)]
smyrna: remove commented out code in smyrnadefs.h

3 years agosmyrna: remove unused 'guibuffer'
Matthew Fernandez [Sat, 2 Oct 2021 15:14:37 +0000 (08:14 -0700)]
smyrna: remove unused 'guibuffer'

The last use of this was removed in b7687bc4b8964f5257e61a248270960572435532.

3 years agoMerge branch 'smattr/1B7E88AD-ABB7-4CC6-B676-7A7D653FB628' into 'main'
Matthew Fernandez [Wed, 6 Oct 2021 14:40:35 +0000 (14:40 +0000)]
Merge branch 'smattr/1B7E88AD-ABB7-4CC6-B676-7A7D653FB628' into 'main'

fix: upgrade Pytest 6.2.2 → 6.2.4

See merge request graphviz/graphviz!2202

3 years agofix: upgrade Pytest 6.2.2 → 6.2.4
Matthew Fernandez [Wed, 6 Oct 2021 02:47:17 +0000 (19:47 -0700)]
fix: upgrade Pytest 6.2.2 → 6.2.4

Python 3.10 was released on 2021-10-04 with what appears to be a breaking
change.¹ Graphviz’ Windows CI tasks (intentionally) install an unpinned
version of Python 3, so they get whatever the latest Python 3 version available
on Chocolatey is. Python 3.10 became available in Chocolatey on 2021-10-05 and
Windows CI tasks immediately started failing. The root cause is that 3.10
exposes a latent bug in Pytest.² This bug is reportedly fixed in Pytest 6.2.4,
so upgrading should repair Windows CI.

¹ https://bugs.python.org/issue43798
² https://github.com/pytest-dev/pytest/issues/8539

3 years agoRevert "plugin/core: autotools: make awk crlf agnostic when generating ps.h"
Emden R. Gansner [Tue, 5 Oct 2021 21:01:02 +0000 (17:01 -0400)]
Revert "plugin/core: autotools: make awk crlf agnostic when generating ps.h"

This reverts commit 50e7d9768b9c02287a0d68e64233c7f713d1f4b8.

In standard awk, only the first character in RS is used, so regular expressions don't work. This means the resulting ps.h in plugins/core contains an illegal C string constant.

3 years agoMerge branch 'smattr/420913E5-02E6-430D-A210-0DD8BC3F7315' into 'main'
Matthew Fernandez [Sat, 2 Oct 2021 03:57:30 +0000 (03:57 +0000)]
Merge branch 'smattr/420913E5-02E6-430D-A210-0DD8BC3F7315' into 'main'

more smyrna dead code removal

See merge request graphviz/graphviz!2196

3 years agosmyrna: remove unused 'frmObjectBtnCancel_clicked'
Matthew Fernandez [Thu, 30 Sep 2021 02:57:35 +0000 (19:57 -0700)]
smyrna: remove unused 'frmObjectBtnCancel_clicked'

3 years agosmyrna: remove unused 'on_dlgOpenGraph_btncancel_clicked'
Matthew Fernandez [Thu, 30 Sep 2021 02:56:56 +0000 (19:56 -0700)]
smyrna: remove unused 'on_dlgOpenGraph_btncancel_clicked'

3 years agosmyrna: remove unused 'frmObjectBtnOK_clicked'
Matthew Fernandez [Thu, 30 Sep 2021 02:56:23 +0000 (19:56 -0700)]
smyrna: remove unused 'frmObjectBtnOK_clicked'

3 years agosmyrna: remove unused 'on_dlgOpenGraph_btnOK_clicked'
Matthew Fernandez [Thu, 30 Sep 2021 02:55:50 +0000 (19:55 -0700)]
smyrna: remove unused 'on_dlgOpenGraph_btnOK_clicked'

3 years agosmyrna: remove unused 'attr_widgets_modifiedSlot'
Matthew Fernandez [Thu, 30 Sep 2021 02:54:47 +0000 (19:54 -0700)]
smyrna: remove unused 'attr_widgets_modifiedSlot'

3 years agosmyrna: remove 'attr_widgets_modified' that is never read
Matthew Fernandez [Thu, 30 Sep 2021 02:53:36 +0000 (19:53 -0700)]
smyrna: remove 'attr_widgets_modified' that is never read

3 years agosmyrna: remove unused gui.c globals
Matthew Fernandez [Thu, 30 Sep 2021 02:52:24 +0000 (19:52 -0700)]
smyrna: remove unused gui.c globals

3 years agosmyrna: remove unused 'Color_Widget'
Matthew Fernandez [Thu, 30 Sep 2021 02:46:27 +0000 (19:46 -0700)]
smyrna: remove unused 'Color_Widget'

3 years agosmyrna: remove past deleted prototypes
Matthew Fernandez [Thu, 30 Sep 2021 02:31:50 +0000 (19:31 -0700)]
smyrna: remove past deleted prototypes

These were all removed in 7bfe3c0d255829ff9a837ff85e3c14dd63636771.

3 years agosmyrna: remove unused 'get_attribute_string_value_from_widget'
Matthew Fernandez [Thu, 30 Sep 2021 02:37:46 +0000 (19:37 -0700)]
smyrna: remove unused 'get_attribute_string_value_from_widget'

3 years agosmyrna: remove prototypes of deleted functions
Matthew Fernandez [Thu, 30 Sep 2021 02:36:56 +0000 (19:36 -0700)]
smyrna: remove prototypes of deleted functions

These functions were removed in af92d6ce857bfa235d6fe771088074a9979b7172.

3 years agoMerge branch 'smattr/EE8B63B0-BCF9-4965-BF06-D885D15A5F4C' into 'main'
Matthew Fernandez [Sat, 2 Oct 2021 02:36:31 +0000 (02:36 +0000)]
Merge branch 'smattr/EE8B63B0-BCF9-4965-BF06-D885D15A5F4C' into 'main'

fix GVPR incorrect interpretation of color strings

Closes #1956

See merge request graphviz/graphviz!2197

3 years agofix GVPR incorrect interpretation of color strings
Matthew Fernandez [Thu, 30 Sep 2021 03:29:01 +0000 (20:29 -0700)]
fix GVPR incorrect interpretation of color strings

The logical operators here were pretty clearly meant to be `&&` not `||`. But
this kind of micro-optimization is unnecessary on modern machines anyway, so we
can just rewrite this into something that is more obvious for both readers and
the compiler.

It would have been nice to add a provoking test case for this as well, but it is
not clear to me how exactly to reach this path. This bug has been open for quite
a while, so it seems simpler to apply the obvious fix and move on.

Fixes #1956.

3 years agoMerge branch 'smattr/EFCF3C3B-5099-47C0-8C68-B580D736A900' into 'main'
Matthew Fernandez [Sat, 2 Oct 2021 01:13:14 +0000 (01:13 +0000)]
Merge branch 'smattr/EFCF3C3B-5099-47C0-8C68-B580D736A900' into 'main'

more smyrna clean up

See merge request graphviz/graphviz!2195

3 years agosmyrna: mark 'cb_special_key_up' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:42:31 +0000 (17:42 -0700)]
smyrna: mark 'cb_special_key_up' as static

This function is not used outside of its containing file.

3 years agosmyrna: mark 'cb_special_key' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:41:49 +0000 (17:41 -0700)]
smyrna: mark 'cb_special_key' as static

This function is not used outside of its containing file.

3 years agosmyrna: mark 'cb_keyboard_up' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:41:02 +0000 (17:41 -0700)]
smyrna: mark 'cb_keyboard_up' as static

This function is not used outside of its containing file.

3 years agosmyrna: mark 'cb_keyboard' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:40:13 +0000 (17:40 -0700)]
smyrna: mark 'cb_keyboard' as static

This function is not used outside of its containing file.

3 years agosmyrna: remove useless 'cb_mouseover' callback
Matthew Fernandez [Wed, 29 Sep 2021 00:39:06 +0000 (17:39 -0700)]
smyrna: remove useless 'cb_mouseover' callback

3 years agosmyrna: remove useless 'cb_mouseentry' callback
Matthew Fernandez [Wed, 29 Sep 2021 00:35:09 +0000 (17:35 -0700)]
smyrna: remove useless 'cb_mouseentry' callback

3 years agosmyrna: mark 'cb_drag' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:34:19 +0000 (17:34 -0700)]
smyrna: mark 'cb_drag' as static

This function is not used outside of its containing file.

3 years agosmyrna: mark 'cb_mouseclick' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:32:08 +0000 (17:32 -0700)]
smyrna: mark 'cb_mouseclick' as static

This function is not used outside of its containing file.

3 years agosmyrna: mark 'cb_display' as static
Matthew Fernandez [Wed, 29 Sep 2021 00:31:21 +0000 (17:31 -0700)]
smyrna: mark 'cb_display' as static

This function is not used outside of its containing file.

3 years agosmyrna cb_reshape: remove some commented out code
Matthew Fernandez [Wed, 29 Sep 2021 00:30:49 +0000 (17:30 -0700)]
smyrna cb_reshape: remove some commented out code

3 years agosmyrna: mark 'cb_reshape' static
Matthew Fernandez [Wed, 29 Sep 2021 00:29:47 +0000 (17:29 -0700)]
smyrna: mark 'cb_reshape' static

This function is not used outside of its containing file.

3 years agosmyrna scale_coords: remove open coded fmin/fmax
Matthew Fernandez [Wed, 29 Sep 2021 00:24:20 +0000 (17:24 -0700)]
smyrna scale_coords: remove open coded fmin/fmax

3 years agoMerge branch 'smattr/3594869f-443d-4168-9358-4195b0666b11' into 'main'
Matthew Fernandez [Fri, 1 Oct 2021 15:50:10 +0000 (15:50 +0000)]
Merge branch 'smattr/3594869f-443d-4168-9358-4195b0666b11' into 'main'

gv2gml: fix attribute escaping

Closes #1276

See merge request graphviz/graphviz!2189

3 years agogv2gml: fix attribute escaping
Matthew Fernandez [Sat, 25 Sep 2021 19:27:36 +0000 (12:27 -0700)]
gv2gml: fix attribute escaping

When processing characters in attribute values that should be escaped (e.g.
`"`), `gv2gml` would emit these as-is, resulting in invalid GML output. Such
attribute values are now correctly XML-escaped.

Fixes #1276.

3 years agogv2gml: also link to libgvc
Matthew Fernandez [Sat, 25 Sep 2021 18:31:03 +0000 (11:31 -0700)]
gv2gml: also link to libgvc

Upcoming changes will make use of some functionality from libcommon, which is
consolidated into libgvc.

Related to #1276.

3 years agogv2gml: fix: realign MS Build include paths with CMake and Autotools
Matthew Fernandez [Mon, 27 Sep 2021 02:48:51 +0000 (19:48 -0700)]
gv2gml: fix: realign MS Build include paths with CMake and Autotools

3 years agolib/common: move XML functions to a separate source file
Matthew Fernandez [Sat, 25 Sep 2021 19:17:10 +0000 (12:17 -0700)]
lib/common: move XML functions to a separate source file

Symbol resolution during linking is done on a per-file basis. Thus any use of a
function from labels.c was requiring all functions in labels.c to have their
symbols resolved. This is probably one of the partial causes of the
proliferation of duplicate XML escaping code (#1868).

This commit splits the XML escaping code into a separate file, allowing it to be
used without also requiring dependencies of unrelated functions in labels.c to
be satisfied. In the specific case motivating this, this will enable `gv2gml` to
call these XML escaping functions without linking against libcdt and libgvc.

For the above explained linking reasons, in future it may be desirable to
further separate library functions at an even finer grained basis than done in
this commit.

Related to #1276.

3 years agogv2gml: rename a 'path' parameter to 'cmd'
Matthew Fernandez [Sat, 25 Sep 2021 19:26:29 +0000 (12:26 -0700)]
gv2gml: rename a 'path' parameter to 'cmd'

This has no immediate effect. However an upcoming change will introduce a header
include that brings in another 'path' symbol. So this change pre-emptively
squashes the -Wshadow compiler warning that would otherwise be introduced.

Related to #1276.

3 years agogv2gml: rename 'Agnodeinfo_t' type to 'Local_Agnodeinfo_t'
Matthew Fernandez [Sat, 25 Sep 2021 18:23:42 +0000 (11:23 -0700)]
gv2gml: rename 'Agnodeinfo_t' type to 'Local_Agnodeinfo_t'

This has no immediate effect, but having a type named `Agnodeinfo_t` prevents
including lib/common/types.h which has its own `Agnodeinfo_t`. We will want to
include this header (transitively) in an upcoming commit.

Related to #1276.

3 years agogv2gml: remove unused struct name
Matthew Fernandez [Sat, 25 Sep 2021 18:22:42 +0000 (11:22 -0700)]
gv2gml: remove unused struct name

3 years agolib/common: fix a comment typo
Matthew Fernandez [Sat, 25 Sep 2021 18:17:59 +0000 (11:17 -0700)]
lib/common: fix a comment typo

3 years agoadd a test case for invalid GML output
Matthew Fernandez [Sat, 25 Sep 2021 18:08:09 +0000 (11:08 -0700)]
add a test case for invalid GML output

Related to #1276.

3 years agoMerge branch 'smattr/6E1345C1-7D81-44AE-A450-A03CF02EBEFC' into 'main'
Matthew Fernandez [Fri, 1 Oct 2021 01:04:55 +0000 (01:04 +0000)]
Merge branch 'smattr/6E1345C1-7D81-44AE-A450-A03CF02EBEFC' into 'main'

adjust the release process to not require gen_version.py tweaks

See merge request graphviz/graphviz!2186

3 years agoadjust the release process to not require gen_version.py tweaks
Matthew Fernandez [Sat, 25 Sep 2021 00:20:05 +0000 (17:20 -0700)]
adjust the release process to not require gen_version.py tweaks

This change has two primary motivations:

  1. Streamlining the release steps and reducing the opportunities for human
     error; and

  2. Improving clarity in the release artifacts.

Following this change, no edits are required to gen_version.py in order to cut
a new release. The Graphviz version – both inter-release and for releases
themselves – is derived exclusively from CHANGELOG.md. The effect of this is
expected to be:

  1. Cleaner release commits. No more regular churn of gen_version.py.

  2. More obvious CHANGELOG.md in the release artifacts. This file will no
     longer have a spurious “[Unreleased]” heading preceding the actual
     changelog for the release.

3 years agoMerge branch 'smattr/B81C2CF2-04BB-446A-8473-6CC49CC21B5A' into 'main'
Matthew Fernandez [Thu, 30 Sep 2021 01:37:35 +0000 (01:37 +0000)]
Merge branch 'smattr/B81C2CF2-04BB-446A-8473-6CC49CC21B5A' into 'main'

smyrna: yet more dead code removal

See merge request graphviz/graphviz!2184

3 years agosmyrna: remove unused object init functions
Matthew Fernandez [Fri, 24 Sep 2021 00:31:19 +0000 (17:31 -0700)]
smyrna: remove unused object init functions

3 years agosmyrna: remove now-unused cbSelectGraph
Matthew Fernandez [Fri, 24 Sep 2021 00:27:19 +0000 (17:27 -0700)]
smyrna: remove now-unused cbSelectGraph

3 years agosmyrna: remove unused get_SelectGraph
Matthew Fernandez [Fri, 24 Sep 2021 00:27:07 +0000 (17:27 -0700)]
smyrna: remove unused get_SelectGraph

3 years agosmyrna: remove unused frmObjectg
Matthew Fernandez [Fri, 24 Sep 2021 00:24:28 +0000 (17:24 -0700)]
smyrna: remove unused frmObjectg

3 years agosmyrna: remove unused frmObjectTypeIndex
Matthew Fernandez [Fri, 24 Sep 2021 00:23:12 +0000 (17:23 -0700)]
smyrna: remove unused frmObjectTypeIndex

3 years agosmyrna: mark filter_attributes as static
Matthew Fernandez [Fri, 24 Sep 2021 00:16:49 +0000 (17:16 -0700)]
smyrna: mark filter_attributes as static

This is not used outside of its containing file.

3 years agosmyrna: remove unnecessary binarySearch prototype
Matthew Fernandez [Fri, 24 Sep 2021 00:14:19 +0000 (17:14 -0700)]
smyrna: remove unnecessary binarySearch prototype

3 years agosmyrna: remove unused topviewdefs.h
Matthew Fernandez [Fri, 24 Sep 2021 00:12:17 +0000 (17:12 -0700)]
smyrna: remove unused topviewdefs.h

3 years agosmyrna: remove commented out code
Matthew Fernandez [Fri, 24 Sep 2021 00:01:43 +0000 (17:01 -0700)]
smyrna: remove commented out code

3 years agosmyrna: remove duplicate _BB definitions
Matthew Fernandez [Fri, 24 Sep 2021 00:01:30 +0000 (17:01 -0700)]
smyrna: remove duplicate _BB definitions

There was the option to remove the first duplicate or the second in this file. I
checked that none of the intervening includes depended on a `_BB` definition. It
seemed clearer to remove the first and indicate that only Smyrna itself is using
`_BB`.

3 years agoMerge branch 'smattr/916A53CB-2137-4E39-802A-72DCD4716DD5' into 'main'
Matthew Fernandez [Wed, 29 Sep 2021 16:15:54 +0000 (16:15 +0000)]
Merge branch 'smattr/916A53CB-2137-4E39-802A-72DCD4716DD5' into 'main'

toggle Lefty to disabled by default in the Autotools build system

See merge request graphviz/graphviz!2194

3 years agodebian/rules: remove commented out lines
Matthew Fernandez [Tue, 28 Sep 2021 14:35:16 +0000 (07:35 -0700)]
debian/rules: remove commented out lines

3 years agoremove some commented out RHEL build lines
Matthew Fernandez [Tue, 28 Sep 2021 04:14:37 +0000 (21:14 -0700)]
remove some commented out RHEL build lines

3 years agotoggle Lefty to disabled by default in the Autotools build system
Matthew Fernandez [Sat, 25 Sep 2021 21:53:49 +0000 (14:53 -0700)]
toggle Lefty to disabled by default in the Autotools build system

Based on a discussion that Lefty should be deprecated,¹ this takes the first
step towards removing it. It is hoped that by disabling it by default, this will
expose any downstream consumers who are relying on it being built by default.

If there are no complaints within three months, I think we can then remove build
system support entirely. If another three months pass without noise, I think we
can then remove Lefty sources from Graphviz.

In case the linked discussion is inaccessible when reading this commit message,
the summary from Stephen was:

  Lefty was an early interpreter for graphics programming. It’s from about 1990
  or 91, and we used it as the basis for a scriptable graphviz viewer, dotty.
  It was student code written by Lefteris Koutsofios. I thought there was some
  C code for parsing graphs but I could be wrong.

  Even libast came into the picture much later, but I suppose that was done to
  clean up some of its OS dependencies or to make it more portable or robust in
  some way.

  I’m ok with retiring it.

¹ https://forum.graphviz.org/t/lefty-not-a-graphviz-application/835

3 years agoexplicitly enable Lefty compilation in Autotools CI
Matthew Fernandez [Sat, 25 Sep 2021 20:57:52 +0000 (13:57 -0700)]
explicitly enable Lefty compilation in Autotools CI

Lefty is enabled by default currently, but an upcoming change will toggle this
to default-disabled.

3 years agoMerge branch 'add-cygwin-autotools-build-to-ci' into 'main'
Magnus Jacobsson [Tue, 28 Sep 2021 17:18:01 +0000 (17:18 +0000)]
Merge branch 'add-cygwin-autotools-build-to-ci' into 'main'

Add Cygwin autotools build jobs to CI

See merge request graphviz/graphviz!2193

3 years agoCI: add windows-cygwin-build-using-autogen job
Magnus Jacobsson [Thu, 9 Sep 2021 16:43:25 +0000 (18:43 +0200)]
CI: add windows-cygwin-build-using-autogen job

3 years agoci/build.sh: autotools: add support building for Cygwin using autogen
Magnus Jacobsson [Thu, 9 Sep 2021 16:42:30 +0000 (18:42 +0200)]
ci/build.sh: autotools: add support building for Cygwin using autogen

3 years agoci/cygwin-build.sh: add installation of autoconf2.5 & automake
Magnus Jacobsson [Thu, 9 Sep 2021 17:23:28 +0000 (19:23 +0200)]
ci/cygwin-build.sh: add installation of autoconf2.5 & automake

3 years agoCI: add autotools windows-cygwin-build
Magnus Jacobsson [Sun, 22 Aug 2021 09:58:23 +0000 (11:58 +0200)]
CI: add autotools windows-cygwin-build

3 years agoci/build.sh: add support for Cygwin autotools builds
Magnus Jacobsson [Thu, 5 Aug 2021 11:25:12 +0000 (13:25 +0200)]
ci/build.sh: add support for Cygwin autotools builds

3 years agocommon: unify diverged storage-class attributes in globals.h
Magnus Jacobsson [Tue, 14 Sep 2021 14:27:04 +0000 (16:27 +0200)]
common: unify diverged storage-class attributes in globals.h

The immediate reason for this commit is to fix a bug when using the
autools build system with Cygwin, described below, but it is also a
step towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545.

This file had one set of Windows-specific storage-class attribute
declarations intended for use with the autotools build system and one
set intended for use with Visual Studio, with slightly different
control mechanisms.

It's unclear what effect changes made to these control mechanisms over
the years has had on the many operating systems that are not tested in
CI. The current state is that they partly overlap and are very hard to
understand.

This commit cleans this up by applying such declarations only if the
GVDLL or the WIN32_DLL symbol is set. An export declaration is used if
either the GVC_EXPORT or the _BLD_GVC symbol is defined and an import
declaration otherwise.

Using both GVDLL and WIN32_DLL for the same purpose is a temporary
measure and will be replaced by only one symbol in an upcoming commit
series towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545.

Since https://gitlab.com/graphviz/graphviz/-/merge_requests/2182,
setting GVDLL is the preferred single mechanism to enable those
attributes, rather than using _WIN32 and __CYGWIN__ plus some other
symbol to distinguish between static and dynamic-link/shared
libraries.

Likewise is the use of both GVC_EXPORT and _BLD_gvc for the same
purpose a temporary measure, which will be replaced by only one symbol
in an upcoming commit series towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545.

This fixes a segmentation fault when running 'dot -c' during 'make install' on Cygwin.

Debugging with gdb showed that this happened on line 99 in dot.c:
    GvExitOnUsage = 1;

3 years agocmd/edgepaint: MSBuild: define GVDLL in the project file
Magnus Jacobsson [Tue, 14 Sep 2021 18:06:19 +0000 (20:06 +0200)]
cmd/edgepaint: MSBuild: define GVDLL in the project file

Without this change, an upcoming commit in this series that unites the
storage class attributes in lib/common/globals.h that have diverged
for different build systems, would cause edgepaint to generate a
segmentation fault (error code 3221225477 = 0xC0000005: access
violation) when started on native Windows.

Also towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545.

3 years agogvc: autotools: work around cygwin linking problem with .def file
Magnus Jacobsson [Mon, 13 Sep 2021 15:11:21 +0000 (17:11 +0200)]
gvc: autotools: work around cygwin linking problem with .def file

This workaround is just a temporary measure until an upcoming commit
series towards https://gitlab.com/graphviz/graphviz/-/issues/2058 will
remove the .def file.

Fixes this error with Cygwin when running 'dot -c' during installation.

C:/Users/magja/graphviz/build/bin/dot.exe: error while loading shared libraries: gvc.dll: cannot open shared object file: No such file or directory

Before this commit, the following results were obtained:

ldd build/bin/dot.exe =>
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffca85c0000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffca69d0000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffca6170000)
        cygcgraph-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcgraph-6.dll (0x487030000)
        cygcdt-5.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcdt-5.dll (0x552550000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        gvc.dll => not found

objdump -s lib/gvc/.libs/libgvc.dll.a | grep -i dll =>
In archive lib/gvc/.libs/libgvc.dll.a:
 0000 6776632e 646c6c00                    gvc.dll.

After this commit, the following results are obtained:

ldd build/bin/dot.exe =>
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffca85c0000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffca69d0000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffca6170000)
        cyggvc-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cyggvc-6.dll (0x5941e0000)
        cygcgraph-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcgraph-6.dll (0x487030000)
        cygcdt-5.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcdt-5.dll (0x552550000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0xe60000)
        cygpathplan-4.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygpathplan-4.dll (0x461410000)
        cygz.dll => /usr/bin/cygz.dll (0x3ff080000)
        cygexpat-1.dll => /usr/bin/cygexpat-1.dll (0x3fe370000)
        cygltdl-7.dll => /usr/bin/cygltdl-7.dll (0x3feba0000)

objdump -s lib/gvc/.libs/libgvc.dll.a | grep -i dll =>
In archive lib/gvc/.libs/libgvc.dll.a:
 0000 63796767 76632d36 2e646c6c 00000000  cyggvc-6.dll....

3 years agoautotools: add WITH_CYGWIN to AM_CONDITIONAL
Magnus Jacobsson [Mon, 13 Sep 2021 15:10:31 +0000 (17:10 +0200)]
autotools: add WITH_CYGWIN to AM_CONDITIONAL

This will allow an upcoming commit in this series to introduce
Cygwin-specific functionality in the autotools build system.

3 years agocmd/dot: autotools: cd to bin dir before running dot -c
Magnus Jacobsson [Sat, 11 Sep 2021 10:30:06 +0000 (12:30 +0200)]
cmd/dot: autotools: cd to bin dir before running dot -c

Fixes this error with Cygwin:

C:/GitLab-Runner/builds/magjac/graphviz/build/bin/dot.exe: error while loading shared libraries: cygcgraph-6.dll: cannot open shared object file: No such file or directory

3 years agoortho: autotools: set also GVC_EXPORTS
Magnus Jacobsson [Sun, 22 Aug 2021 06:40:28 +0000 (08:40 +0200)]
ortho: autotools: set also GVC_EXPORTS

The immediate reason for this change is to correct the
Microsoft-specfic storage-class attributes in autotools builds with
Cygwin.

The object modules from the static ortho lib is statically linked into
the gvc shared lib which means that its symbols should be exported
from gvc instead of imported.

This is the second and final step in fixing these errors in autotools
builds with Cygwin:

/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(dotsplines.o): in function `_dot_splines':
/home/magja/graphviz/lib/dotgen/dotsplines.c:334: undefined reference to `__imp_orthoEdges'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /home/magja/graphviz/lib/dotgen/dotsplines.c:337: undefined reference to `__imp_orthoEdges'

The _BLD_gvc symbol is used for basically the same purpose as
GVC_EXPORTS. Using both is a temporary measure until an upcoming
commit series towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545
cleans up the control of the Windows specific storage-class attributes

3 years agoortho: use GVDLL instead of _WIN32 to enable storage-class attributes
Magnus Jacobsson [Sun, 22 Aug 2021 08:45:11 +0000 (10:45 +0200)]
ortho: use GVDLL instead of _WIN32 to enable storage-class attributes

The immediate reason for this change is to enable Windows-specific
storage-class attributes for autotools builds with Cygwin. The _WIN32
symbol is not defined when using Cygwin.

Since https://gitlab.com/graphviz/graphviz/-/merge_requests/2182,
setting GVDLL is the preferred single mechanism to enable those
attributes, rather than using _WIN32 and __CYGWIN__ plus some other
symbol to distinguish between static and dynamic-link/shared
libraries.

This is the first step of two in fixing these errors in autotools
builds with Cygwin:

/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(dotsplines.o): in function `_dot_splines':
/home/magja/graphviz/lib/dotgen/dotsplines.c:334: undefined reference to `orthoEdges'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /home/magja/graphviz/lib/dotgen/dotsplines.c:337: undefined reference to `orthoEdges'

The Windows-specific storage-class attributes are however still not
correct for Cygwin autotools builds, since GVC_EXPORT is currently not
set in the autotools builds. The error is now instead:

/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/dotgen/.libs/libdotgen_C.a(dotsplines.o): in function `_dot_splines':
/home/magja/graphviz/lib/dotgen/dotsplines.c:334: undefined reference to `__imp_orthoEdges'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /home/magja/graphviz/lib/dotgen/dotsplines.c:337: undefined reference to `__imp_orthoEdges'

The next commit in this series will fix this.

Also towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545

3 years agoortho: MSBuild: define GVDLL
Magnus Jacobsson [Sun, 1 Aug 2021 16:01:01 +0000 (18:01 +0200)]
ortho: MSBuild: define GVDLL

Without this change, an upcoming commit in this series that will use
GVDLL instead of _WIN32 to enable Microsoft-specific storage-class
attributes would cause this error:

neatogen.lib(neatosplines.obj) : error LNK2019: unresolved external symbol _orthoEdges referenced in function __spline_edges [C:\GitLab-Runner\builds\magjac\graphviz\plugin\neato_layout\gvplugin_neato_layout.vcxproj]

Since https://gitlab.com/graphviz/graphviz/-/merge_requests/2182,
setting GVDLL is the preferred single mechanism to enable
Microsoft-specific storage-class attributes.

Also towards
https://gitlab.com/graphviz/graphviz/-/issues/2058#note_678679545

3 years agoplugin/core: autotools: make awk crlf agnostic when generating ps.h
Magnus Jacobsson [Sun, 22 Aug 2021 06:25:01 +0000 (08:25 +0200)]
plugin/core: autotools: make awk crlf agnostic when generating ps.h

Fixes errors like this with Cygwin in a crlf environment even with
SHELLOPTS=igncr:

ps.h:2:1: error: missing terminating " character
    2 | "%%BeginProlog ",
      | ^~~~~~~~~~~~~~

Although not shown in the error message, this line actually contained
a carriage return after %%BeginProlog:

"%%BeginProlog\r",

3 years agoedgepaint: autotools: add -no-undefined to LDFLAGS
Magnus Jacobsson [Sat, 24 Jul 2021 13:25:32 +0000 (15:25 +0200)]
edgepaint: autotools: add -no-undefined to LDFLAGS

Fixes this error with Cygwin:

libtool:   error: can't build x86_64-pc-cygwin shared library unless -no-undefined is specified

3 years agocommon: autotools: make awk crlf agnostic when generating svgcolor_lib
Magnus Jacobsson [Sun, 22 Aug 2021 06:10:21 +0000 (08:10 +0200)]
common: autotools: make awk crlf agnostic when generating svgcolor_lib

Fixes errors like this with Cygwin in a crlf environment with
SHELLOPTS=igncr:

../../lib/common/colortbl.h:1524:2: error: missing terminating " character
 1524 | {"/svg/ ",0,255,255,255,0,0,0},
      |  ^~~~~~

Although not shown in the error message, this line actually contained
a carriage return after /svg/:

{"/svg/^M",0,255,255,255,0,0,0},

3 years agoMerge branch 'smattr/B932BD99-362C-483F-B10D-B09620EC522E' into 'main'
Matthew Fernandez [Tue, 28 Sep 2021 03:21:10 +0000 (03:21 +0000)]
Merge branch 'smattr/B932BD99-362C-483F-B10D-B09620EC522E' into 'main'

smyrna: more cleanup

See merge request graphviz/graphviz!2191

3 years agosmyrma: push the scope of 'package_*' variables inwards
Matthew Fernandez [Sun, 26 Sep 2021 00:15:50 +0000 (17:15 -0700)]
smyrma: push the scope of 'package_*' variables inwards

These do not need to be exposed beyond main.c or even need to be globals. They
are not used outside of a single function.

3 years agosmyrna: remove 'glade_set_atk_action_description' prototype
Matthew Fernandez [Sun, 26 Sep 2021 00:12:14 +0000 (17:12 -0700)]
smyrna: remove 'glade_set_atk_action_description' prototype

This function was removed in 514a0056e9dfaa90d2bef63bb2150b6bd86152c9.

3 years agosmyrna support.h: remove commented out code
Matthew Fernandez [Sun, 26 Sep 2021 00:11:36 +0000 (17:11 -0700)]
smyrna support.h: remove commented out code

3 years agosmyrna: remove 'create_pixmap' prototype
Matthew Fernandez [Sun, 26 Sep 2021 00:11:10 +0000 (17:11 -0700)]
smyrna: remove 'create_pixmap' prototype

This function was removed in 514a0056e9dfaa90d2bef63bb2150b6bd86152c9.

3 years agosmyrna: remove 'lookup_widget' prototype
Matthew Fernandez [Sun, 26 Sep 2021 00:09:34 +0000 (17:09 -0700)]
smyrna: remove 'lookup_widget' prototype

This function was removed in 514a0056e9dfaa90d2bef63bb2150b6bd86152c9.

3 years agosmyrna: remove prototype of 'freeFocus'
Matthew Fernandez [Sun, 26 Sep 2021 00:05:16 +0000 (17:05 -0700)]
smyrna: remove prototype of 'freeFocus'

This function was removed in af92d6ce857bfa235d6fe771088074a9979b7172.