question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[protobuf] protoc binary is missing in package

See original GitHub issue

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: protobuf/3.9.1
  • Operating System+version: Debian 9 (stretch) amd64
  • Compiler+version: gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
  • Conan version: conan 1.18.5
  • Python version: Python 3.5.3

Steps to reproduce (Include if Applicable)

conan install protobuf/3.9.1@ -o protobuf:shared=True -o protobuf:lite=False
$ find ~/.conan/data/protobuf/3.9.1/_/_/package/b956615a2d7a652db3d8c889cd2ba264be9600c7/ -name protoc
$

Looks like recipe setups building of binaries:

https://github.com/conan-io/conan-center-index/blob/a34458e886d2b5c1d0e3a091a559d281644631d5/recipes/protobuf/3.9.x/conanfile.py#L57

Though final package does not have them.

Discovered while attempting to package Google ortools, and it seems it needs protoc in build step: https://github.com/google/or-tools/blob/1da80508ba813ab44c1ebdedc1b37f301615df53/cmake/cpp.cmake#L157

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
uilianriescommented, Sep 30, 2019

Hi @Talkless !

As you know protobuf is not only a lib, but a union of .proto files parse, cmake macros and library. If you are building your project for the same architecture (host and target), so there is no problem keeping both artifacts at same package. However, if you need to cross-compile protobuf the things are different:

  • protoc (proto files parser) needs to be built for your host target (e.g. x64)
  • protobuf libs needs to be built for your target arch (e.g. ARM)

But how could deal with we need different binaries on same package? We can’t, so we have 2 packages for protobuf:

  • protoc/3.9.1: Only the protoc
  • protobuf/3.9.1: Only libs

So, if your project needs the protoc, you need to include the package protoc/3.9.1 as build_requires. It will process your proto files, and will be installed following your host arch.

Now about the CMake macros … Here we have a trick, because we can’t distribute Findprotobuf.cmake twice since CMake won’t load on the second time. So the protoc package has the Cmake file Findprotoc.cmake, this one is responsible by that magic macros for cmake.

0reactions
Talklesscommented, Oct 1, 2019

Thanks @uilianries

Read more comments on GitHub >

github_iconTop Results From Across the Web

protoc: command not found (Linux) - Stack Overflow
I downloaded the pre-compiled from github. When I try to compile my .proto file or just check the protobuf version, it says. protoc:...
Read more >
Installing protoc | proto-lens - Google - GitHub Pages
In order to build Haskell packages with proto-lens , the Google protobuf compiler (which is a standalone binary named protoc ) needs to...
Read more >
Protocol Buffer Compiler Installation - gRPC
How to install the protocol buffer compiler. Contents. Install using a package manager; Install pre-compiled binaries (any OS); Other installation options ...
Read more >
Language Guide (proto3) | Protocol Buffers - Google Developers
These field numbers are used to identify your fields in the message binary format, and should not be changed once your message type...
Read more >
google-protobuf - Protocol Buffers - npm
proto files into .js files. The compiler is not currently available via npm, but you can download a pre-built binary on GitHub (look...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found