Skip to content

libprotobuf cmake fix#132

Draft
maceip wants to merge 1 commit intolittle-bear-labs:mainfrom
maceip:libprotobuf
Draft

libprotobuf cmake fix#132
maceip wants to merge 1 commit intolittle-bear-labs:mainfrom
maceip:libprotobuf

Conversation

@maceip
Copy link

@maceip maceip commented Feb 11, 2025

No description provided.

Copy link
Collaborator

@John-LittleBearLabs John-LittleBearLabs left a comment

Choose a reason for hiding this comment

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

I guess the TL;DR is: how are you managing your protobuf dependency?
I'll make a point to take it into consideration while cleaning up the current mess.

@@ -74,7 +73,7 @@ target_include_directories(ic_proto
)
target_link_libraries(ic_proto
Copy link
Collaborator

Choose a reason for hiding this comment

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

First of all, thanks for your PR!

Secondly, I want to apologize. This codebase is in a transition and there's no way you could've known that. The logical "head" of this target is actually over here at least for now while waiting on an answer about something else...

If I can get my head around your use case and reproduce the issue then I'll move a version of your fix into the place I'll need things to be as I clean up my mess.

Copy link
Author

Choose a reason for hiding this comment

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

my use case was just getting the following to work on ubuntu noble LTS:

cmake -D CMAKE_BUILD_TYPE=Release -D DOWNLOAD_CHROMIUM=TRUE -S ~/ipfs-chromium -B ~/build

Copy link
Author

Choose a reason for hiding this comment

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

cmake --version
cmake version 3.28.3

python3 --version
Python 3.12.3

ldd --version
ldd (Ubuntu GLIBC 2.39-0ubuntu8.4) 2.39

Copy link
Collaborator

Choose a reason for hiding this comment

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

I appreciate the info. Your versions are reasonably close to my own, well within what I intended to support. And that cmake command was definitely intended to work.

find_package(nlohmann_json QUIET REQUIRED CONFIG)
find_package(
Protobuf
${protobuf_version}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would break my workflow - it would allow CMake to find system-installed or Chromium-installed protobuf.

The most important thing is of course that your libprotobuf version matches your protoc version exactly.

Should I assume you're trying not to use conan?

Would it be helpful if we had the version to be passed into the CMake part of the build (which is typically run by conan, but shouldn't have to be) as a variable like cmake -D PROTOBUF_VERSION=5.27.0 ?

Copy link
Author

Choose a reason for hiding this comment

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

i'm using conan. removing the version check might have been unnecessary, the blocker for me was the fix below on line 76

Copy link
Author

Choose a reason for hiding this comment

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

and prob because im using the dev version of protobuf

protoc --version
libprotoc 31.0-dev

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for pointing it out. I think "libprotobuf" is just more correct regardless, but I'll check to make sure it works for me.

Is it OK if I leave this PR open here for a while? You can use your fork for now and after I get my stuff together I'll let you know and we'll see if things work OK for you... sound good?

Copy link
Author

Choose a reason for hiding this comment

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

yeah let's leave it open as things shake out

@maceip maceip marked this pull request as draft February 11, 2025 19:01
target_link_libraries(ic_proto
PUBLIC
protobuf::protobuf
protobuf::libprotobuf
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

2 participants