Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0.11.0 #4

Merged
merged 83 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4d805e7
Add Cirrus-CI config file to build & test on FreeBSD
emaste Sep 17, 2021
8fba9a6
Merge pull request #279 from emaste/freebsd-ci
PJK Apr 21, 2023
be34160
make CMAKE_SKIP_INSTALL_ALL_DEPENDENCY an option
akallabeth May 5, 2023
23ecd08
Merge pull request #280 from akallabeth/CMAKE_SKIP_INSTALL_ALL_DEPEND…
PJK May 6, 2023
15193f1
Print CBOR_TYPE_BYTESTRING value as hex string
akallabeth May 9, 2023
6fe75f5
Bump requests from 2.27.1 to 2.31.0 in /doc/source
dependabot[bot] May 23, 2023
0beff25
Merge pull request #282 from PJK/dependabot/pip/doc/source/requests-2…
PJK May 24, 2023
190bd86
Bump tornado from 6.1 to 6.3.2 in /doc/source
dependabot[bot] May 25, 2023
8c0ebb1
Barebones cbor_describe test
PJK May 30, 2023
63a7084
Finish cbor_describe test and fix a few minor issues
PJK Jun 2, 2023
574ce31
Fix test helper memory leak
PJK Jun 3, 2023
1550555
Merge pull request #284 from PJK/describetest
PJK Jun 3, 2023
219c2e7
Merge pull request #281 from akallabeth/bytestring_pretty_print
PJK Jun 3, 2023
8340b01
Update cbor_describe after #281
PJK Jun 3, 2023
2e729fd
Improve string handling in cbor_describe
PJK Jun 3, 2023
9730caa
Improve cbor_describe consistency and simplify tests
PJK Jun 3, 2023
aa82657
Update changelog for describe changes
PJK Jun 3, 2023
e8d7c57
Do _cbor_unicode_codepoint_count in size_t for uniformity
PJK Jun 3, 2023
9ac3066
Merge pull request #285 from PJK/describetest2
PJK Jun 3, 2023
2eafc76
Count codepoints in cbor_string_set_handle
PJK Jun 3, 2023
bedece2
Merge branch 'master' into codepoint-fixes
PJK Jun 3, 2023
74c07b9
Update cbor_string_set_handle tests
PJK Jun 3, 2023
ad6cda1
Update string manipulation routines docs
PJK Jun 3, 2023
22d96ef
Don't fail string parsing on invalid UTF-8
PJK Jun 3, 2023
643e6fe
Fix use of unitialized memory in string test
PJK Jun 3, 2023
d9f60b3
Add changelog entry
PJK Jun 3, 2023
5fe9656
Merge pull request #286 from PJK/codepoint-fixes
PJK Jun 3, 2023
859fe37
Improve float tests
PJK Jun 3, 2023
69863dc
Add a test for 4B header serialization
PJK Jun 3, 2023
6de0299
Give up on assert_double_equal
PJK Jun 3, 2023
994e772
Simplify _cbor_map_add_value handling
PJK Jun 3, 2023
75b3ec0
Guard long header tests based on size_t size
PJK Jun 3, 2023
3cde039
Add a test for invalid nested stack state
PJK Jun 3, 2023
6378e80
Fix misused CBOR_ASSERT
PJK Jun 3, 2023
e4b13b1
Fix unitialized read in test_serialize_definite_string_8b_header
PJK Jun 3, 2023
13fb338
Debug long on 32b ci
PJK Jun 3, 2023
ae5210c
Clean up debug code
PJK Jun 3, 2023
d2ac21a
Merge pull request #287 from PJK/testtweaks
PJK Jun 3, 2023
9b1b5a1
Merge pull request #283 from PJK/dependabot/pip/doc/source/tornado-6.3.2
PJK Jun 5, 2023
7c058e3
add cmake package files
akallabeth Jul 12, 2023
37c3db2
add option for BUILD_SHARED_LIBS
akallabeth Jul 12, 2023
93c5231
fixed -Wreturn-type warnings
akallabeth Jul 12, 2023
d00a63e
CMakeLists.txt: install configuration.h following CMAKE_INSTALL_INCLU…
trofi Oct 9, 2023
1158563
Update Circle ubuntu version
PJK Oct 11, 2023
3524b56
Try no service restart
PJK Oct 11, 2023
4d451cf
Disable restarts everywhere
PJK Oct 11, 2023
b953da6
Disable even more restarts
PJK Oct 11, 2023
49cb0bc
Merge pull request #298 from PJK/fix-build
PJK Oct 11, 2023
c15e21c
Merge branch 'master' into configuration.h-includes
PJK Oct 11, 2023
da2710f
Debug fuzzer build
PJK Oct 11, 2023
4eb1c63
More debug attempts
PJK Oct 11, 2023
3fad182
Bump urllib3 from 1.26.9 to 1.26.18 in /doc/source
dependabot[bot] Oct 18, 2023
8c923de
Merge pull request #299 from PJK/dependabot/pip/doc/source/urllib3-1.…
PJK Nov 18, 2023
9cebaab
Configure gnu paths before moving config.h around
PJK Nov 18, 2023
cc449a4
Merge pull request #297 from trofi/configuration.h-includes
PJK Nov 18, 2023
fdfb241
Fix missing (void) in tests
PJK Nov 18, 2023
540fec0
Update docs dependencies
PJK Nov 18, 2023
d1a7894
Add rtd config file per https://blog.readthedocs.com/migrate-configur…
PJK Nov 18, 2023
5bd63c2
Merge pull request #300 from PJK/warnings
PJK Nov 18, 2023
c95b7f0
Manually resolve docutils version conflict
PJK Nov 18, 2023
adea889
Fix requirements path
PJK Nov 18, 2023
46da300
Fix requirements path, take 2
PJK Nov 18, 2023
4e5d27c
Merge pull request #301 from PJK/pipupgrade
PJK Nov 18, 2023
de6bbf7
Fix sphinx format warning
PJK Nov 18, 2023
5cbd2b9
Merge pull request #302 from PJK/docs
PJK Nov 18, 2023
793c195
Always use RTD theme
PJK Nov 20, 2023
aa76330
Merge pull request #303 from PJK/docs
PJK Nov 20, 2023
8bb8ae1
Merge branch 'master' into cmake_find_package
PJK Nov 24, 2023
cc44a9d
Revert changes to switches; sane compilers should be able to verify e…
PJK Nov 24, 2023
34667f6
Merge pull request #290 from akallabeth/cmake_find_package
PJK Nov 25, 2023
9d4b2b0
CI: Add FreeBSD 14.0 and drop FreeBSD 12.4
emaste Dec 12, 2023
648badb
Try adding BSD images based on the family
PJK Dec 12, 2023
6717ae3
Merge pull request #304 from emaste/master
PJK Dec 12, 2023
4b422b1
typos
spaette Dec 27, 2023
5c72221
Merge pull request #305 from vaerksted/master
PJK Jan 6, 2024
ee2d304
Support decoding all tag values
PJK Feb 3, 2024
a9c4bfe
Fix stream decoder test
PJK Feb 3, 2024
70de718
Add a changelog entry
PJK Feb 3, 2024
1647bce
Fix tag test memory leak
PJK Feb 3, 2024
1e4f669
Merge pull request #308 from PJK/tags
PJK Feb 3, 2024
170bee2
Release v0.11.0
PJK Feb 3, 2024
ea9f478
merge v0.11.0
tgauth Sep 20, 2024
2c477a9
update version is cgmanifest
tgauth Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ commands:
linux-setup:
steps:
- run: sudo apt-get update
- run: sudo apt-get install -y cmake ${TOOLCHAIN_PACKAGES}
- run: sudo apt install libcmocka-dev libcjson-dev
# NEEDRESTART_MODE prevents automatic restarts which seem to hang.
- run: sudo NEEDRESTART_MODE=l apt-get install -y cmake ${TOOLCHAIN_PACKAGES}
- run: sudo NEEDRESTART_MODE=l apt-get install -y libcmocka-dev libcjson-dev
build:
steps:
- run: >
Expand All @@ -32,14 +33,14 @@ orbs:

jobs:
static-test:
machine:
image: ubuntu-2204:2022.10.2
machine: &default-machine
image: ubuntu-2204:2023.07.2
environment:
TOOLCHAIN_PACKAGES: g++
steps:
- checkout
- linux-setup
- run: sudo apt-get install -y clang-format doxygen cppcheck
- run: sudo NEEDRESTART_MODE=l apt-get install -y clang-format doxygen cppcheck
- run: cppcheck --inline-suppr --error-exitcode=1 .
- run: bash clang-format.sh --verbose
- run: >
Expand All @@ -61,14 +62,14 @@ jobs:

build-and-test:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
environment:
TOOLCHAIN_PACKAGES: g++
CMAKE_COVERAGE: ON
steps:
- checkout
- linux-setup
- run: sudo apt-get install -y valgrind
- run: sudo NEEDRESTART_MODE=l apt-get install -y valgrind
- build
- test
- run: ctest -T Coverage
Expand All @@ -82,7 +83,7 @@ jobs:

build-and-test-clang:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
environment:
TOOLCHAIN_PACKAGES: clang
CC: clang
Expand All @@ -95,11 +96,11 @@ jobs:

build-and-test-32b:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
steps:
- checkout
- run: sudo apt-get update
- run: sudo apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386
- run: sudo NEEDRESTART_MODE=l apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386
# Make cmocka from source w/ 32b setup
- run: git clone https://git.cryptomilk.org/projects/cmocka.git ~/cmocka
- run: >
Expand All @@ -118,7 +119,7 @@ jobs:

build-and-test-release-clang:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
environment:
TOOLCHAIN_PACKAGES: clang
CC: clang
Expand All @@ -131,7 +132,7 @@ jobs:

llvm-coverage:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
environment:
TOOLCHAIN_PACKAGES: clang
CC: clang
Expand All @@ -146,7 +147,7 @@ jobs:

build-and-test-arm:
machine:
image: ubuntu-2204:2022.10.2
<<: *default-machine
environment:
TOOLCHAIN_PACKAGES: g++
resource_class: arm.medium
Expand All @@ -158,7 +159,7 @@ jobs:

build-bazel:
machine:
image: ubuntu-2204:2022.10.2
image: ubuntu-2204:2023.07.2
environment:
TOOLCHAIN_PACKAGES: g++
steps:
Expand Down
26 changes: 26 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
freebsd_task:
install_script:
- ASSUME_ALWAYS_YES=yes pkg bootstrap -f && pkg install -y cmocka cmake ninja
build_script:
- mkdir build
- cd build
- cmake -GNinja -DWITH_TESTS=ON
-DCBOR_CUSTOM_ALLOC=ON
-DCMAKE_BUILD_TYPE=Debug
-DSANITIZE=OFF
..
- ninja -j $(sysctl -n hw.ncpu)
test_script:
- cd build
- ctest -VV
matrix:
# From gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images
- name: freebsd-13-2
freebsd_instance:
image_family: freebsd-13-2
- name: freebsd-14-0
freebsd_instance:
image_family: freebsd-14-0
- name: freebsd-15-0-snap
freebsd_instance:
image_family: freebsd-15-0-snap
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: doc/source/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/source/requirements.txt
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ Template:

Next
---------------------

0.11.0 (2024-02-04)
---------------------
- [Updated documentation to refer to RFC 8949](https://github.com/PJK/libcbor/issues/269)
- Improvements to `cbor_describe`
- [Bytestring data will now be printed as well](https://github.com/PJK/libcbor/pull/281) by [akallabeth](https://github.com/akallabeth)
- [Formatting consistency and clarity improvements](https://github.com/PJK/libcbor/pull/285)
- [Fix `cbor_string_set_handle` not setting the codepoint count](https://github.com/PJK/libcbor/pull/286)
- BREAKING: [`cbor_load` will no longer fail on input strings that are well-formed but not valid UTF-8](https://github.com/PJK/libcbor/pull/286)
- If you were relying on the validation, please check the result using `cbor_string_codepoint_count` instead
- BREAKING: [All decoders like `cbor_load` and `cbor_stream_decode` will accept all well-formed tag values](https://github.com/PJK/libcbor/pull/308) (bug discovered by [dskern-github](https://github.com/dskern-github))
- Previously, decoding of certain values would fail with `CBOR_ERR_MALFORMATED` or `CBOR_DECODER_ERROR`
- This also makes decoding symmetrical with serialization, which already accepts all values

0.10.2 (2023-01-31)
---------------------
Expand Down Expand Up @@ -118,7 +130,7 @@ Next
Breaks build & header compatibility due to:

- Improved build configuration and feature check macros
- Endianess configuration fixes (by Erwin Kroon and David Grigsby)
- Endianness configuration fixes (by Erwin Kroon and David Grigsby)
- pkg-config compatibility (by Vincent Bernat)
- enable use of versioned SONAME (by Vincent Bernat)
- better fuzzer (wasn't random until now, ooops)
Expand Down
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 3.0)

project(libcbor)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/")
include(CTest)
include(GNUInstallDirs) # Provides CMAKE_INSTALL_ variables

SET(CBOR_VERSION_MAJOR "0")
SET(CBOR_VERSION_MINOR "10")
SET(CBOR_VERSION_PATCH "2")
SET(CBOR_VERSION_MINOR "11")
SET(CBOR_VERSION_PATCH "0")
SET(CBOR_VERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH})

set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
option(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "cmake --build --target install does not depend on cmake --build" true)
option(BUILD_SHARED_LIBS "Build as a shared library" false)

include(CheckIncludeFiles)

include(TestBigEndian)
Expand All @@ -19,10 +23,10 @@ endif()

option(CBOR_CUSTOM_ALLOC "Custom, dynamically defined allocator support" OFF)
if(CBOR_CUSTOM_ALLOC)
message(WARNING
message(WARNING
"CBOR_CUSTOM_ALLOC has been deprecated. Custom allocators are now enabled by default."
"The flag is a no-op and will be removed in the next version. "
"Please remove CBOR_CUSTOM_ALLOC from your build configuation.")
"Please remove CBOR_CUSTOM_ALLOC from your build configuration.")
endif(CBOR_CUSTOM_ALLOC)

option(CBOR_PRETTY_PRINTER "Include a pretty-printing routine" ON)
Expand Down Expand Up @@ -142,9 +146,8 @@ add_compile_options(/Qspectre) # add Spectre mitigation compiler option. (https:

# We want to generate configuration.h from the template and make it so that it is accessible using the same
# path during both library build and installed header use, without littering the source dir.
# Using cbor/configuration.h in the build dir works b/c headers will be installed to <prefix>/cbor
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/cbor/configuration.h.in ${PROJECT_BINARY_DIR}/cbor/configuration.h)
install(FILES ${PROJECT_BINARY_DIR}/cbor/configuration.h DESTINATION include/cbor)
install(FILES ${PROJECT_BINARY_DIR}/cbor/configuration.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cbor)
# Make the header visible at compile time
include_directories(${PROJECT_BINARY_DIR})

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

libcbor is maintained by [@PJK](https://github.com/PJK) in his spare time on a best-effort basis.

Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described belows.
Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described below.

## Principles

Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = libcbor
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.10.2
PROJECT_NUMBER = 0.11.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Type": "other",
"Other": {
"Name": "libcbor",
"Version": "0.10.1",
"Version": "0.11.0",
"DownloadUrl": "https://github.com/PJK/libcbor"
}
},
Expand Down
18 changes: 5 additions & 13 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
'breathe',
'sphinx.ext.mathjax',
'sphinx.ext.autodoc',
'sphinx.ext.ifconfig'
'sphinx.ext.ifconfig',
'sphinx_rtd_theme'
]

import subprocess, os
Expand Down Expand Up @@ -76,8 +77,8 @@
# built documents.
#
# The short X.Y version.
version = '0.10'
release = '0.10.2'
version = '0.11'
release = '0.11.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -127,7 +128,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -285,12 +286,3 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False


if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# otherwise, readthedocs.org uses their theme by default, so no need to specify it

2 changes: 1 addition & 1 deletion doc/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Goals
~~~~~~~~~~~~~~~~~~~~~~

Standard conformance and full feature support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Anything the standard allows, libcbor can do.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ and also borrowing from

General notes on the API design
--------------------------------
The API design has two main driving priciples:
The API design has two main driving principles:

1. Let the client manage the memory as much as possible
2. Behave exactly as specified by the standard
Expand Down
52 changes: 26 additions & 26 deletions doc/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
alabaster==0.7.12
Babel==2.9.1
breathe==4.33.1
certifi==2022.12.7
charset-normalizer==2.0.12
colorama==0.4.4
docutils==0.17.1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.3
Jinja2==3.0.3
alabaster==0.7.13
Babel==2.13.1
breathe==4.35.0
certifi==2023.11.17
charset-normalizer==3.3.2
colorama==0.4.6
docutils==0.18.1
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
Jinja2==3.1.2
livereload==2.6.3
MarkupSafe==2.1.1
packaging==21.3
Pygments==2.11.2
pyparsing==3.0.7
MarkupSafe==2.1.3
packaging==23.2
Pygments==2.16.1
pyparsing==3.1.1
pytz==2021.3
requests==2.27.1
requests==2.31.0
snowballstemmer==2.2.0
Sphinx==4.4.0
Sphinx==7.2.6
sphinx-autobuild==2021.3.14
sphinx-rtd-theme==1.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tornado==6.1
urllib3==1.26.9
zipp==3.7.0
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
tornado==6.3.3
urllib3==2.1.0
zipp==3.17.0
4 changes: 2 additions & 2 deletions examples/bazel/third_party/libcbor/cbor/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define LIBCBOR_CONFIGURATION_H

#define CBOR_MAJOR_VERSION 0
#define CBOR_MINOR_VERSION 10
#define CBOR_PATCH_VERSION 2
#define CBOR_MINOR_VERSION 11
#define CBOR_PATCH_VERSION 0

#define CBOR_BUFFER_GROWTH 2
#define CBOR_MAX_STACK_SIZE 2048
Expand Down
2 changes: 1 addition & 1 deletion examples/cjson2cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* This code demonstrates how cJSON (https://github.com/DaveGamble/cJSON)
* callbacks can be used in conjuction with the streaming parser to translate
* callbacks can be used in conjunction with the streaming parser to translate
* JSON to CBOR. Please note that cbor_builder_* APIs are internal and thus
* subject to change.
*
Expand Down
Loading
Loading