From 75315c537ab270597e086719579d471d5cf305ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Thu, 22 Aug 2024 14:41:17 +0200 Subject: [PATCH 1/4] run-tests.yaml: Fix fuzz step so the "save crashes" step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit is only executed on actual fuzz failures. Signed-off-by: Øyvind Rønningstad --- .github/workflows/run-tests.yaml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 01af41ea..8f4469f2 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -167,7 +167,7 @@ jobs: release-test-1: runs-on: ubuntu-22.04 - name: Release tests 1 - Fuzz + name: Release tests 1 - Check versions needs: - merge-test-1 - merge-test-1-win @@ -193,6 +193,21 @@ jobs: python3 -m unittest test_versions rm HEAD_REF + release-test-2: + runs-on: ubuntu-22.04 + name: Release tests 2 - Fuzz + needs: + - release-test-1 + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Read zcbor version + run: echo "ZCBOR_VERSION=$(cat zcbor/VERSION)" >> $GITHUB_ENV + + - name: Install zcbor + uses: ./.github/actions/install_zcbor + - name: Install packages run: | sudo apt update @@ -232,13 +247,13 @@ jobs: name: zcbor-release-$ZCBOR_VERSION path: dist/* - release-test-2: + release-test-3: runs-on: ubuntu-22.04 strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] asserts: ["", "-x VERBOSE=ON -x ASSERTS=ON"] - name: Release tests 2 (Python ${{ matrix.python-version }}${{ matrix.asserts != '' && ' with asserts' || '' }}) + name: Release tests 3 (Python ${{ matrix.python-version }}${{ matrix.asserts != '' && ' with asserts' || '' }}) needs: - merge-test-1 - merge-test-1-win @@ -268,13 +283,13 @@ jobs: zephyr_toolchain: zephyr zephyr_toolchain_arch: arm,mips - release-test-3: + release-test-4: runs-on: ubuntu-22.04 strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] asserts: ["", "-x VERBOSE=ON -x ASSERTS=ON"] - name: Release tests 3 (Python ${{ matrix.python-version }}${{ matrix.asserts != '' && ' with asserts' || '' }}) + name: Release tests 4 (Python ${{ matrix.python-version }}${{ matrix.asserts != '' && ' with asserts' || '' }}) needs: - merge-test-1 - merge-test-1-win From 642aaabc5af692c93871c6e766452fbc23bfeaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Thu, 22 Aug 2024 14:41:54 +0200 Subject: [PATCH 2/4] zcbor.py: Accept files without path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Rønningstad --- zcbor/zcbor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zcbor/zcbor.py b/zcbor/zcbor.py index 8e2a16a1..70e4a43a 100755 --- a/zcbor/zcbor.py +++ b/zcbor/zcbor.py @@ -2959,7 +2959,7 @@ def render(self, modes, h_files, c_files, type_file, include_prefix, cmake_file= h_name = Path(include_prefix, Path(h_files[mode].name).name) # Create and populate the generated c and h file. - makedirs(path.dirname(c_files[mode].name), exist_ok=True) + makedirs(path.dirname(Path(c_files[mode].name).absolute()), exist_ok=True) type_def_name = Path(include_prefix, Path(type_file.name).name) From 4c31d039c07e58d6db2f07f55d96f705d04fedc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Tue, 27 Aug 2024 09:14:55 +0200 Subject: [PATCH 3/4] zcbor.py: Fix generated comment so it passes Zephyr's checkpatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Rønningstad --- samples/pet/src/pet_decode.c | 3 ++- zcbor/zcbor.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/pet/src/pet_decode.c b/samples/pet/src/pet_decode.c index 7e26bb80..9d733e8a 100644 --- a/samples/pet/src/pet_decode.c +++ b/samples/pet/src/pet_decode.c @@ -46,7 +46,8 @@ static bool decode_Pet( if (false) { /* For testing that the types of the arguments are correct. - A compiler error here means a bug in zcbor. */ + * A compiler error here means a bug in zcbor. + */ zcbor_tstr_decode(state, (*&(*result).names)); } diff --git a/zcbor/zcbor.py b/zcbor/zcbor.py index 70e4a43a..ea649a01 100755 --- a/zcbor/zcbor.py +++ b/zcbor/zcbor.py @@ -2778,7 +2778,8 @@ def render_function(self, xcoder, mode): arg_test = f""" if (false) {{ /* For testing that the types of the arguments are correct. - A compiler error here means a bug in zcbor. */ + * A compiler error here means a bug in zcbor. + */ {calls} }} """ From 47f34dd7f5284e8750b5a715dee7f77c6c5bdc3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Wed, 8 May 2024 12:01:24 +0000 Subject: [PATCH 4/4] Update version to 0.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Rønningstad --- MIGRATION_GUIDE.md | 2 +- RELEASE_NOTES.md | 2 +- include/zcbor_common.h | 4 ++-- samples/pet/include/pet_decode.h | 2 +- samples/pet/include/pet_encode.h | 2 +- samples/pet/include/pet_types.h | 2 +- samples/pet/pet.cmake | 2 +- samples/pet/src/pet_decode.c | 2 +- samples/pet/src/pet_encode.c | 2 +- zcbor/VERSION | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index a2ec19a7..a6c58a3c 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -1,4 +1,4 @@ -# zcbor v. 0.8.99 +# zcbor v. 0.9.0 * `zcbor_simple_*()` functions have been removed to avoid confusion about their use. They are still in the C file because they are used by other functions. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0f5aeadb..a9e52ae0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,4 @@ -# zcbor v. 0.8.99 +# zcbor v. 0.9.0 (2024-08-27) Any new bugs, requests, or missing features should be reported as [Github issues](https://github.com/NordicSemiconductor/zcbor/issues). diff --git a/include/zcbor_common.h b/include/zcbor_common.h index 4a5c86bc..8bf43bde 100644 --- a/include/zcbor_common.h +++ b/include/zcbor_common.h @@ -21,8 +21,8 @@ extern "C" { #define ZCBOR_STRINGIFY(s) ZCBOR_STRINGIFY_PRE(s) #define ZCBOR_VERSION_MAJOR 0 -#define ZCBOR_VERSION_MINOR 8 -#define ZCBOR_VERSION_BUGFIX 99 +#define ZCBOR_VERSION_MINOR 9 +#define ZCBOR_VERSION_BUGFIX 0 /** The version string with dots and not prefix. */ #define ZCBOR_VERSION_STR ZCBOR_STRINGIFY(ZCBOR_VERSION_MAJOR) \ diff --git a/samples/pet/include/pet_decode.h b/samples/pet/include/pet_decode.h index bcd2fc95..476a8c33 100644 --- a/samples/pet/include/pet_decode.h +++ b/samples/pet/include/pet_decode.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 * - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ diff --git a/samples/pet/include/pet_encode.h b/samples/pet/include/pet_encode.h index 2ce3d0a1..ad5ffa5f 100644 --- a/samples/pet/include/pet_encode.h +++ b/samples/pet/include/pet_encode.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 * - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ diff --git a/samples/pet/include/pet_types.h b/samples/pet/include/pet_types.h index c2f58789..a8de23df 100644 --- a/samples/pet/include/pet_types.h +++ b/samples/pet/include/pet_types.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 * - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ diff --git a/samples/pet/pet.cmake b/samples/pet/pet.cmake index 2aa28dd6..fd203cab 100644 --- a/samples/pet/pet.cmake +++ b/samples/pet/pet.cmake @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# Generated using zcbor version 0.8.99 +# Generated using zcbor version 0.9.0 # https://github.com/NordicSemiconductor/zcbor # Generated with a --default-max-qty of 3 # diff --git a/samples/pet/src/pet_decode.c b/samples/pet/src/pet_decode.c index 9d733e8a..4adb9c37 100644 --- a/samples/pet/src/pet_decode.c +++ b/samples/pet/src/pet_decode.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 * - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ diff --git a/samples/pet/src/pet_encode.c b/samples/pet/src/pet_encode.c index 894ab883..2ba7463e 100644 --- a/samples/pet/src/pet_encode.c +++ b/samples/pet/src/pet_encode.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 * - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ diff --git a/zcbor/VERSION b/zcbor/VERSION index 750192ba..899f24fc 100644 --- a/zcbor/VERSION +++ b/zcbor/VERSION @@ -1 +1 @@ -0.8.99 \ No newline at end of file +0.9.0 \ No newline at end of file