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 linking with Protobuf 23 #4104

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Conversation

jkhsjdhjs
Copy link
Contributor

Google introduced abseil as a new dependency of Protobuf, but CMake's FindProtobuf hasn't been updated yet to link with abseil. Thus, CMake is now advised to use the config provided by Protobuf instead of its own. In case no config can be found, we fall back to the old behavior.

The Protobuf version constraint is removed since it only applies with P4C_USE_PREINSTALLED_PROTOBUF=ON anyway, in which case we'll want to use whatever preinstalled version is available.

Furthermore, the variables PROTOBUF_LIBRARY and
PROTOBUF_PROTOC_EXECUTABLE are set correctly so executing protoc and linking with Protobuf doesn't fail.

Fix #4055
See also protocolbuffers/protobuf#12292

Google introduced abseil as a new dependency of Protobuf, but CMake's
FindProtobuf hasn't been updated yet to link with abseil. Thus, CMake is
now advised to use the config provided by Protobuf instead of its own.
In case no config can be found, we fall back to the old behavior.

The Protobuf version constraint is removed since it only applies with
`P4C_USE_PREINSTALLED_PROTOBUF=ON` anyway, in which case we'll want to
use whatever preinstalled version is available.

Furthermore, the variables `PROTOBUF_LIBRARY` and
`PROTOBUF_PROTOC_EXECUTABLE` are set correctly so executing `protoc` and
linking with Protobuf doesn't fail.

Fix p4lang#4055
See also protocolbuffers/protobuf#12292
Copy link
Collaborator

@fruffy fruffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @rst0git @vlstill any concerns from your end? I believe you also supply your own Proto version.

Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jafingerhut
Copy link
Contributor

@jkhsjdhjs Have you already tried going through the steps to have a signed ONF CLA on file, and Github isn't recognizing this?

@jkhsjdhjs
Copy link
Contributor Author

@jafingerhut Yep, I actually signed the CLA before I created this PR, but I only added my email address, not my GitHub username. I thought this would suffice, since the commits also contain the authors email address.
Anyway, I added my GitHub username to the CLA after I noticed that it doesn't work, but I didn't find a way to trigger the check again.

@jafingerhut
Copy link
Contributor

@jkhsjdhjs I have contacted someone at ONF about this issue, to see if they can help determine what is required for your ONF CLA agreement to be recognized.

Copy link
Contributor

@vlstill vlstill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is with the removal of version constraint.

cmake/Protobuf.cmake Show resolved Hide resolved
@jafingerhut
Copy link
Contributor

@jkhsjdhjs Can you please send me an email at andy.fingerhut@gmail.com so we can communicate about the ONF CLA issue? I'd rather not clutter Github issues with such discussion, if it takes a few rounds.

@fruffy
Copy link
Collaborator

fruffy commented Aug 16, 2023

We have merged PRs in the past even though the ONF CLA check failed. I think we can also merge this one.

@jafingerhut
Copy link
Contributor

@fruffy I understand. Since we have this CLA in place, with automated checking mechanisms, and often new contributors have difficulty finding out how to become approved via these automated processes, I would love to get expert ONF staff attention on one particular case, in hopes that we can document any confusing or easily-skipped parts of the process.

@fruffy
Copy link
Collaborator

fruffy commented Aug 16, 2023

@fruffy I understand. Since we have this CLA in place, with automated checking mechanisms, and often new contributors have difficulty finding out how to become approved via these automated processes, I would love to get expert ONF staff attention on one particular case, in hopes that we can document any confusing or easily-skipped parts of the process.

Makes sense. Iirc, there was an additional field with the Github username one had to fill out to get the bot to work. At the bottom of the form.

@jkhsjdhjs
Copy link
Contributor Author

I filled this field with my username and also hit "sign addendum", my GitHub username is definitely part of the CLA. Not sure why it doesn't work, we're still awaiting a reply from the ONF folks.

@fruffy
Copy link
Collaborator

fruffy commented Aug 22, 2023

I filled this field with my username and also hit "sign addendum", my GitHub username is definitely part of the CLA. Not sure why it doesn't work, we're still awaiting a reply from the ONF folks.

Should we just merge this?

@jafingerhut
Copy link
Contributor

I filled this field with my username and also hit "sign addendum", my GitHub username is definitely part of the CLA. Not sure why it doesn't work, we're still awaiting a reply from the ONF folks.

Should we just merge this?

If you do not mind too much, I would like to give ONF staff another week or so to see if the issue with the ONF CLA checker bot can be corrected here (and ideally for anyone else that wants to contribute in the future, if there is something that needs fixing).

@jafingerhut
Copy link
Contributor

But if merging this is blocking any other work, yeah, go ahead and merge and we can use a separate Github issue to track the ONF CLA testing/fixing.

@jkhsjdhjs
Copy link
Contributor Author

Alright, problem's solved. It was a Layer 8 issue: I previously added my GitHub username as @jkhsjdhjs to the CLA, so with an @ in front of it. The correct way is adding it without the @. Sorry!

@fruffy fruffy merged commit 2f628a0 into p4lang:main Aug 24, 2023
16 checks passed
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.

Build errors with Protobuf 23
5 participants