Bug 497034 - Compile error with Protobuf 29
Summary: Compile error with Protobuf 29
Status: RESOLVED FIXED
Alias: None
Product: KPublicTransport
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 24.08.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Volker Krause
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-04 11:27 UTC by Fabio
Modified: 2024-12-04 16:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio 2024-12-04 11:27:11 UTC
SUMMARY

Trying to compile KPublicTransport 24.08.3 using protobuf 29 causes the following error:

[  9%] Building CXX object src/osm/io/CMakeFiles/KOSM_pbfioplugin.dir/__/osmpbfparser.cpp.o
In file included from /usr/include/absl/log/internal/vlog_config.h:37,
                 from /usr/include/absl/log/absl_vlog_is_on.h:61,
                 from /usr/include/absl/log/internal/log_impl.h:18,
                 from /usr/include/absl/log/absl_log.h:36,
                 from /usr/include/google/protobuf/io/coded_stream.h:107,
                 from /tmp/kde_build/applications/kpublictransport-24.08.3/cmake-build/src/osm/io/fileformat.pb.h:20,
                 from /tmp/kde_build/applications/kpublictransport-24.08.3/src/osm/osmpbfparser.cpp:9:
/usr/include/google/protobuf/message_lite.h: In instantiation of ‘MessageLite* google::protobuf::internal::MessageCreator::PlacementNew(const MessageLite*, const MessageLite*, void*, google::protobuf::Arena*) const [with bool test_call = false; MessageLite = google::protobuf::MessageLite]’:
/usr/include/google/protobuf/message_lite.h:415:40:   required from here
  415 |     return message_creator.PlacementNew(prototype, prototype, mem, arena);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/message_lite.h:1202:7: error: ambiguous overload for ‘operator<’ (operand types are ‘const google::protobuf::internal::MessageCreator::Tag’ and ‘int’)
 1202 |   if (ABSL_PREDICT_FALSE(kMustBeFunc || as_tag < 0)) {
      |       ^~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/message_lite.h:1202:7: note: candidate: ‘operator<(int, int)’ (built-in)
In file included from /tmp/kde_build/applications/kpublictransport-24.08.3/src/osm/osmpbfparser.h:11,
                 from /tmp/kde_build/applications/kpublictransport-24.08.3/src/osm/osmpbfparser.cpp:7:
/tmp/kde_build/applications/kpublictransport-24.08.3/src/osm/datatypes.h:464:13: note: candidate: ‘bool OSM::operator<(const Elem&, Id) [with Elem = google::protobuf::internal::MessageCreator::Tag; Id = long int]’
  464 | inline bool operator<(const Elem &elem, Id id)
      |             ^~~~~~~~
make[2]: *** [src/osm/io/CMakeFiles/KOSM_pbfioplugin.dir/build.make:157: src/osm/io/CMakeFiles/KOSM_pbfioplugin.dir/__/osmpbfparser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:780: src/osm/io/CMakeFiles/KOSM_pbfioplugin.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Slackware64-current
KDE Plasma Version: 6.2.4
KDE Frameworks Version:  6.8.0
Qt Version: 6.8.1
Comment 1 Volker Krause 2024-12-04 16:15:50 UTC
Git commit 66422b8ffee43fc4bf32bdb6beb833eb0b2af5be by Volker Krause.
Committed on 04/12/2024 at 16:15.
Pushed by vkrause into branch 'master'.

Sync OSM data types from KOSMIndoorMap

Among other things this removes a too aggressive operator overload that
can cause build issues.

M  +1    -1    src/generator/generator.cpp
M  +2    -2    src/osm/datatypes.cpp
M  +115  -48   src/osm/datatypes.h
M  +4    -4    src/osm/element.cpp
M  +1    -1    src/osm/element.h

https://invent.kde.org/libraries/kpublictransport/-/commit/66422b8ffee43fc4bf32bdb6beb833eb0b2af5be
Comment 2 Fabio 2024-12-04 16:34:08 UTC
I confirm the commit fixes the compilation issue. Thank you!
Comment 3 Volker Krause 2024-12-04 16:35:24 UTC
Git commit 7dac01fb8147784803ee086232a0be1117c762ab by Volker Krause.
Committed on 04/12/2024 at 16:35.
Pushed by vkrause into branch 'release/24.12'.

Sync OSM data types from KOSMIndoorMap

Among other things this removes a too aggressive operator overload that
can cause build issues.
(cherry picked from commit 66422b8ffee43fc4bf32bdb6beb833eb0b2af5be)

M  +1    -1    src/generator/generator.cpp
M  +2    -2    src/osm/datatypes.cpp
M  +115  -48   src/osm/datatypes.h
M  +4    -4    src/osm/element.cpp
M  +1    -1    src/osm/element.h

https://invent.kde.org/libraries/kpublictransport/-/commit/7dac01fb8147784803ee086232a0be1117c762ab