You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building protobuf and abseil from wrapdb, and then compiling generated code, one can encounter an error: clang++ -stdlib=libc++ -Iproto/libhs_proto_lib.a.p -Iproto -I../proto -Isubprojects/protobuf-25.2/src -I../subprojects/protobuf-25.2/src -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++20 -O0 -g -stdlib=libc++ -fexperimental-library -pedantic -fPIC -MD -MQ proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -MF proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o.d -o proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -c proto/libhs_proto_lib.a.p/city/improvements.pb.cc In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.cc:4: In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.h:26: ../subprojects/protobuf-25.2/src/google/protobuf/io/coded_stream.h:109:10: fatal error: 'absl/log/absl_check.h' file not found #include "absl/log/absl_check.h" ^~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
The reason for this error is that protobuf headers require abseil and protobuf marks abseil as dependency. However, this dependency is not forwarded to the users of protobuf dep. Protobuf can build itself without problems, but when my file includes coded_stream.h it can't find abseil headers.
When building protobuf and abseil from wrapdb, and then compiling generated code, one can encounter an error:
clang++ -stdlib=libc++ -Iproto/libhs_proto_lib.a.p -Iproto -I../proto -Isubprojects/protobuf-25.2/src -I../subprojects/protobuf-25.2/src -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++20 -O0 -g -stdlib=libc++ -fexperimental-library -pedantic -fPIC -MD -MQ proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -MF proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o.d -o proto/libhs_proto_lib.a.p/meson-generated_city_improvements.pb.cc.o -c proto/libhs_proto_lib.a.p/city/improvements.pb.cc In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.cc:4: In file included from proto/libhs_proto_lib.a.p/city/improvements.pb.h:26: ../subprojects/protobuf-25.2/src/google/protobuf/io/coded_stream.h:109:10: fatal error: 'absl/log/absl_check.h' file not found #include "absl/log/absl_check.h" ^~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
The reason for this error is that protobuf headers require abseil and protobuf marks abseil as dependency. However, this dependency is not forwarded to the users of protobuf dep. Protobuf can build itself without problems, but when my file includes coded_stream.h it can't find abseil headers.
I think you should add here: https://github.com/mesonbuild/wrapdb/blob/master/subprojects/packagefiles/protobuf/meson.build#L217
a line
dependencies: deps,
variable deps contains abseil dependencies and this way those abseil deps will be forwarded to protobuf users.
I checked this fix in my repo.
The text was updated successfully, but these errors were encountered: