`Protobuf` dependency doesn't work with `cmake` from `brew` on `MacOS`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cmake, cpp
- Área
- build-system
Línea de trabajo
Comienza con cmake/dependencies.cmake y el CMakeLists.txt de nivel superior; después, reproduce la compilación de Protobuf 3.19.4-p0 usando Homebrew CMake 4 en macOS. Inspecciona la configuración de compilación de Protobuf de Hunter y su CMakeLists.txt de dependencias generado. Se considera terminado cuando el proyecto se compila correctamente con la versión actual de Homebrew CMake sin el error de compatibilidad indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Trying to build with cmake from brew on MacOS, on , we get the following error with the Protobuf dependency:
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
This is caused by the first line in the dependency's CMakeLists.txt:
cmake_minimum_required(VERSION 3.2)
This happens because cmake version 4 removed compatibility with CMake < 3.5, and brew on MacOS does not offer an older version of cmake.
Passing the suggested -DCMAKE_POLICY_VERSION_MINIMUM=3.5 on the command line does not fix this.
Expected behavior
Build is successful on MacOS using the current versions of tools available in the default package manager brew.
Actual behavior
Build fails with the above error, due to incompatibility between the Protobuf dependency and the current version of cmake available on this platform.
Relevant log output
-- [hunter] PROTOBUF_ROOT: /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Install (ver.: 3.19.4-p0)
-- [hunter] Building Protobuf
loading initial cache file /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/cache.cmake
loading initial cache file /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Build/Protobuf/args.cmake
-- The C compiler identification is AppleClang 17.0.0.17000013
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Build/Protobuf/Build
[ 6%] Creating directories for 'Protobuf-Release'
[ 12%] Performing download step (download, verify and extract) for 'Protobuf-Release'
-- verifying file...
file='/Users/axoloki/.hunter/_Base/Download/Protobuf/3.19.4-p0/e5b797d/v3.19.4-p0.tar.gz'
-- File already exists and hash match (skip download):
file='/Users/axoloki/.hunter/_Base/Download/Protobuf/3.19.4-p0/e5b797d/v3.19.4-p0.tar.gz'
SHA1='e5b797dbc4e6ad92d0924ae86c130be4354c35b6'
-- extracting...
src='/Users/axoloki/.hunter/_Base/Download/Protobuf/3.19.4-p0/e5b797d/v3.19.4-p0.tar.gz'
dst='/Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Build/Protobuf/Source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 18%] No update step for 'Protobuf-Release'
[ 25%] No patch step for 'Protobuf-Release'
[ 31%] Performing configure step for 'Protobuf-Release'
loading initial cache file /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/cache.cmake
loading initial cache file /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Build/Protobuf/args.cmake
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
-- Configuring incomplete, errors occurred!
make[2]: *** [Protobuf-Release-prefix/src/Protobuf-Release-stamp/Protobuf-Release-configure] Error 1
make[1]: *** [CMakeFiles/Protobuf-Release.dir/all] Error 2
make: *** [all] Error 2
[hunter ** FATAL ERROR **] Build step failed (dir: /Users/axoloki/.hunter/_Base/15ca502/106fd1a/00f4bd3/Build/Protobuf
[hunter ** FATAL ERROR **] [Directory:/Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/projects/Protobuf]
------------------------------ ERROR -----------------------------
https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------
CMake Error at /Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
/Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
/Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
/Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/projects/Protobuf/hunter.cmake:200 (hunter_download)
/Users/axoloki/.hunter/_Base/Download/Hunter/0.25.3-qdrvm36/15ca502/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
cmake/dependencies.cmake:36 (hunter_add_package)
CMakeLists.txt:75 (include)
Possible Solution
Update the Protobuf dependency, or add a patch to the build process to address this issue.
Version
Error occurs with both tag v0.1.37 and master branch.
Would you like to work on fixing this bug ?
Yes
- Lenguaje dominante
- C++
- Estrellas
- 492
- Forks
- 130
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de libp2p/cpp-libp2p
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
libp2p/cpp-libp2p#351 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
libp2p/cpp-libp2p#347 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
libp2p/cpp-libp2p#341 ·
-
Lack of signedPeerRecord Validation in C++ IdentifyMessageProcessor Leads to Address Injection Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
libp2p/cpp-libp2p#332 ·
-
Build is failing all the time Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
libp2p/cpp-libp2p#313 · 1 comentario ·
Todos los issues de libp2p/cpp-libp2p
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ros2/message_filters#338 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
subsurface/subsurface#4984 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
google-ai-edge/LiteRT-LM#3739 ·