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 protobuf to 4.23.4 #22

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions abs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
upload_without_merge: true
aggregate_check: false
upload_channels:
- protobuf423
channels:
- protobuf423
build_parameters:
- "--suppress-variables"
- "--error-overlinking"
26 changes: 0 additions & 26 deletions recipe/0001-remove-Werror-from-test-flags.patch

This file was deleted.

69 changes: 0 additions & 69 deletions recipe/0002-remove-failing-json-parser-test.patch

This file was deleted.

39 changes: 0 additions & 39 deletions recipe/0003-remove-large-output-test.patch

This file was deleted.

21 changes: 0 additions & 21 deletions recipe/bld-shared.bat

This file was deleted.

22 changes: 0 additions & 22 deletions recipe/bld-static.bat

This file was deleted.

35 changes: 35 additions & 0 deletions recipe/build-lib.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@echo on

if "%PKG_NAME%"=="libprotobuf-static" (
set CF_SHARED=OFF
mkdir build-static
cd build-static
) else (
set CF_SHARED=ON
mkdir build-shared
cd build-shared
)

:: Configure and install based on protobuf's instructions and other `bld.bat`s.
cmake -G "Ninja" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CXX_STANDARD=17 ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-Dprotobuf_ABSL_PROVIDER="package" ^
-Dprotobuf_BUILD_SHARED_LIBS=%CF_SHARED% ^
-Dprotobuf_JSONCPP_PROVIDER="package" ^
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF ^
-Dprotobuf_USE_EXTERNAL_GTEST=ON ^
-Dprotobuf_WITH_ZLIB=ON ^
..
if %ERRORLEVEL% neq 0 exit 1

cmake --build .
if %ERRORLEVEL% neq 0 exit 1

ctest --progress --output-on-failure
if %ERRORLEVEL% neq 0 exit 1

cmake --install .
if %ERRORLEVEL% neq 0 exit 1
55 changes: 55 additions & 0 deletions recipe/build-lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -ex

if [[ "$(uname)" == "Linux" ]]; then
# protobuf uses PROTOBUF_OPT_FLAG to set the optimization level
# unit test can fail if optmization above 0 are used.
CPPFLAGS="${CPPFLAGS//-O[0-9]/}"
CXXFLAGS="${CXXFLAGS//-O[0-9]/}"
export PROTOBUF_OPT_FLAG="-O2"
# to improve performance, disable checks intended for debugging
CXXFLAGS="$CXXFLAGS -DNDEBUG"
elif [[ "$(uname)" == "Darwin" ]]; then
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
# remove pie from LDFLAGS
LDFLAGS="${LDFLAGS//-pie/}"
fi

# required to pick up conda installed zlib
export CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"

# delete vendored gtest to force protobuf_USE_EXTERNAL_GTEST to work;
# this gets run twice (second time for libprotobuf-static), so don't fail
rm -rf ./third_party/googletest | true

if [[ "$PKG_NAME" == "libprotobuf-static" ]]; then
export CF_SHARED=OFF
mkdir build-static
cd build-static
else
export CF_SHARED=ON
mkdir build-shared
cd build-shared
fi

cmake -G "Ninja" \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-Dprotobuf_ABSL_PROVIDER="package" \
-Dprotobuf_BUILD_SHARED_LIBS=$CF_SHARED \
-Dprotobuf_JSONCPP_PROVIDER="package" \
-Dprotobuf_USE_EXTERNAL_GTEST=ON \
-Dprotobuf_WITH_ZLIB=ON \
..

cmake --build .

#ctest is too broad and does not have an option to exclude specific gtest test cases, therefore calling gtest directly instead
#ctest --progress --output-on-failure
./lite-test
./tests --gtest_filter="IoTest.*-IoTest.LargeOutput" #LargeOutput failing because lack of resources on build agents

cmake --install .
62 changes: 0 additions & 62 deletions recipe/build-shared.sh

This file was deleted.

Empty file added recipe/build.sh
Empty file.
7 changes: 0 additions & 7 deletions recipe/build_static.sh

This file was deleted.

26 changes: 26 additions & 0 deletions recipe/cmake_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
project(cf_dummy LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.12)
# We need to specify CONFIG to make sure that CMake
# uses protobuf-config.cmake instead of relying on its
# own FindProtobuf.cmake that does not know about
# abseil transitive depedendency and about C++ version
# required, see https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/4075#issuecomment-1569242816
find_package(Protobuf CONFIG REQUIRED)
boldorider4 marked this conversation as resolved.
Show resolved Hide resolved

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/struct_example.cc
"

#include <iostream>

#include <google/protobuf/struct.pb.h>

int main()
{
google::protobuf::Struct myStruct;
}

"
)

add_executable(struct_example ${CMAKE_CURRENT_BINARY_DIR}/struct_example.cc)
target_link_libraries(struct_example PRIVATE protobuf::libprotobuf)
Loading