Skip to content

Commit

Permalink
feat: bump msgpack (#2884)
Browse files Browse the repository at this point in the history
Bumps msgpack for std::variant enhancements. This is fast-followed by
https://github.com/AztecProtocol/aztec-packages/pull/2885/files which
has the same commit hash but downloads
https://github.com/AztecProtocol/msgpack-c. As this is not our code (a
few small patches to error-handling aside) and it's somewhat large at
7mb of code, itself bundling dependencies., so it's cleaner to not have
it in tree.

---------

Co-authored-by: ludamad <[email protected]>
  • Loading branch information
ludamad and ludamad0 authored Oct 17, 2023
1 parent c1dff38 commit d7b7fb1
Show file tree
Hide file tree
Showing 40 changed files with 940 additions and 619 deletions.
1 change: 0 additions & 1 deletion barretenberg/cpp/src/barretenberg/serialize/cbind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "msgpack_impl/schema_impl.hpp"
#include "msgpack_impl/schema_name.hpp"
#include "msgpack_impl/struct_map_impl.hpp"
#include "msgpack_impl/variant_impl.hpp"

#include <cstring>
#include <type_traits>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#pragma once
// Note: Meant to only be included in compilation units that need msgpack
#include "struct_map_impl.hpp"
#include "variant_impl.hpp"
#include "struct_map_impl.hpp"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sstream>
#include <string>
#define MSGPACK_NO_BOOST
#define MSGPACK_USE_STD_VARIANT_ADAPTOR
#include "concepts.hpp"
#include "drop_keys.hpp"
#include <msgpack.hpp>
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions barretenberg/cpp/src/msgpack-c/.clang-format

This file was deleted.

6 changes: 3 additions & 3 deletions barretenberg/cpp/src/msgpack-c/.github/depends/zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ while getopts "b:t:p:" c; do
done

mkdir $prefix || exit 1
wget https://zlib.net/zlib-1.2.13.tar.gz || exit 1
tar -xf zlib-1.2.13.tar.gz || exit 1
cd zlib-1.2.13
wget https://zlib.net/zlib-1.3.tar.gz || exit 1
tar -xf zlib-1.3.tar.gz || exit 1
cd zlib-1.3

build()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
-D MSGPACK_BUILD_TESTS=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D MSGPACK_GEN_COVERAGE=ON \
-D MSGPACK_USE_STD_VARIANT_ADAPTOR=ON \
-D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \
-B build \
-S . || exit 1
Expand Down
1 change: 1 addition & 0 deletions barretenberg/cpp/src/msgpack-c/.github/workflows/gha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
3)
export CXX="g++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON"
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
;;
4)
export CXX="clang++-10"
Expand Down
5 changes: 5 additions & 0 deletions barretenberg/cpp/src/msgpack-c/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ Makefile
/test/streaming_c
/test/version
/test/zone

build
*-build
.cache
compile_commands.json
6 changes: 6 additions & 0 deletions barretenberg/cpp/src/msgpack-c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2023-07-08 version 6.1.0
* Remove dependency on boost in chrono.hpp (#1076)
* Add support for std::variant behavior (#1075)
* Fix msgpack::type::variant behavior to respect MessagePack format (#1071)
* Add rebind allocators (#1065)

# 2023-03-02 version 6.0.0
## << breaking changes >>
* Change CMake package name of C++ library to msgpack-cxx (#1054)
Expand Down
25 changes: 15 additions & 10 deletions barretenberg/cpp/src/msgpack-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ OPTION (MSGPACK_CXX14 "Using c++14 compiler" OFF)
OPTION (MSGPACK_CXX17 "Using c++17 compiler" OFF)
OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF)

OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_BOOST "Use Boost libraried" ON)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
OPTION (MSGPACK_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION (MSGPACK_CHAR_SIGN "Char sign to use (signed or unsigned)")
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_USE_BOOST "Use Boost libraried" ON)
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
OPTION (MSGPACK_BUILD_DOCS "Build Doxygen documentation" ON)
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
OPTION (MSGPACK_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION (MSGPACK_CHAR_SIGN "Char sign to use (signed or unsigned)")
OPTION (MSGPACK_USE_STD_VARIANT_ADAPTOR "Enable the adaptor for std::variant" OFF)

SET (CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -92,6 +93,10 @@ ELSE ()
TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_DEFAULT_API_VERSION=3)
ENDIF ()

IF (MSGPACK_USE_STD_VARIANT_ADAPTOR)
TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_USE_STD_VARIANT_ADAPTOR)
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.1)
INCLUDE (CheckCXXSourceCompiles)
Expand Down
2 changes: 2 additions & 0 deletions barretenberg/cpp/src/msgpack-c/Files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SET (msgpack-cxx_HEADERS
include/msgpack/adaptor/cpp17/carray_byte.hpp
include/msgpack/adaptor/cpp17/optional.hpp
include/msgpack/adaptor/cpp17/string_view.hpp
include/msgpack/adaptor/cpp17/variant.hpp
include/msgpack/adaptor/cpp17/vector_byte.hpp
include/msgpack/adaptor/cpp20/span.hpp
include/msgpack/adaptor/define.hpp
Expand Down Expand Up @@ -542,6 +543,7 @@ SET (msgpack-cxx_HEADERS
include/msgpack/v1/adaptor/cpp17/carray_byte.hpp
include/msgpack/v1/adaptor/cpp17/optional.hpp
include/msgpack/v1/adaptor/cpp17/string_view.hpp
include/msgpack/v1/adaptor/cpp17/variant.hpp
include/msgpack/v1/adaptor/cpp17/vector_byte.hpp
include/msgpack/v1/adaptor/cpp20/span.hpp
include/msgpack/v1/adaptor/define.hpp
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/msgpack-c/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
`msgpack` for C++
===================

Version 6.0.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=cpp_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/cpp_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
Version 6.1.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=cpp_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/cpp_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)

It's like JSON but smaller and faster.
Expand Down
16 changes: 8 additions & 8 deletions barretenberg/cpp/src/msgpack-c/appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 6.0.0.{build}
version: 6.1.0.{build}

branches:
only:
Expand All @@ -23,18 +23,18 @@ environment:
boost_subdir: lib32-msvc-14.0
build_script:
- ps: |
appveyor DownloadFile http://zlib.net/zlib-1.2.13.tar.gz -FileName zlib-1.2.13.tar.gz
7z x zlib-1.2.13.tar.gz 2> $null
7z x zlib-1.2.13.tar 2> $null
cd zlib-1.2.13
appveyor DownloadFile http://zlib.net/zlib-1.3.tar.gz -FileName zlib-1.3.tar.gz
7z x zlib-1.3.tar.gz 2> $null
7z x zlib-1.3.tar 2> $null
cd zlib-1.3
md build
md prefix
cd build
cmake `
-G $env:msvc `
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.3\prefix" `
..
if ($LastExitCode -ne 0) { exit $LastExitCode }
Expand All @@ -52,7 +52,7 @@ build_script:
-D MSGPACK_BUILD_EXAMPLES=ON `
-D MSGPACK_BUILD_TESTS=ON `
-D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" `
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.13\prefix" `
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3\prefix" `
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" `
..
Expand All @@ -62,5 +62,5 @@ build_script:
if ($LastExitCode -ne 0) { exit $LastExitCode }
test_script:
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.13\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
- ctest -VV -C Release
1 change: 1 addition & 0 deletions barretenberg/cpp/src/msgpack-c/ci/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cmake \
-D MSGPACK_CHAR_SIGN=${CHAR_SIGN} \
-D MSGPACK_DEFAULT_API_VERSION=${API_VERSION} \
-D MSGPACK_USE_X3_PARSE=${X3_PARSE} \
-D MSGPACK_USE_STD_VARIANT_ADAPTOR=${STD_VARIANT_ADAPTOR} \
-D CMAKE_CXX_FLAGS="${CXXFLAGS} ${ARCH_FLAG}" \
-D CMAKE_INSTALL_PREFIX=$prefix_dir \
-B $build_dir \
Expand Down
Loading

0 comments on commit d7b7fb1

Please sign in to comment.