mesonbuild / mesonbuild/wrapdb

protobuf should inherit dependency

Open
#1,386 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Meson
Stars
118
Forks
298
Avg merge
2d 2h
Merged PRs (30d)
24

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open subprojects/packagefiles/protobuf/meson.build around line 217 and inspect how the deps variable is used for protobuf. Confirm the reported generated-code build failure, then verify that protobuf users receive the required Abseil dependencies and that the build completes without the missing-header error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.