Skip to content

Commit 26a18e7

Browse files
authored
Merge pull request #4 from tgauth/update-0.11.0
Update 0.11.0
2 parents 89b3fd3 + 2c477a9 commit 26a18e7

34 files changed

+599
-179
lines changed

.circleci/config.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ commands:
44
linux-setup:
55
steps:
66
- run: sudo apt-get update
7-
- run: sudo apt-get install -y cmake ${TOOLCHAIN_PACKAGES}
8-
- run: sudo apt install libcmocka-dev libcjson-dev
7+
# NEEDRESTART_MODE prevents automatic restarts which seem to hang.
8+
- run: sudo NEEDRESTART_MODE=l apt-get install -y cmake ${TOOLCHAIN_PACKAGES}
9+
- run: sudo NEEDRESTART_MODE=l apt-get install -y libcmocka-dev libcjson-dev
910
build:
1011
steps:
1112
- run: >
@@ -32,14 +33,14 @@ orbs:
3233

3334
jobs:
3435
static-test:
35-
machine:
36-
image: ubuntu-2204:2022.10.2
36+
machine: &default-machine
37+
image: ubuntu-2204:2023.07.2
3738
environment:
3839
TOOLCHAIN_PACKAGES: g++
3940
steps:
4041
- checkout
4142
- linux-setup
42-
- run: sudo apt-get install -y clang-format doxygen cppcheck
43+
- run: sudo NEEDRESTART_MODE=l apt-get install -y clang-format doxygen cppcheck
4344
- run: cppcheck --inline-suppr --error-exitcode=1 .
4445
- run: bash clang-format.sh --verbose
4546
- run: >
@@ -61,14 +62,14 @@ jobs:
6162
6263
build-and-test:
6364
machine:
64-
image: ubuntu-2204:2022.10.2
65+
<<: *default-machine
6566
environment:
6667
TOOLCHAIN_PACKAGES: g++
6768
CMAKE_COVERAGE: ON
6869
steps:
6970
- checkout
7071
- linux-setup
71-
- run: sudo apt-get install -y valgrind
72+
- run: sudo NEEDRESTART_MODE=l apt-get install -y valgrind
7273
- build
7374
- test
7475
- run: ctest -T Coverage
@@ -82,7 +83,7 @@ jobs:
8283
8384
build-and-test-clang:
8485
machine:
85-
image: ubuntu-2204:2022.10.2
86+
<<: *default-machine
8687
environment:
8788
TOOLCHAIN_PACKAGES: clang
8889
CC: clang
@@ -95,11 +96,11 @@ jobs:
9596

9697
build-and-test-32b:
9798
machine:
98-
image: ubuntu-2204:2022.10.2
99+
<<: *default-machine
99100
steps:
100101
- checkout
101102
- run: sudo apt-get update
102-
- run: sudo apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386
103+
- run: sudo NEEDRESTART_MODE=l apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386
103104
# Make cmocka from source w/ 32b setup
104105
- run: git clone https://git.cryptomilk.org/projects/cmocka.git ~/cmocka
105106
- run: >
@@ -118,7 +119,7 @@ jobs:
118119

119120
build-and-test-release-clang:
120121
machine:
121-
image: ubuntu-2204:2022.10.2
122+
<<: *default-machine
122123
environment:
123124
TOOLCHAIN_PACKAGES: clang
124125
CC: clang
@@ -131,7 +132,7 @@ jobs:
131132

132133
llvm-coverage:
133134
machine:
134-
image: ubuntu-2204:2022.10.2
135+
<<: *default-machine
135136
environment:
136137
TOOLCHAIN_PACKAGES: clang
137138
CC: clang
@@ -146,7 +147,7 @@ jobs:
146147

147148
build-and-test-arm:
148149
machine:
149-
image: ubuntu-2204:2022.10.2
150+
<<: *default-machine
150151
environment:
151152
TOOLCHAIN_PACKAGES: g++
152153
resource_class: arm.medium
@@ -158,7 +159,7 @@ jobs:
158159

159160
build-bazel:
160161
machine:
161-
image: ubuntu-2204:2022.10.2
162+
image: ubuntu-2204:2023.07.2
162163
environment:
163164
TOOLCHAIN_PACKAGES: g++
164165
steps:

.cirrus.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
freebsd_task:
2+
install_script:
3+
- ASSUME_ALWAYS_YES=yes pkg bootstrap -f && pkg install -y cmocka cmake ninja
4+
build_script:
5+
- mkdir build
6+
- cd build
7+
- cmake -GNinja -DWITH_TESTS=ON
8+
-DCBOR_CUSTOM_ALLOC=ON
9+
-DCMAKE_BUILD_TYPE=Debug
10+
-DSANITIZE=OFF
11+
..
12+
- ninja -j $(sysctl -n hw.ncpu)
13+
test_script:
14+
- cd build
15+
- ctest -VV
16+
matrix:
17+
# From gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images
18+
- name: freebsd-13-2
19+
freebsd_instance:
20+
image_family: freebsd-13-2
21+
- name: freebsd-14-0
22+
freebsd_instance:
23+
image_family: freebsd-14-0
24+
- name: freebsd-15-0-snap
25+
freebsd_instance:
26+
image_family: freebsd-15-0-snap

.readthedocs.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
sphinx:
15+
configuration: doc/source/conf.py
16+
17+
# We recommend specifying your dependencies to enable reproducible builds:
18+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
19+
python:
20+
install:
21+
- requirements: doc/source/requirements.txt

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@ Template:
33

44
Next
55
---------------------
6+
7+
0.11.0 (2024-02-04)
8+
---------------------
69
- [Updated documentation to refer to RFC 8949](https://github.com/PJK/libcbor/issues/269)
10+
- Improvements to `cbor_describe`
11+
- [Bytestring data will now be printed as well](https://github.com/PJK/libcbor/pull/281) by [akallabeth](https://github.com/akallabeth)
12+
- [Formatting consistency and clarity improvements](https://github.com/PJK/libcbor/pull/285)
13+
- [Fix `cbor_string_set_handle` not setting the codepoint count](https://github.com/PJK/libcbor/pull/286)
14+
- 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)
15+
- If you were relying on the validation, please check the result using `cbor_string_codepoint_count` instead
16+
- 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))
17+
- Previously, decoding of certain values would fail with `CBOR_ERR_MALFORMATED` or `CBOR_DECODER_ERROR`
18+
- This also makes decoding symmetrical with serialization, which already accepts all values
719

820
0.10.2 (2023-01-31)
921
---------------------
@@ -118,7 +130,7 @@ Next
118130
Breaks build & header compatibility due to:
119131

120132
- Improved build configuration and feature check macros
121-
- Endianess configuration fixes (by Erwin Kroon and David Grigsby)
133+
- Endianness configuration fixes (by Erwin Kroon and David Grigsby)
122134
- pkg-config compatibility (by Vincent Bernat)
123135
- enable use of versioned SONAME (by Vincent Bernat)
124136
- better fuzzer (wasn't random until now, ooops)

CMakeLists.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
cmake_minimum_required(VERSION 3.0)
2+
23
project(libcbor)
34
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/")
45
include(CTest)
6+
include(GNUInstallDirs) # Provides CMAKE_INSTALL_ variables
57

68
SET(CBOR_VERSION_MAJOR "0")
7-
SET(CBOR_VERSION_MINOR "10")
8-
SET(CBOR_VERSION_PATCH "2")
9+
SET(CBOR_VERSION_MINOR "11")
10+
SET(CBOR_VERSION_PATCH "0")
911
SET(CBOR_VERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH})
1012

11-
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
13+
option(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "cmake --build --target install does not depend on cmake --build" true)
14+
option(BUILD_SHARED_LIBS "Build as a shared library" false)
15+
1216
include(CheckIncludeFiles)
1317

1418
include(TestBigEndian)
@@ -19,10 +23,10 @@ endif()
1923

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

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

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

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
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.
5+
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.
66

77
## Principles
88

Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = libcbor
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = 0.10.2
51+
PROJECT_NUMBER = 0.11.0
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

cgmanifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Type": "other",
66
"Other": {
77
"Name": "libcbor",
8-
"Version": "0.10.1",
8+
"Version": "0.11.0",
99
"DownloadUrl": "https://github.com/PJK/libcbor"
1010
}
1111
},

doc/source/conf.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
'breathe',
3434
'sphinx.ext.mathjax',
3535
'sphinx.ext.autodoc',
36-
'sphinx.ext.ifconfig'
36+
'sphinx.ext.ifconfig',
37+
'sphinx_rtd_theme'
3738
]
3839

3940
import subprocess, os
@@ -76,8 +77,8 @@
7677
# built documents.
7778
#
7879
# The short X.Y version.
79-
version = '0.10'
80-
release = '0.10.2'
80+
version = '0.11'
81+
release = '0.11.0'
8182

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

128129
# The theme to use for HTML and HTML Help pages. See the documentation for
129130
# a list of builtin themes.
130-
html_theme = 'default'
131+
html_theme = 'sphinx_rtd_theme'
131132

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

286287
# If true, do not generate a @detailmenu in the "Top" node's menu.
287288
#texinfo_no_detailmenu = False
288-
289-
290-
if not on_rtd: # only import and set the theme if we're building docs locally
291-
import sphinx_rtd_theme
292-
html_theme = 'sphinx_rtd_theme'
293-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
294-
295-
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
296-

doc/source/development.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Goals
2323
~~~~~~~~~~~~~~~~~~~~~~
2424

2525
Standard conformance and full feature support
26-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2727

2828
Anything the standard allows, libcbor can do.
2929

doc/source/internal.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ and also borrowing from
3232

3333
General notes on the API design
3434
--------------------------------
35-
The API design has two main driving priciples:
35+
The API design has two main driving principles:
3636

3737
1. Let the client manage the memory as much as possible
3838
2. Behave exactly as specified by the standard

doc/source/requirements.txt

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
alabaster==0.7.12
2-
Babel==2.9.1
3-
breathe==4.33.1
4-
certifi==2022.12.7
5-
charset-normalizer==2.0.12
6-
colorama==0.4.4
7-
docutils==0.17.1
8-
idna==3.3
9-
imagesize==1.3.0
10-
importlib-metadata==4.11.3
11-
Jinja2==3.0.3
1+
alabaster==0.7.13
2+
Babel==2.13.1
3+
breathe==4.35.0
4+
certifi==2023.11.17
5+
charset-normalizer==3.3.2
6+
colorama==0.4.6
7+
docutils==0.18.1
8+
idna==3.4
9+
imagesize==1.4.1
10+
importlib-metadata==6.8.0
11+
Jinja2==3.1.2
1212
livereload==2.6.3
13-
MarkupSafe==2.1.1
14-
packaging==21.3
15-
Pygments==2.11.2
16-
pyparsing==3.0.7
13+
MarkupSafe==2.1.3
14+
packaging==23.2
15+
Pygments==2.16.1
16+
pyparsing==3.1.1
1717
pytz==2021.3
18-
requests==2.27.1
18+
requests==2.31.0
1919
snowballstemmer==2.2.0
20-
Sphinx==4.4.0
20+
Sphinx==7.2.6
2121
sphinx-autobuild==2021.3.14
22-
sphinx-rtd-theme==1.0.0
23-
sphinxcontrib-applehelp==1.0.2
24-
sphinxcontrib-devhelp==1.0.2
25-
sphinxcontrib-htmlhelp==2.0.0
22+
sphinx-rtd-theme==1.3.0
23+
sphinxcontrib-applehelp==1.0.7
24+
sphinxcontrib-devhelp==1.0.5
25+
sphinxcontrib-htmlhelp==2.0.4
2626
sphinxcontrib-jsmath==1.0.1
27-
sphinxcontrib-qthelp==1.0.3
28-
sphinxcontrib-serializinghtml==1.1.5
29-
tornado==6.1
30-
urllib3==1.26.9
31-
zipp==3.7.0
27+
sphinxcontrib-qthelp==1.0.6
28+
sphinxcontrib-serializinghtml==1.1.9
29+
tornado==6.3.3
30+
urllib3==2.1.0
31+
zipp==3.17.0

examples/bazel/third_party/libcbor/cbor/configuration.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define LIBCBOR_CONFIGURATION_H
33

44
#define CBOR_MAJOR_VERSION 0
5-
#define CBOR_MINOR_VERSION 10
6-
#define CBOR_PATCH_VERSION 2
5+
#define CBOR_MINOR_VERSION 11
6+
#define CBOR_PATCH_VERSION 0
77

88
#define CBOR_BUFFER_GROWTH 2
99
#define CBOR_MAX_STACK_SIZE 2048

examples/cjson2cbor.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/**
99
* This code demonstrates how cJSON (https://github.com/DaveGamble/cJSON)
10-
* callbacks can be used in conjuction with the streaming parser to translate
10+
* callbacks can be used in conjunction with the streaming parser to translate
1111
* JSON to CBOR. Please note that cbor_builder_* APIs are internal and thus
1212
* subject to change.
1313
*

0 commit comments

Comments
 (0)