Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pkg-config protobuf library not dependes from utf8_range #17290

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mdionisio
Copy link

the .pc file generated insert a dependency to a utf8_range.pc file that is not required

@mdionisio mdionisio requested a review from a team as a code owner July 1, 2024 09:17
@mdionisio mdionisio requested review from zhangskz and removed request for a team July 1, 2024 09:17
Copy link

google-cla bot commented Jul 1, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@zhangskz zhangskz requested a review from acozzette July 1, 2024 14:22
@zhangskz zhangskz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 1, 2024
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 1, 2024
@acozzette
Copy link
Member

@mdionisio If I'm not mistaken, we do need this because we rely on utf8_range, like here for example:

return utf8_range::IsStructurallyValid(field.Get());

@mdionisio
Copy link
Author

@acozzette I don't say that utf8_range is not used inside protobuf, I say only that If I use protobuf I don't neet to link my program with utf8_range because all the dependency to utf8_range was statically linked directly inside protobuf library. My change is only on ".pc" that is not used from protobuf but it is used from code that use protobuf.

I test the fix on protobuf 4.25 in yocto environment building and testing code that only used protobuf library and in more complicated example that use grpc.

@acozzette
Copy link
Member

Hmm, I don't think I understand. If we remove utf8_range from the dependencies listed in the .pc file then wouldn't that break most users who rely on the .pc file? If utf8_range was statically linked inside libprotobuf then I assume that must have been a local modification you made?

@mdionisio
Copy link
Author

@acozzette you are probably right. There is also another issue in cmake that doesn't configure protobuf to explicitly link utf8_range. I don't understand exactly why utf8_range was linked anyway.

I update my pull request to fix also that.

@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 8, 2024
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 8, 2024
@zhangskz zhangskz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 10, 2024
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jul 10, 2024
@acozzette
Copy link
Member

@mdionisio Maybe I'm missing something but I think this is still not going to work because it will cause utf8_range to be removed from the .pc file even though it's a required dependency. With this change, I find that pkgconfig --libs protobuf no longer includes the linker flag -lutf8_validity, so I would expect this to break builds.

@mdionisio
Copy link
Author

@acozzette in my opinion the problem is that utf8_range and utf8_validity are configured in .pc to be a required dependency but is not true. In any of .so library there is any required symbol from utf8_range or utf8_validity. In any case I will double check the yocto recipes that build protobuf for me if there is any strange trick for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants