]> granicus.if.org Git - graphviz/commitdiff
fix: write Graphviz build version to GRAPHVIZ_VERSION file instead of VERSION
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 8 Sep 2021 03:53:51 +0000 (20:53 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 8 Sep 2021 14:22:00 +0000 (07:22 -0700)
C++20 standardizes a new `version` header.¹ A side effect of this is that
Autotools-driven Graphviz compilation fails when using both (1) a C++20-capable
compiler and (2) a case-insensitive file system:

  Making all in vpsc
  CXX      block.lo
  In file included from block.cpp:20:
  In file included from …/include/c++/v1/memory:667:
  In file included from …/include/c++/v1/type_traits:417:
  In file included from …/include/c++/v1/cstddef:37:
  ../../version:1:1: error: expected unqualified-id
  2.49.1~dev.20210907.1517
  ^

The core problem is that the root of the repository checkout (or unpacked
tarball) is in the compiler’s include path in order to allow including
`config.h`. But the generated `VERSION` file is also in this same directory.
Nothing in Graphviz attempts to include the C++20 `version` header, but some of
the other stdlib headers transitively include `version`.

To avoid this confusion, we rename Graphviz’ generated file.

Fixes #2122.

¹ https://en.cppreference.com/w/cpp/header/version

.gitignore
.gitlab-ci.yml
CHANGELOG.md
Makefile.am
ci/build.sh
ci/deploy.py
ci/install-packages.sh
ci/out-of-source-build.sh

index 635d62dd0e59cc54a9a09a2cbb3051652e3f21df..c7291a7d2a71d1c026303faee78129aa7cc49fc7 100644 (file)
@@ -7,7 +7,7 @@ CMakeCache.txt
 
 # product of: make dist
 /graphviz-*.tar.gz
-/VERSION
+/GRAPHVIZ_VERSION
 /COLLECTION
 
 cmd/gvedit/moc_csettings.cpp
index b4f506dcb105a9d17f2be16e076bc9d6aaffdd22..d38382d004e9322d76cb93ca40cbb309ce00e4db 100644 (file)
@@ -28,7 +28,7 @@ portable-source:
         when: on_success
         expire_in: 1 week
         paths:
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
             - graphviz-*.tar.gz
             - graphviz-*.tar.xz
@@ -50,7 +50,7 @@ portable-source:
             - Packages/*/*/*/*/*/*.rpm
             - Packages/*/*/*/*/*.rpm
             - Metadata/*/*/*/configure.log
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
         reports:
             metrics: metrics.txt
@@ -73,7 +73,7 @@ portable-source:
             - Packages/*/*/*/*/*/*deb
             - Packages/*/*/*/*/*.gz
             - Metadata/*/*/*/configure.log
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
         reports:
             metrics: metrics.txt
@@ -92,7 +92,7 @@ portable-source:
         - brew install pango || brew upgrade pango
         - brew install libxaw || brew upgrade libxaw
         - export PATH="/usr/local/opt/bison/bin:$PATH"
-        - python3 gen_version.py > VERSION # FIXME: remove when building from portable source
+        - python3 gen_version.py > GRAPHVIZ_VERSION # FIXME: remove when building from portable source
         - echo experimental > COLLECTION
         - logfile=`mktemp`
         - ci/build.sh 2>&1 | tee $logfile
@@ -103,7 +103,7 @@ portable-source:
         when: on_success
         expire_in: 1 week
         paths:
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
             - Packages/*/*/*/*/*/*.zip
             - Packages/*/*/*/*/*/*.tar.gz
@@ -153,10 +153,10 @@ portable-source:
         - echo "$CI_JOB_NAME-warnings $warnings_count" > metrics.txt
         - rm $logfile
         - cat metrics.txt
-        - python gen_version.py > VERSION
+        - python gen_version.py > GRAPHVIZ_VERSION
         - python gen_version.py --collection > COLLECTION
         # Package
-        - $Env:GV_VERSION=$( cat VERSION )
+        - $Env:GV_VERSION=$( cat GRAPHVIZ_VERSION )
         - >-
             if($Env:project_platform -eq "x64") {
                 $API = "win64";
@@ -224,7 +224,7 @@ portable-source:
     stage: test
     script:
         - ci/install-packages.sh
-        - export GV_VERSION=$( cat VERSION )
+        - export GV_VERSION=$( cat GRAPHVIZ_VERSION )
         - export OS_ID=$( cat OS_ID )
         - python3 -m pytest --verbose --junitxml=report.xml ci/tests.py tests rtest
     artifacts:
@@ -236,7 +236,7 @@ portable-source:
 .test_template_including_ctest: &test_definition_including_ctest
     stage: test
     script:
-        - export GV_VERSION=$( cat VERSION )
+        - export GV_VERSION=$( cat GRAPHVIZ_VERSION )
         - export OS_ID=$( cat OS_ID )
         - ci/test_coverage.py --init
         - pushd build
@@ -641,7 +641,7 @@ windows-mingw32-cmake-build:
         when: always
         expire_in: 1 week
         paths:
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
             - Packages/*/*/*/*/*/*.exe
             - Packages/*/*/*/*/*/*.zip
@@ -662,7 +662,7 @@ windows-mingw64-cmake-build:
         when: always
         expire_in: 1 week
         paths:
-            - VERSION
+            - GRAPHVIZ_VERSION
             - COLLECTION
             - Packages/*/*/*/*/*/*.exe
             - Packages/*/*/*/*/*/*.zip
@@ -808,7 +808,7 @@ ubuntu18-04-cmake-test:
     <<: *linux_test_definition
     before_script:
         - export build_system="cmake"
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
     needs:
         - job: "ubuntu18-04-cmake-build"
@@ -822,7 +822,7 @@ ubuntu20-10-cmake-test:
     <<: *linux_test_definition
     before_script:
         - export build_system="cmake"
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
     needs:
         - job: "ubuntu20-10-cmake-build"
@@ -842,7 +842,7 @@ ubuntu20-10-cmake-ASan-test:
         # FIXME: remove the following when Graphviz can pass the test suite
         # leak-free
         - export ASAN_OPTIONS=detect_leaks=0
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
     needs:
         - job: "ubuntu20-10-cmake-ASan-build"
@@ -856,7 +856,7 @@ ubuntu21-04-cmake-test:
     <<: *linux_test_definition
     before_script:
         - export build_system="cmake"
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
     needs:
         - job: "ubuntu21-04-cmake-build"
@@ -873,7 +873,7 @@ ubuntu21.04-cmake-ASan-test-including-ctest:
         - export CFLAGS=" -g -fsanitize=address,undefined"
         - export CXXFLAGS=" -g -fsanitize=address,undefined"
         - export LDFLAGS=" -g -fsanitize=address,undefined"
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
     needs:
         - job: "ubuntu21-04-cmake-ASan-build-for-ctest"
@@ -887,7 +887,7 @@ centos7-cmake-test:
     <<: *linux_test_definition
     before_script:
         - export build_system="cmake"
-        - python3 gen_version.py > VERSION
+        - python3 gen_version.py > GRAPHVIZ_VERSION
         - echo experimental > COLLECTION
         # Graphviz libs are installed in /usr/lib, but Centos 7 doesn't look there by default
         - export LD_LIBRARY_PATH=/usr/lib
index 0de30c34ac7c04d497139a47a189fa6c10a55233..48c0ad7d722e683a091a786177e4f77cb7040e02 100644 (file)
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - 2.48.0: test suite is failing #2112
 - Ensure correct file-level dependency for generated file in cmake generated
   projects #2119
+- compile failures with a C++20-compatible toolchain #2122
 
 ## [2.49.0] – 2021-08-28
 
index 536961693348cea8dba13d1ed6f666b5c42e8bdf..46c78c23c8470f35fe161d9b5f406c42f42e95b1 100644 (file)
@@ -25,7 +25,7 @@ doxygen:
        doxygen
 
 dist-hook:
-       echo "@VERSION@" >VERSION
+       echo "@VERSION@" >GRAPHVIZ_VERSION
        echo "@GRAPHVIZ_COLLECTION@" >COLLECTION
 
 BUILT_SOURCES = $(top_builddir)/graphviz_version.h
index 10d4f68222fe3145048643d3267ed677fc581bb7..2c936187f2b147b90992fa9645c266a407b6bf9f 100755 (executable)
@@ -48,7 +48,7 @@ if [ "${build_system}" = "cmake" ]; then
         exit 1
     fi
 else
-    GV_VERSION=$( cat VERSION )
+    GV_VERSION=$( cat GRAPHVIZ_VERSION )
     if [ "$OSTYPE" = "linux-gnu" ]; then
         if [ "${ID_LIKE:-}" = "debian" ]; then
             tar xfz graphviz-${GV_VERSION}.tar.gz
index e526be1bfa224a61bf06f3d861757a1c9ee03ffa..d501a7a4cd7904c0b331175fde60c4894ffc028e 100644 (file)
@@ -101,8 +101,8 @@ def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring
   # parse command line arguments
   parser = argparse.ArgumentParser(description="Graphviz deployment script")
   parser.add_argument("--version", help="Override version number used to "
-    "create a release. Without this, the contents of the VERSION file will be "
-    "used.")
+    "create a release. Without this, the contents of the GRAPHVIZ_VERSION file "
+    "will be used.")
   parser.add_argument("--force", action="store_true", help="Force creating a "
     "Gitlab release, even if the version number does not match \\d+.\\d+.\\d+.")
   parser.add_argument("--verbose", action="store_true", help="Print more "
@@ -131,12 +131,13 @@ def main(args: List[str]) -> int: # pylint: disable=missing-function-docstring
     return -1
 
   # retrieve version name left by prior CI tasks
-  log.info("reading VERSION")
-  with open("VERSION") as f:
+  log.info("reading GRAPHVIZ_VERSION")
+  with open("GRAPHVIZ_VERSION") as f:
     gv_version = f.read().strip()
-  log.info(f"VERSION == {gv_version}")
+  log.info(f"GRAPHVIZ_VERSION == {gv_version}")
 
-  # if we were not passed an explicit version, use the one from the VERSION file
+  # if we were not passed an explicit version, use the one from the
+  # GRAPHVIZ_VERSION file
   if options.version is None:
     options.version = gv_version
 
index 80bffc086b5a588e1a85e04d7b83b81100f41d4e..ee085eb66d18276cf3d0282c7408f657164da54c 100755 (executable)
@@ -19,7 +19,7 @@ else
     VERSION_ID=$( cat /etc/redhat-release | cut -d' ' -f3  | cut -d'.' -f1 )
 fi
 printf '%s\n' "${ID}" >OS_ID
-GV_VERSION=$( cat VERSION )
+GV_VERSION=$( cat GRAPHVIZ_VERSION )
 COLLECTION=$( cat COLLECTION )
 DIR=Packages/${COLLECTION}/${ID}/${VERSION_ID}
 ARCH=$( uname -m )
index 8ab01ded72732f4ff0d4931c1228b464d6896a9d..2f9f3f26e8bb431c3b18d5ff21df305194b4caf1 100755 (executable)
@@ -11,7 +11,7 @@ set -o pipefail
 uname -rms
 cat /etc/os-release
 
-GV_VERSION=$(cat VERSION)
+GV_VERSION=$(cat GRAPHVIZ_VERSION)
 
 # unpack the portable source tarball
 tar xfz graphviz-${GV_VERSION}.tar.gz