Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953138 - media-libs/opencv-4.10.0: build error
Summary: media-libs/opencv-4.10.0: build error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Paul Zander
URL:
Whiteboard:
Keywords: PMASKED, PullRequest
Depends on:
Blocks:
 
Reported: 2025-04-05 05:02 UTC by Leo Douglas
Modified: 2025-04-11 09:49 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,423.82 KB, text/x-log)
2025-04-05 05:02 UTC, Leo Douglas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Douglas 2025-04-05 05:02:59 UTC
Created attachment 923582 [details]
build.log

ninja: build stopped: subcommand failed.
 * ERROR: media-libs/opencv-4.10.0::gentoo failed (compile phase):
 *   ninja -v -j8 -l9 failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 5320:  Called cmake-multilib_src_compile
 *   environment, line 1219:  Called multilib-minimal_src_compile
 *   environment, line 3932:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 4199:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 3892:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 3890:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  464:  Called multilib-minimal_abi_src_compile
 *   environment, line 3926:  Called multilib_src_compile
 *   environment, line 4422:  Called cmake_src_compile
 *   environment, line 1337:  Called cmake_build
 *   environment, line 1304:  Called eninja
 *   environment, line 1951:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=media-libs/opencv-4.10.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/opencv-4.10.0::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =media-libs/opencv-4.10.0
 * The complete build log is located at '/var/tmp/portage/media-libs/opencv-4.10.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/opencv-4.10.0/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64'
 * S: '/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0'
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-05 05:13:41 UTC
```
FAILED: modules/dnn/CMakeFiles/opencv_dnn.dir/src/caffe/caffe_importer.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DCVAPI_EXPORTS -DENABLE_PLUGINS -DHAVE_PROTOBUF=1 -DOPENCV_DNN_EXTERNAL_PROTOBUF=1 -DPROTOBUF_USE_DLLS -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/include -I/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64/modules/dnn -I/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/core/include -I/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/imgproc/include -isystem /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64 -isystem /usr/include/eigen3  -march=native -O2 -pipe   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mf16c -mfma -mavx -mavx2 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -Wno-deprecated -Wno-missing-declarations -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-invalid-offsetof -std=c++17 -fPIC -MD -MT modules/dnn/CMakeFiles/opencv_dnn.dir/src/caffe/caffe_importer.cpp.o -MF modules/dnn/CMakeFiles/opencv_dnn.dir/src/caffe/caffe_importer.cpp.o.d -o modules/dnn/CMakeFiles/opencv_dnn.dir/src/caffe/caffe_importer.cpp.o -c /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp: In member function ‘void cv::dnn::dnn4_v20240521::{anonymous}::CaffeImporter::extractCustomParams(const google::protobuf::UnknownFieldSet&, cv::dnn::dnn4_v20240521::LayerParams&)’:
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp:129:76: error: conversion from ‘google::protobuf::internal::UFSStringView’ {aka ‘std::basic_string_view<char>’} to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
  129 |             std::string fieldName = field.group().field(0).length_delimited();
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp:130:77: error: conversion from ‘google::protobuf::internal::UFSStringView’ {aka ‘std::basic_string_view<char>’} to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
  130 |             std::string fieldValue = field.group().field(1).length_delimited();
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp: In member function ‘void cv::dnn::dnn4_v20240521::{anonymous}::CaffeImporter::addParam(const google::protobuf::Message&, const google::protobuf::FieldDescriptor*, cv::dnn::dnn4_v20240521::LayerParams&)’:
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp:140:46: error: invalid initialization of reference of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} from expression of type ‘google::protobuf::internal::DescriptorStringView’ {aka ‘std::basic_string_view<char>’}
  140 |         const std::string &name = field->name();
      |                                   ~~~~~~~~~~~^~
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp: In member function ‘void cv::dnn::dnn4_v20240521::{anonymous}::CaffeImporter::extractLayerParams(const google::protobuf::Message&, cv::dnn::dnn4_v20240521::LayerParams&, bool)’:
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp:215:57: error: cannot convert ‘google::protobuf::internal::DescriptorStringView’ {aka ‘std::basic_string_view<char>’} to ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’}
  215 |             if (!isInternal && !ends_with_param(fd->name()))
      |                                                 ~~~~~~~~^~
      |                                                         |
      |                                                         google::protobuf::internal::DescriptorStringView {aka std::basic_string_view<char>}
/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/modules/dnn/src/caffe/caffe_importer.cpp:200:59: note:   initializing argument 1 of ‘static bool cv::dnn::dnn4_v20240521::{anonymous}::CaffeImporter::ends_with_param(const std::string&)’
  200 |     inline static bool ends_with_param(const std::string &str)
      |                                        ~~~~~~~~~~~~~~~~~~~^~~
[...]
```
Comment 2 Julien Delquié 2025-04-05 07:43:00 UTC
I have the same issue.
The workaround I found is to downgrade dev-libs/protobuf from 30.2 to 29.4.
Comment 3 Larry the Git Cow gentoo-dev 2025-04-05 08:51:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18e9a63ae313b9e82e8c6da7296c69c9e7de909

commit d18e9a63ae313b9e82e8c6da7296c69c9e7de909
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-05 08:50:41 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-05 08:50:59 +0000

    profiles: mask new protobuf/abseil
    
    Bug: https://bugs.gentoo.org/953138
    Bug: https://bugs.gentoo.org/953140
    Bug: https://bugs.gentoo.org/953141
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/package.mask | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Comment 4 Peter Levine 2025-04-06 01:52:34 UTC
Without having tested yet, it looks like this commit in opencv-4.11.0 should fix it:  https://github.com/opencv/opencv/commit/1db93911aeb65599f22db47d5d39f75bc94a821d
Comment 5 Larry the Git Cow gentoo-dev 2025-04-11 09:49:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa97013dd5f071397f10d9a0762417e800723440

commit fa97013dd5f071397f10d9a0762417e800723440
Author:     Paul Zander <negril.nx+gentoo@gmail.com>
AuthorDate: 2025-04-06 18:56:50 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-11 09:47:06 +0000

    media-libs/opencv: support protobuf-30
    
    Closes: https://bugs.gentoo.org/953138
    Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest             | 1 +
 media-libs/opencv/opencv-4.10.0.ebuild | 3 +++
 2 files changed, 4 insertions(+)