Skip to content

Conversation

@lia-viam
Copy link
Collaborator

This would have been helpful for recent work updating the GetImages stuff, but building against local protos has been broken for a while. The surface issue was that the BUF_VIAM_API_SOURCE was pointing to a directory that did not have a buf.yaml, and hence was not specifying the dependency on googleapis, but the larger issue is that this directory was empty because the Viam API repo had migrated to buf v2 which places everything in the project root, and C++ SDK was still using v1.

Hence migrate to v2, which as a corollary both fixes and considerably simplifies local proto generation. Basically v2 modifies the yaml syntax somewhat and favors putting buf.yaml and buf.lock in the project root. Note that buf.work.yaml is not a thing in v2: https://buf.build/docs/migration-guides/migrate-v2-config-files/#bufyaml-modules-and-workspaces so it's only necessary to point buf at the API repo root. I added a TODO comment saying this may obviate the sibling repo structure requirement as well.

Tested locally by building a default configuration and with VIAMCPPSDK_USE_LOCAL_PROTOS=1, and also building the target update-static-protos which suggests that this change should not break the proto update workflow, but if it does we probably won't know til it happens

@lia-viam lia-viam requested review from acmorrow and stuqdog January 14, 2026 19:33
@lia-viam lia-viam requested a review from a team as a code owner January 14, 2026 19:33
@lia-viam lia-viam requested review from njooma and removed request for a team January 14, 2026 19:33
Copy link
Member

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

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

LGTM if all the different modes still work. TBH I'm a little sad to see the buf stuff suddenly pop to the top of the repo: I sort of liked that it was tucked away down in the only part of the tree that cared about proto generation. However, a working infrastructure for building against local proto changes clearly trumps my desire for project root hygiene.

If you have a minute, could you possibly update my wiki page on how to build against local API changes to reflect the new reality?

@lia-viam
Copy link
Collaborator Author

@acmorrow yes, will update the wiki once this is merged! I agree about cluttering the top of the repo, definitely not my preference either.

@lia-viam lia-viam merged commit 1b8c81a into viamrobotics:main Jan 16, 2026
5 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.

2 participants