From 17c5b950c882221982e89e06de5689e02e2f6fb4 Mon Sep 17 00:00:00 2001 From: m-holger Date: Mon, 10 Jul 2023 13:28:39 +0100 Subject: For 'FUTURE' builds add "+future" to version string Also, change so version to 0. --- CMakeLists.txt | 10 ++++++++-- include/qpdf/DLL.h | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31ee01ef..fb9d4b28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,8 +147,14 @@ endif() # increment SOVERSION every time we increment the project major # version. This works because qpdf uses semantic versioning. qpdf 10.x # was libqpdf28, so start from there. -math(EXPR qpdf_SOVERSION "${PROJECT_VERSION_MAJOR} + 18") -set(qpdf_LIBVERSION ${qpdf_SOVERSION}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) + +if(FUTURE) + math(EXPR qpdf_SOVERSION 0) + set(qpdf_LIBVERSION 0) +else() + math(EXPR qpdf_SOVERSION "${PROJECT_VERSION_MAJOR} + 18") + set(qpdf_LIBVERSION ${qpdf_SOVERSION}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) +endif() if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR " diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h index 6dd5137e..8279da03 100644 --- a/include/qpdf/DLL.h +++ b/include/qpdf/DLL.h @@ -27,7 +27,12 @@ #define QPDF_MAJOR_VERSION 11 #define QPDF_MINOR_VERSION 7 #define QPDF_PATCH_VERSION 0 -#define QPDF_VERSION "11.7.0" + +#ifdef QPDF_FUTURE +# define QPDF_VERSION "11.7.0+future" +#else +# define QPDF_VERSION "11.7.0" +#endif /* * This file defines symbols that control the which functions, -- cgit v1.2.3-54-g00ecf From 273eaf4682ba11c1c1fcfdcda31d0c95211599a2 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 16 Dec 2023 11:00:37 -0500 Subject: Remove hard-coded version from manual/conf.py --- CMakeLists.txt | 3 ++- build-scripts/build-doc | 2 +- make_dist | 22 ---------------------- manual/conf.py | 8 ++++++-- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb9d4b28..aafca4f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.16) # make_dist expects the version line to be on a line by itself after # the project line. When updating the version, check make_dist for all -# the places it has to be updated. +# the places it has to be updated. The doc configuration and CI build +# also find the version number here. project(qpdf VERSION 11.7.0 LANGUAGES C CXX) diff --git a/build-scripts/build-doc b/build-scripts/build-doc index e6c72757..7d45d4fa 100755 --- a/build-scripts/build-doc +++ b/build-scripts/build-doc @@ -10,7 +10,7 @@ pip3 install sphinx sphinx_rtd_theme cmake -S . -B build -DBUILD_DOC=1 cmake --build build --verbose --target doc_dist zip -r doc.zip build/manual/doc-dist -version=$(grep -E '^release' manual/conf.py | cut -d"'" -f 2) +version=$(grep -E '^ +VERSION [1-9]' CMakeLists.txt | awk '{print $2}') mv build/manual/doc-dist qpdf-${version}-doc mkdir distribution zip -r distribution/qpdf-${version}-doc-ci.zip qpdf-${version}-doc diff --git a/make_dist b/make_dist index acbf71e3..020852eb 100755 --- a/make_dist +++ b/make_dist @@ -59,7 +59,6 @@ cd($tmpdir); # Check versions my $cmakeversion = get_version_from_cmake(); my $code_version = get_version_from_source(); -my $doc_version = get_version_from_manual(); my $version_error = 0; if ($version ne $cmakeversion) @@ -72,11 +71,6 @@ if ($version ne $code_version) print "$whoami: QPDF.cc version = $code_version\n"; $version_error = 1; } -if ($version ne $doc_version) -{ - print "$whoami: doc version = $doc_version\n"; - $version_error = 1; -} if ($version_error) { die "$whoami: version numbers are not consistent\n"; @@ -157,22 +151,6 @@ sub get_version_from_source $code_version; } -sub get_version_from_manual -{ - my $fh = safe_open("manual/conf.py"); - my $doc_version = 'unknown'; - while (<$fh>) - { - if (m/release = '([^\']+)\'/) - { - $doc_version = $1; - last; - } - } - $fh->close(); - $doc_version; -} - sub safe_open { my $file = shift; diff --git a/manual/conf.py b/manual/conf.py index b95eb3c6..9d4eb5ec 100644 --- a/manual/conf.py +++ b/manual/conf.py @@ -15,8 +15,12 @@ sys.path.append(os.path.abspath("./_ext")) project = 'QPDF' copyright = '2005-2023, Jay Berkenbilt' author = 'Jay Berkenbilt' -# make_dist and the CI build lexically find the release version from this file. -release = '11.7.0' +here = os.path.dirname(os.path.realpath(__file__)) +with open(f'{here}/../CMakeLists.txt') as f: + for line in f.readlines(): + if line.strip().startswith('VERSION '): + release = line.replace('VERSION', '').strip() + break version = release extensions = [ 'sphinx_rtd_theme', -- cgit v1.2.3-54-g00ecf From db4ec7a9db7a0d87d459d7dc80f9a2afb4cbeadb Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 16 Dec 2023 11:04:41 -0500 Subject: Test qpdf + pikepdf with FUTURE --- .github/workflows/main.yml | 8 ++++++++ build-scripts/test-pikepdf | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03d6b929..7646a3d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -118,6 +118,14 @@ jobs: - uses: actions/checkout@v3 - name: 'pikepdf' run: build-scripts/test-pikepdf + pikepdf-future: + runs-on: ubuntu-latest + # Run after pikepdf to save concurrent runners + needs: pikepdf + steps: + - uses: actions/checkout@v3 + - name: 'qpdf + pikepdf with FUTURE' + run: build-scripts/test-pikepdf future Fuzzers: runs-on: ubuntu-latest needs: Prebuild diff --git a/build-scripts/test-pikepdf b/build-scripts/test-pikepdf index e6c8a9a4..cdab79cf 100755 --- a/build-scripts/test-pikepdf +++ b/build-scripts/test-pikepdf @@ -1,10 +1,20 @@ #!/bin/bash set -ex +cmake_extra= +future=0 +if [ "$1" = "future" ]; then + future=1 + cmake_extra=-DFUTURE=ON +fi sudo apt-get update sudo apt-get -y install \ build-essential cmake zlib1g-dev libjpeg-dev libgnutls28-dev -cmake -S . -B build -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake -S . -B build -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmake_extra cmake --build build --verbose -j$(nproc) --target libqpdf -- -k +if [ "$future" = "1" ]; then + # Run qpdf's test suite in FUTURE mode as well + ctest --verbose +fi export QPDF_SOURCE_TREE=$PWD export QPDF_BUILD_LIBDIR=$QPDF_SOURCE_TREE/build/libqpdf export LD_LIBRARY_PATH=$QPDF_BUILD_LIBDIR -- cgit v1.2.3-54-g00ecf From 762f232146f3edc234c898b48e9daacf72ee9577 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 16 Dec 2023 11:12:52 -0500 Subject: Add CI build for next C++ version --- .github/workflows/main.yml | 8 ++++++++ CMakeLists.txt | 7 ++++++- build-scripts/test-c++-next | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 build-scripts/test-c++-next diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7646a3d2..44f6b142 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,3 +147,11 @@ jobs: - uses: actions/checkout@v3 - name: 'Unsigned Char Tests' run: build-scripts/test-unsigned-char + CxxNext: + runs-on: ubuntu-latest + # Build after Fuzzers to save concurrent runners + needs: Fuzzers + steps: + - uses: actions/checkout@v3 + - name: 'Build with Next C++ standard' + run: build-scripts/test-c++-next diff --git a/CMakeLists.txt b/CMakeLists.txt index aafca4f8..707db439 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,7 @@ option(INSTALL_CMAKE_PACKAGE "Install cmake package files" ON) option(INSTALL_EXAMPLES "Install example files" ON) option(FUTURE "Include ABI-breaking changes CONSIDERED for the next major release" OFF) +option(CXX_NEXT "Build with next C++ standard version" OFF) # *** END OPTIONS *** @@ -166,7 +167,11 @@ Please build with cmake in a subdirectory, e.g. Please remove CMakeCache.txt and the CMakeFiles directories.") endif() -set(CMAKE_CXX_STANDARD 17) +if(CXX_NEXT) + set(CMAKE_CXX_STANDARD 20) +else() + set(CMAKE_CXX_STANDARD 17) +endif() set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_VISIBILITY_PRESET hidden) diff --git a/build-scripts/test-c++-next b/build-scripts/test-c++-next new file mode 100755 index 00000000..343a5a4d --- /dev/null +++ b/build-scripts/test-c++-next @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +sudo apt-get update +sudo apt-get -y install \ + build-essential cmake \ + zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev +cmake -S . -B build \ + -DCXX_NEXT=ON \ + -DCI_MODE=1 -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=Release \ + -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 \ + -DENABLE_QTC=1 +cmake --build build --verbose -j$(nproc) -- -k +cd build +ctest --verbose -- cgit v1.2.3-54-g00ecf