]> granicus.if.org Git - graphviz/log
graphviz
4 years agoremove unnecessary NUL_FILE use
Matthew Fernandez [Sun, 30 Aug 2020 16:56:21 +0000 (09:56 -0700)]
remove unnecessary NUL_FILE use

The Cairo API supports simply passing NULL to indicate you do not want the
output written to a file.

4 years agoMerge branch '2be5439a-0e4a-4a18-98ad-2a13d8c5b9fd' into 'master'
Matthew Fernandez [Sat, 5 Sep 2020 17:18:14 +0000 (17:18 +0000)]
Merge branch '2be5439a-0e4a-4a18-98ad-2a13d8c5b9fd' into 'master'

fix failure to link gvpr with debug enabled

Closes #1807

See merge request graphviz/graphviz!1549

4 years agofix failure to link gvpr with debug enabled
Matthew Fernandez [Sun, 30 Aug 2020 14:58:28 +0000 (07:58 -0700)]
fix failure to link gvpr with debug enabled

When using `CFLAGS=-DDEBUG CXXFLAGS=-DDEBUG ./configure --enable-debug`, gvpr
would fail to link due to missing libraries. Fixes #1807.

4 years agoMerge branch '5213EAD3-14D1-45A4-A269-4C7D9DA5F44B' into 'master'
Matthew Fernandez [Fri, 4 Sep 2020 00:25:56 +0000 (00:25 +0000)]
Merge branch '5213EAD3-14D1-45A4-A269-4C7D9DA5F44B' into 'master'

remove unused sfdcslow()

See merge request graphviz/graphviz!1545

4 years agoremove unused sfdcslow()
Matthew Fernandez [Fri, 28 Aug 2020 14:12:19 +0000 (07:12 -0700)]
remove unused sfdcslow()

4 years agoMerge branch 'c6f76f21-830c-4108-aafa-806719ed59d2' into 'master'
Matthew Fernandez [Wed, 2 Sep 2020 15:24:14 +0000 (15:24 +0000)]
Merge branch 'c6f76f21-830c-4108-aafa-806719ed59d2' into 'master'

clean up RxSpencer CMake warnings

See merge request graphviz/graphviz!1544

4 years agoremove advanced target suppression for RxSpencer in CMake builds
Matthew Fernandez [Fri, 28 Aug 2020 03:12:19 +0000 (20:12 -0700)]
remove advanced target suppression for RxSpencer in CMake builds

This section suppressed detailed messages about where (or not) RxSpencer was
found. Given the majority of CMake builds are performed by either CI or advanced
users, it did not make sense to suppress this information that is very useful
for debugging failures.

4 years agofix case warnings for RxSpencer during CMake builds
Matthew Fernandez [Fri, 28 Aug 2020 03:09:28 +0000 (20:09 -0700)]
fix case warnings for RxSpencer during CMake builds

This fixes the following CI warning:

  -- Found RXSPENCER: ...rxspencer.lib
  CMake Warning (dev) at ...FindPackageHandleStandardArgs.cmake:272 (message):
    The package name passed to `find_package_handle_standard_args` (RXSPENCER)
    does not match the name of the calling package (RxSpencer).  This can lead
    to problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindRxSpencer.cmake:5 (find_package_handle_standard_args)
    CMakeLists.txt:90 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.

4 years agoMerge branch '064bf64e-752b-45fc-8da7-e66050fbe8b5' into 'master'
Matthew Fernandez [Wed, 2 Sep 2020 00:45:09 +0000 (00:45 +0000)]
Merge branch '064bf64e-752b-45fc-8da7-e66050fbe8b5' into 'master'

remove ad hoc name mangling in cgraph parser

See merge request graphviz/graphviz!1543

4 years agoremove unnecessary intermediate build step
Matthew Fernandez [Tue, 25 Aug 2020 02:26:55 +0000 (19:26 -0700)]
remove unnecessary intermediate build step

4 years agoremove now unnecessary find-and-replace step
Matthew Fernandez [Tue, 25 Aug 2020 02:06:28 +0000 (19:06 -0700)]
remove now unnecessary find-and-replace step

4 years agoremove unnecessary intermediate build artifact
Matthew Fernandez [Thu, 27 Aug 2020 02:43:23 +0000 (19:43 -0700)]
remove unnecessary intermediate build artifact

4 years agoremove some now unnecessary name mangling
Matthew Fernandez [Thu, 27 Aug 2020 02:42:38 +0000 (19:42 -0700)]
remove some now unnecessary name mangling

4 years agouse Bison's api.prefix and Flex's prefix instead of name mangling in cgraph
Matthew Fernandez [Tue, 25 Aug 2020 01:31:26 +0000 (18:31 -0700)]
use Bison's api.prefix and Flex's prefix instead of name mangling in cgraph

Related to !1523. Bison's api.prefix was introduced in 2.6, but switched to
using this bracing syntax in 3.0. Quoting from the Bison 3.0 release notes:

  ** Types of values for %define variables

  Bison used to make no difference between '%define foo bar' and '%define
  foo "bar"'.  The former is now called a 'keyword value', and the latter a
  'string value'.  A third kind was added: 'code values', such as '%define
  foo {bar}'.

  Keyword variables are used for fixed value sets, e.g.,

    %define lr.type lalr

  Code variables are used for value in the target language, e.g.,

    %define api.value.type {struct semantic_type}

  String variables are used remaining cases, e.g. file names.

The Flex option prefix was introduced in Flex 2.4.1 (November 1993) and then
stabilized around 2.5.2 (April 1995). It provides similar functionality:

  ‘-PPREFIX, --prefix=PREFIX, %option prefix="PREFIX"’

  changes the default ‘yy’ prefix used by flex for all globally-visible variable
  and function names to instead be ‘PREFIX’. For example, ‘--prefix=foo’ changes
  the name of yytext to footext. It also changes the name of the default output
  file from lex.yy.c to lex.foo.c.

It would have been nicer to split the lexer and parser changes into separate
commits. However, the MSBuild build does no name mangling here (see
lib/cgraph/cgraph.vcxproj), so changing one of these immediately broke the other
one there. On the positive side, this commit has the effect of realigning some
MSBuild outputs with the Autotools build, as the cgraph lexer and parser are now
aag-prefixed there as well.

4 years agodrop compatibility with Yacc, Bison < 3 in lib/cgraph/grammar.y
Matthew Fernandez [Thu, 27 Aug 2020 00:32:14 +0000 (17:32 -0700)]
drop compatibility with Yacc, Bison < 3 in lib/cgraph/grammar.y

This will allow us to use api.prefix with brace syntax in an upcoming commit.
Bison 3.0 was released in July 2013 [0], so this seems an acceptable base line
requirement from now on.

  [0]: http://savannah.gnu.org/forum/forum.php?forum_id=7663

4 years agosuppress warnings from using Bison extensions in lib/cgraph/grammar.y
Matthew Fernandez [Tue, 25 Aug 2020 01:23:54 +0000 (18:23 -0700)]
suppress warnings from using Bison extensions in lib/cgraph/grammar.y

We don't currently use any, but are about to introduce one. For some more back
story on this, we quote the Bison 3.0 release notes:

  *** Use of YACC='bison -y'

  TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use
  Bison extensions.

  Traditional Yacc generates 'y.tab.c' whatever the name of the input file.
  Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly
  'y.tab.h' and 'y.outout') to be generated from 'foo.y'.

  To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an
  implementation of Yacc, was using Bison as 'bison -y'.  While it does
  ensure compatible output file names, it also enables warnings for
  incompatibilities with POSIX Yacc.  In other words, 'bison -y' triggers
  warnings for Bison extensions.

  Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c'
  (which also generates 'y.tab.h' and 'y.output' when needed).
  Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc
  flags (YFLAGS, or AM_YFLAGS with Automake).

4 years agoMerge branch '61ec04a4-5eb2-47e7-a491-cd20773f1460' into 'master'
Matthew Fernandez [Tue, 1 Sep 2020 00:37:49 +0000 (00:37 +0000)]
Merge branch '61ec04a4-5eb2-47e7-a491-cd20773f1460' into 'master'

remove use of ABS in favor of abs/fabs

See merge request graphviz/graphviz!1540

4 years agoremove now unused ABS macros
Matthew Fernandez [Wed, 26 Aug 2020 01:14:39 +0000 (18:14 -0700)]
remove now unused ABS macros

4 years agouse abs() instead of ABS() for taking the absolute value of ints
Matthew Fernandez [Wed, 26 Aug 2020 01:05:38 +0000 (18:05 -0700)]
use abs() instead of ABS() for taking the absolute value of ints

Similar to b88ebe0548dd412ea415d6cfc410d91117270277 and the previous commit,
this replaces uses of the macro ABS with standard library functionality for
readability and maintainability.

4 years agouse fabs() instead of ABS() for taking the absolute value of reals
Matthew Fernandez [Wed, 26 Aug 2020 00:50:39 +0000 (17:50 -0700)]
use fabs() instead of ABS() for taking the absolute value of reals

The type real is #defined to double, so we can use the same replacement as in
b88ebe0548dd412ea415d6cfc410d91117270277 to simplify this code.

4 years agoremove unused collide macro
Matthew Fernandez [Wed, 26 Aug 2020 00:20:51 +0000 (17:20 -0700)]
remove unused collide macro

4 years agoremove unused ABS definition
Matthew Fernandez [Wed, 26 Aug 2020 00:08:57 +0000 (17:08 -0700)]
remove unused ABS definition

4 years agoMerge branch 'CBC6D01D-6639-4C01-BFB5-0B336AD01D0E' into 'master'
Matthew Fernandez [Sun, 30 Aug 2020 02:03:53 +0000 (02:03 +0000)]
Merge branch 'CBC6D01D-6639-4C01-BFB5-0B336AD01D0E' into 'master'

remove executability from some source files

See merge request graphviz/graphviz!1546

4 years agoremove executability from some source files
Matthew Fernandez [Sat, 29 Aug 2020 00:42:56 +0000 (17:42 -0700)]
remove executability from some source files

4 years agoMerge branch 'E30B249E-79E8-4BF0-9276-C11C1464A32C' into 'master'
Matthew Fernandez [Sun, 30 Aug 2020 01:45:57 +0000 (01:45 +0000)]
Merge branch 'E30B249E-79E8-4BF0-9276-C11C1464A32C' into 'master'

remove unused variable

See merge request graphviz/graphviz!1548

4 years agoremove unused variable
Matthew Fernandez [Sat, 29 Aug 2020 18:29:47 +0000 (11:29 -0700)]
remove unused variable

4 years agoMerge branch 'add-metrics-report-with-warnings-to-ci' into 'master'
Magnus Jacobsson [Sat, 29 Aug 2020 17:54:10 +0000 (17:54 +0000)]
Merge branch 'add-metrics-report-with-warnings-to-ci' into 'master'

Add a metrics report with warnings to pull requests

See merge request graphviz/graphviz!1547

4 years agoAdd a metrics report with warnings to CI
Magnus Jacobsson [Fri, 28 Aug 2020 12:51:45 +0000 (14:51 +0200)]
Add a metrics report with warnings to CI

4 years agoMerge branch 'dfabfa2e-74d2-4bec-b68e-90ea7c501b77' into 'master'
Matthew Fernandez [Fri, 28 Aug 2020 14:07:46 +0000 (14:07 +0000)]
Merge branch 'dfabfa2e-74d2-4bec-b68e-90ea7c501b77' into 'master'

remove unused sfdcseekable

See merge request graphviz/graphviz!1534

4 years agoremove unused sfdcseekable
Matthew Fernandez [Sat, 22 Aug 2020 16:24:31 +0000 (09:24 -0700)]
remove unused sfdcseekable

4 years agoMerge branch '571f1f84-a955-4e9b-9911-445f7435dc5a' into 'master'
Matthew Fernandez [Thu, 27 Aug 2020 14:44:09 +0000 (14:44 +0000)]
Merge branch '571f1f84-a955-4e9b-9911-445f7435dc5a' into 'master'

fix Pango plugin build on macOS

See merge request graphviz/graphviz!1533

4 years agoupdate CMake Cairo discovery to match PangoCairo
Matthew Fernandez [Sun, 23 Aug 2020 18:30:08 +0000 (11:30 -0700)]
update CMake Cairo discovery to match PangoCairo

This does the equivalent of the previous commit, to now use pkg-config to
discover Cairo on non-Windows platforms and to suppress the CMake warning:

  CMake Warning (dev) at ...FindPackageHandleStandardArgs.cmake:272 (message):
    The package name passed to `find_package_handle_standard_args` (CAIRO) does
    not match the name of the calling package (Cairo).  This can lead to
    problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindCairo.cmake:12 (find_package_handle_standard_args)
    CMakeLists.txt:81 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.

4 years agofix Pango plugin build on macOS
Matthew Fernandez [Wed, 19 Aug 2020 00:03:24 +0000 (17:03 -0700)]
fix Pango plugin build on macOS

Compiling plugin/pango depends on the discovery of PangoCairo and its dependent
libraries which is handled by cmake/FindPangoCairo.cmake. This file was assuming
all libraries were available at default system paths, which is not true on e.g.
macOS when you install libraries via Homebrew or Macports. We now simply ask
pkg-config to find all necessary information for us (unless we are on Windows).

This also incidentally cleans up the following warning issued by CMake in CI:

  CMake Warning (dev) at C:/…/FindPackageHandleStandardArgs.cmake:272 (message):
    The package name passed to `find_package_handle_standard_args` (PANGOCAIRO)
    does not match the name of the calling package (PangoCairo).  This can lead
    to problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindPangoCairo.cmake:20 (find_package_handle_standard_args)
    CMakeLists.txt:85 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.

4 years agoMerge branch 'fix-test-examples-exit-status-check' into 'master'
Magnus Jacobsson [Wed, 26 Aug 2020 14:53:06 +0000 (14:53 +0000)]
Merge branch 'fix-test-examples-exit-status-check' into 'master'

Fix test examples exit status check

See merge request graphviz/graphviz!1542

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

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

Closes #1770

See merge request graphviz/graphviz!1541

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

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

Fixed by using updated preinstalled NSIS with string length 8192.

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

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

Add ubuntu18-04-cmake-build

See merge request graphviz/graphviz!1539

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

Use updated winflexbison version 2.5.22

See merge request graphviz/graphviz!1538

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

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

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

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

Updates bison to version 3.5.0 and flex to version 2.6.4.

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

Execute test examples

See merge request graphviz/graphviz!1532

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

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

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

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

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

Add windows build PowerShell scripts and refactor CI

See merge request graphviz/graphviz!1529

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

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

See merge request graphviz/graphviz!1531

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

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

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

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

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

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

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

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

use a cleaner pattern for temporary directory management in tests

See merge request graphviz/graphviz!1537

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

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

This switches a pattern of:

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

to:

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

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

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

Fix windows artifacts directory platform name

Closes #1803

See merge request graphviz/graphviz!1536

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

fix macOS lexer compilation

See merge request graphviz/graphviz!1535

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

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

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

"Note

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

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

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

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

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

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

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

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

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

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

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

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

suppress two compiler warnings

See merge request graphviz/graphviz!1528

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

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

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

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

use a dynamic buffer in strdup_and_subst_obj0

See merge request graphviz/graphviz!1527

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

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

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

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

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

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

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

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

Fix test 1767 fails on agread on windows

Closes #1794

See merge request graphviz/graphviz!1524

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

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

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

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

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

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

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

Remove obsolete and incorrect mangling of yacc output

Closes #1796

See merge request graphviz/graphviz!1523

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

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

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

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

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

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

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

Make the Windows pipeline stop on PowerShell cmdlet failure

See merge request graphviz/graphviz!1526

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

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

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

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

Closes #1676

See merge request graphviz/graphviz!1509

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

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

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

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

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

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

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

fix segfault when passing a malformed newrank and node

Closes #1724

See merge request graphviz/graphviz!1508

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

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

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

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

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

Fix windows artifact archiving

Closes #1797

See merge request graphviz/graphviz!1525

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

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

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

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

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

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

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

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

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

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

misc cleanup

See merge request graphviz/graphviz!1504

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

These do little to nothing on modern compilers.

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

Suppresses 15 compilers warnings.

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

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

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

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

Squashes 11 warnings.

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