protocol-bufferssubprojectcode-sharing

Including 3rd party protobuffer definition files


I have a project that need to create/read protobuf files generated by other projects.

I want dlprimitives to be able to read files formatted as ONNX protobuf and Caffe protobuf

What is the best way to include them into project:

  1. Copy the files from original repo with readme reference to sources for updates
  2. Make caffe/onnx external sub-projects
  3. Download them on demand upon build

My thoughts:

  1. Is plain copy not sure how is it good for updating
  2. Creates huge subprojects and increases clone time for a single file, since it is impossible to have subproject of a signle file
  3. Assumes that build environment has internet access.

What would be better policy? How is it usually solved?


Solution

  • All of your approaches are valid.

    1. Protocol buffers is by design forward- or backward-compatible, so updating manually is fine. You'll can mitigate the issue by documenting the task or providing a script / task.

    2. External sub-projects is also fine, but you'll still have to update them manually (in the case of git submodules) and handle changed paths in the original project. You'll might want to consider contacting the projects and suggest splitting the format descriptions from the main project.

    3. Usually proxies or caches help in that case. Very few projects build nowadays without external dependencies.

    In the end you should consider what you intended audience is. Maybe you can get some feedback from them how they would use your project?