From 096f09671a57fdcab1250b6627dfdfa1153bd5ae Mon Sep 17 00:00:00 2001 From: Stephane Janel Date: Fri, 27 Oct 2023 10:13:34 +0200 Subject: [PATCH 1/5] Fix gcc 12 compiling error --- include/jwt-cpp/base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h index 8e6fc311..189525e8 100644 --- a/include/jwt-cpp/base.h +++ b/include/jwt-cpp/base.h @@ -82,8 +82,8 @@ namespace jwt { 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'}}; return data; } - static const std::initializer_list& fill() { - static std::initializer_list fill{"%3D", "%3d"}; + static const std::array& fill() { + static const std::array fill{"%3D", "%3d"}; return fill; } }; From 6247c12b17a897e9e992812476a29dab57ead9a5 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 25 Nov 2023 21:35:10 -0800 Subject: [PATCH 2/5] add test for gcc-12 --- .github/workflows/targets.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml index 01028d76..566d243d 100644 --- a/.github/workflows/targets.yml +++ b/.github/workflows/targets.yml @@ -43,3 +43,32 @@ jobs: run: | CC=gcc-4.8 CXX=g++-4.8 cmake . -DTEST:STRING="defaults-enabled" cmake --build . + + gcc-12: + runs-on: ubuntu-22.04 + env: + CC: /usr/bin/gcc-12 + CXX: /usr/bin/g++-12 + steps: + - run: | + apt-get update + apt-get install -y g++-12 wget make libssl-dev + - uses: actions/checkout@v3 + - uses: ./.github/actions/install/cmake + with: + version: "3.26.3" + url: "https://cmake.org/files/v3.26/cmake-3.26.3.tar.gz" + - uses: ./.github/actions/install/gtest + + - name: setup + run: | + mkdir build + cd build + cmake .. + cmake --install . + + - name: test + working-directory: tests/cmake + run: | + CC=gcc-12 CXX=g++-12 cmake . -DTEST:STRING="defaults-enabled" + cmake --build . From 4b887bb9e6abae8bc80dd1752a803c26497eee20 Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 25 Nov 2023 21:59:41 -0800 Subject: [PATCH 3/5] replace array with vector this is to avoid breaking the API down the line --- include/jwt-cpp/base.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h index 189525e8..fd3ee281 100644 --- a/include/jwt-cpp/base.h +++ b/include/jwt-cpp/base.h @@ -39,7 +39,7 @@ namespace jwt { return data; } static const std::string& fill() { - static std::string fill{"="}; + static const std::string fill{"="}; return fill; } }; @@ -62,7 +62,7 @@ namespace jwt { return data; } static const std::string& fill() { - static std::string fill{"%3d"}; + static const std::string fill{"%3d"}; return fill; } }; @@ -82,8 +82,8 @@ namespace jwt { 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'}}; return data; } - static const std::array& fill() { - static const std::array fill{"%3D", "%3d"}; + static const std::vector& fill() { + static const std::vector fill{"%3D", "%3d"}; return fill; } }; From d55e1c23d11910c77878abeb9d5509c4f371acee Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 25 Nov 2023 22:05:02 -0800 Subject: [PATCH 4/5] pin down ubuntu base images these do get updated with with under active development and there are changes which could affect us --- .github/workflows/targets.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml index 566d243d..b4332bb3 100644 --- a/.github/workflows/targets.yml +++ b/.github/workflows/targets.yml @@ -18,7 +18,7 @@ jobs: name: GCC 4.8 runs-on: ubuntu-latest container: - image: ubuntu:18.04 + image: ubuntu:bionic-20230530 # 18.04 env: CC: /usr/bin/gcc-4.8 CXX: /usr/bin/g++-4.8 @@ -45,7 +45,9 @@ jobs: cmake --build . gcc-12: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + container: + image: ubuntu:jammy-20231004 # 22.04 env: CC: /usr/bin/gcc-12 CXX: /usr/bin/g++-12 From 336d9c1592de36fa78ebc2ceca59ab746e3da0cf Mon Sep 17 00:00:00 2001 From: Chris Mc Date: Sat, 25 Nov 2023 22:18:19 -0800 Subject: [PATCH 5/5] skip gtest + set cxx_std to 20 --- .github/workflows/targets.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml index b4332bb3..b30e2a81 100644 --- a/.github/workflows/targets.yml +++ b/.github/workflows/targets.yml @@ -60,7 +60,6 @@ jobs: with: version: "3.26.3" url: "https://cmake.org/files/v3.26/cmake-3.26.3.tar.gz" - - uses: ./.github/actions/install/gtest - name: setup run: | @@ -72,5 +71,5 @@ jobs: - name: test working-directory: tests/cmake run: | - CC=gcc-12 CXX=g++-12 cmake . -DTEST:STRING="defaults-enabled" + CC=gcc-12 CXX=g++-12 cmake . -DCMAKE_CXX_STANDARD=20 -DTEST:STRING="defaults-enabled" cmake --build .