Closed kloczek closed 1 year ago
I found that OpenMandriva already have JFDI patch for that issue which means that what I see is not bogus. https://github.com/OpenMandrivaAssociation/protobuf-c/blob/master/protobuf-c-protobuf-22.1.patch
Can you try to use -Dprotobuf_ABSL_PROVIDER=package
and then set -DCMAKE_PREFIX_PATH
to the path where you have installed abseil?
Will try however looks like in tis case issue is about targets resolutions when they are listed in abslTargets.cmake
file.
In my case that file comtains:
As you see in that file absl::absl_check
is present
BTW absl provides as well pkgconfig filres. I thik that i=better would be switch to use pkg_check_modules()
https://cmake.org/cmake/help/latest/module/FindPkgConfig.html#command:pkg_search_module
Can you try to use
-Dprotobuf_ABSL_PROVIDER=package
and then set-DCMAKE_PREFIX_PATH
to the path where you have installed abseil?
Nope it did not helped
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D CMAKE_PREFIX_PATH=/usr -D protobuf_ABSL_PROVIDER=ON -D protobuf_ABSL_PROVIDER=package -D protobuf_BUILD_TESTS=ON -D protobuf_USE_EXTERNAL_GTEST=ON
-- The C compiler identification is GNU 13.0.1
-- The CXX compiler identification is GNU 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- 22.2.0
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Found GTest: /usr/lib64/cmake/GTest/GTestConfig.cmake (found version "1.13.0")
-- Configuring done
CMake Error at cmake/tests.cmake:97 (target_link_libraries):
Target "tests" links to:
absl::scoped_mock_log
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
CMakeLists.txt:401 (include)
CMake Error at cmake/tests.cmake:113 (target_link_libraries):
Target "test_plugin" links to:
absl::scoped_mock_log
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
CMakeLists.txt:401 (include)
CMake Error at cmake/tests.cmake:126 (target_link_libraries):
Target "lite-test" links to:
absl::scoped_mock_log
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
CMakeLists.txt:401 (include)
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_Fortran_FLAGS_RELEASE
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
CMake Generate step failed. Build files cannot be regenerated correctly.
Because of this issue (and other problems linking against protobuf 22.x which now depends on abseil) I'll be packaging v21.12 for Chimera Linux. From what I could test all v22.x (including v22.3) releases have a broken system-wide installation as of today.
I hope these protobuf/abseil issues are solved in a future release so system-wide installations (like in any Linux distribution packaging) work without requiring hacks like starting to define various abseil
libraries to link manually without explicitly using them in some project, packagers having to hack on protobuf.pc.cmake
to attempt bringing in the now required abseil stuff etc.
Fwiw https://github.com/nmeum/android-tools is what required bringing in protobuf in my case.
I should note that other distributions also seem to be stuck on the older version 21.12 presumably due to seeing similar problems, see Arch Linux, Alpine Linux, Void Linux, Debian, openSUSE
gentle ping .. any progress? 🤔
We are working on this and hope to have new 22.x releases soon to solve it.
Hey Thomasz,
Sorry for the delay, I haven't been able to reproduce these issues. Can you provide details on how you built/installed Abseil, and what version you used? Also, the OpenMandriva patch you mentioned only seems to update CMAKE_CXX_STANDARD to 17 in our cmake file. Is there some other change I'm missing?
We recently fixed some pkg-config issues with our dependencies, does the tip of the 22.x branch work for you?
I should note that other distributions also seem to be stuck on the older version 21.12 presumably due to seeing similar problems, see Arch Linux, Alpine Linux, Void Linux, Debian, openSUSE
Let me try to integrate tose commits with my spec fiels and try to bake that 😋
Just tested and result still is negative.
that's 22.3. The fixes I was referring to aren't released yet but are sitting in main and the 22.x branch (and will be in our next releast)
Ah sorry nvm, you patched in the 22.4 commits >.<. Ok in that case can you provide your Abseil setup? I'm still not able to reproduce this and I suspect it has something to do with how you installed Abseil (or maybe your OS?)
So I suspect this is caused by Abseil getting installed without -DABSL_BUILD_TEST_HELPERS=ON
set, which installs the scoped_mock_log target our tests depend on. If this is the case, setting -Dprotobuf_BUILD_TESTS=OFF
on our build or reinstalling Abseil should work. We should add documentation about this though
So I suspect this is caused by Abseil getting installed without
-DABSL_BUILD_TEST_HELPERS=ON
set, which installs the scoped_mock_log target our tests depend on. If this is the case, setting-Dprotobuf_BUILD_TESTS=OFF
on our build or reinstalling Abseil should work. We should add documentation about this though
Nope 😋 Here is %build section from my abseil-cpp.spec
%build
%cmake \
-D ABSL_BUILD_TESTING=ON \
-D ABSL_BUILD_TEST_HELPERS=ON \
-D ABSL_USE_EXTERNAL_GOOGLETEST=ON \
%{nil}
%cmake_build
Just checked absl-spp buils log. Here is cmake output
Thanks for all the info! It looks like this is caused by https://github.com/abseil/abseil-cpp/issues/1407, which hasn't been fixed in an Abseil release yet. We'll try to get that pushed through and update our dependency (along with new tests that reproduce this)
k, so this should be fixed with Abseil 20230125.3. We've made some additional changes to Protobuf that I'll backport to 22 and 23 today, but there's a good chance you don't need any of them.
OK .. please let me check 😋
Build fails with gcc 13
[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ make -k
/usr/bin/cmake -S/home/tkloczko/rpmbuild/BUILD/protobuf-22.4 -B/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/CMakeFiles /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make -f third_party/utf8_range/CMakeFiles/utf8_validity.dir/build.make third_party/utf8_range/CMakeFiles/utf8_validity.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/third_party/utf8_range /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/third_party/utf8_range /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/third_party/utf8_range/CMakeFiles/utf8_validity.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make -f third_party/utf8_range/CMakeFiles/utf8_validity.dir/build.make third_party/utf8_range/CMakeFiles/utf8_validity.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make[2]: Nothing to be done for 'third_party/utf8_range/CMakeFiles/utf8_validity.dir/build'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
[ 1%] Built target utf8_validity
make -f CMakeFiles/libprotobuf-lite.dir/build.make CMakeFiles/libprotobuf-lite.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/CMakeFiles/libprotobuf-lite.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make -f CMakeFiles/libprotobuf-lite.dir/build.make CMakeFiles/libprotobuf-lite.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
[ 1%] Building CXX object CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o
/usr/bin/g++ -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -DLIBPROTOBUF_EXPORTS -DPROTOBUF_USE_DLLS -Dlibprotobuf_lite_EXPORTS -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/third_party/utf8_range -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o -MF CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o.d -o CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o -c /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.cc
In file included from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.h:37,
from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.cc:31:
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:67: error: ‘uint32_t’ was not declared in this scope
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:56:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
55 | #include "google/protobuf/port_def.inc"
+++ |+#include <cstdint>
56 |
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:75: error: template argument 2 is invalid
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: error: ‘uint64_t’ was not declared in this scope
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:75: error: template argument 2 is invalid
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 2 is invalid
188 | std::is_same<T, bool>> {};
| ^~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 4 is invalid
make[2]: *** [CMakeFiles/libprotobuf-lite.dir/build.make:233: CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/inlined_string_field.cc.o] Error 1
make[2]: Target 'CMakeFiles/libprotobuf-lite.dir/build' not remade because of errors.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:121: CMakeFiles/libprotobuf-lite.dir/all] Error 2
make -f CMakeFiles/libprotobuf.dir/build.make CMakeFiles/libprotobuf.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/CMakeFiles/libprotobuf.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make -f CMakeFiles/libprotobuf.dir/build.make CMakeFiles/libprotobuf.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
[ 1%] Building CXX object CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o
/usr/bin/g++ -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -DLIBPROTOBUF_EXPORTS -DPROTOBUF_USE_DLLS -Dlibprotobuf_EXPORTS -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/third_party/utf8_range -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o -MF CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o.d -o CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o -c /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/any.cc
In file included from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/any.h:36,
from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/any.cc:31:
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:67: error: ‘uint32_t’ was not declared in this scope
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:56:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
55 | #include "google/protobuf/port_def.inc"
+++ |+#include <cstdint>
56 |
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:75: error: template argument 2 is invalid
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: error: ‘uint64_t’ was not declared in this scope
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:75: error: template argument 2 is invalid
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 2 is invalid
188 | std::is_same<T, bool>> {};
| ^~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 4 is invalid
make[2]: *** [CMakeFiles/libprotobuf.dir/build.make:219: CMakeFiles/libprotobuf.dir/src/google/protobuf/any.cc.o] Error 1
[ 2%] Building CXX object CMakeFiles/libprotobuf.dir/src/google/protobuf/inlined_string_field.cc.o
/usr/bin/g++ -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -DLIBPROTOBUF_EXPORTS -DPROTOBUF_USE_DLLS -Dlibprotobuf_EXPORTS -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src -I/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/third_party/utf8_range -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf.dir/src/google/protobuf/inlined_string_field.cc.o -MF CMakeFiles/libprotobuf.dir/src/google/protobuf/inlined_string_field.cc.o.d -o CMakeFiles/libprotobuf.dir/src/google/protobuf/inlined_string_field.cc.o -c /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.cc
In file included from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.h:37,
from /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/inlined_string_field.cc:31:
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:67: error: ‘uint32_t’ was not declared in this scope
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:56:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
55 | #include "google/protobuf/port_def.inc"
+++ |+#include <cstdint>
56 |
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:186:75: error: template argument 2 is invalid
186 | : absl::disjunction<std::is_same<T, int32_t>, std::is_same<T, uint32_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: error: ‘uint64_t’ was not declared in this scope
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^~~~~~~~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:67: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:187:75: error: template argument 2 is invalid
187 | std::is_same<T, int64_t>, std::is_same<T, uint64_t>,
| ^
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 2 is invalid
188 | std::is_same<T, bool>> {};
| ^~
/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/src/google/protobuf/port.h:188:45: error: template argument 4 is invalid
make[2]: *** [CMakeFiles/libprotobuf.dir/build.make:541: CMakeFiles/libprotobuf.dir/src/google/protobuf/inlined_string_field.cc.o] Error 1
make[2]: Target 'CMakeFiles/libprotobuf.dir/build' not remade because of errors.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:147: CMakeFiles/libprotobuf.dir/all] Error 2
make -f third_party/utf8_range/CMakeFiles/utf8_range.dir/build.make third_party/utf8_range/CMakeFiles/utf8_range.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/protobuf-22.4 /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/third_party/utf8_range /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/third_party/utf8_range /home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu/third_party/utf8_range/CMakeFiles/utf8_range.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make -f third_party/utf8_range/CMakeFiles/utf8_range.dir/build.make third_party/utf8_range/CMakeFiles/utf8_range.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make[2]: Nothing to be done for 'third_party/utf8_range/CMakeFiles/utf8_range.dir/build'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
[ 3%] Built target utf8_range
make[1]: Target 'all' not remade because of errors.
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/protobuf-22.4/x86_64-redhat-linux-gnu'
make: *** [Makefile:149: all] Error 2
hmm looks like we need more gcc test coverage. Is adding -include stdint.h
a reasonable workaround? We should move this to a separate issue
No .. just please add those includes in the code as that error message says 😄
OK with below one line patch I was able to build protobuf library
--- a/src/google/protobuf/port.h
+++ b/src/google/protobuf/port.h
@@ -53,7 +53,7 @@
// must be last
#include "google/protobuf/port_def.inc"
-
+#include <cstdint>
namespace google {
namespace protobuf {
After that I found that something has changed in python module build because I was not able to build module using pep517 build procdure
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
/usr/lib/python3.8/site-packages/setuptools/dist.py:955: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
running egg_info
creating protobuf.egg-info
writing protobuf.egg-info/PKG-INFO
writing dependency_links to protobuf.egg-info/dependency_links.txt
writing namespace_packages to protobuf.egg-info/namespace_packages.txt
writing top-level names to protobuf.egg-info/top_level.txt
writing manifest file 'protobuf.egg-info/SOURCES.txt'
/usr/lib/python3.8/site-packages/setuptools/command/sdist.py:119: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
!!
********************************************************************************
Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
See https://peps.python.org/pep-0632/ for details.
********************************************************************************
!!
self._add_data_files(self._safe_data_files(build_py))
reading manifest file 'protobuf.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'google/protobuf/internal/import_test_package'
warning: no previously-included files found matching 'google/protobuf/internal/*_pb2.py'
warning: no previously-included files found matching 'google/protobuf/internal/*_test.py'
warning: no previously-included files found matching 'google/protobuf/internal/*.proto'
warning: no previously-included files found matching 'google/protobuf/internal/test_util.py'
warning: no previously-included files matching '*_test.py' found under directory 'google'
warning: no previously-included files matching '*_test.proto' found under directory 'google'
warning: no previously-included files matching 'unittest*_pb2.py' found under directory 'google'
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no files found matching 'LICENSE'
writing manifest file 'protobuf.egg-info/SOURCES.txt'
* Building wheel...
/usr/lib/python3.8/site-packages/setuptools/dist.py:955: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
running bdist_wheel
running build
running build_py
Generating google/protobuf/descriptor_pb2.py...
protoc is not installed nor found in ../src. Please compile it or install the binary package.
ERROR Backend subprocess exited when trying to invoke build_wheel
Above is executed aftwr change direcrory to python/
Please have a look closer on above warnings as well.
My sugestion is to remove completly python binding and make it as standalone source tree and module registered on pypi which in build rpocedure will be assuming that module DSO will be linked with system installed protobuf + its devel (to detect protobuf usig pkgconfig could be used pkgconfig
python module https://pypi.org/project/pkgconfig/)
Looks like curent python modul build procedure assumes that protobuf shared libraries will be build in source tree.
Issue is that most of the Linux distributions on use cmake are using off-tree build (cmake -B <build_directory> ..
and you cannot anticipate ehat woud be the name of the '
Just found that protobuf actuallalredy is on pypi https://pypi.org/project/protobuf/ however there is no VCS tree where its code is maintained.
I made yet another test
[tkloczko@pers-jacek build]$ rpmbuild -ba protobuf.spec --quiet 2>&1 | grep -- \\[-W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr
302 -Wsign-compare
116 -Wdeprecated-declarations
4 -Wstringop-overflow=
2 -Wself-move
1 -Wclass-memaccess
Here is ectracted stderr with warnings
Looks like something is wrong with way of detecting
absl
by cmake (3.25.2) or how cmake absl module is used by protobuf. Fact is that currently it is no tpossible correctly detect absl