Skip to content

bazel: handle generated protos from external repos#45

Merged
aviator-app[bot] merged 2 commits intomainfrom
rjh.cross-repo
Feb 16, 2026
Merged

bazel: handle generated protos from external repos#45
aviator-app[bot] merged 2 commits intomainfrom
rjh.cross-repo

Conversation

@rjhuijsman
Copy link
Contributor

When pyprotoc is used through an external repository, generated proto files can arrive with a path/short_path mismatch:

  • path: bazel-out/.../external//...
  • short_path: ..//...

The previous logic in rules.bzl did not match this shape and fell through to "Handling this type of (generated?) .proto file was not forseen".

This commit adds a narrow branch in the existing proto loop to normalize this short_path form to a repo-relative path and emit the corresponding -I + input proto args.

This keeps existing behavior for local files, external source files, and _virtual_imports, while fixing generated protos from external repos.

@aviator-app
Copy link

aviator-app bot commented Feb 13, 2026

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@rjhuijsman rjhuijsman changed the base branch from main to rjh.revert-bazel7 February 13, 2026 14:20
Base automatically changed from rjh.revert-bazel7 to main February 13, 2026 14:23
@rjhuijsman rjhuijsman force-pushed the rjh.cross-repo branch 2 times, most recently from 1831d93 to 5f602a1 Compare February 13, 2026 14:47
When pyprotoc is used through an external
repository, generated proto files can arrive with
a path/short_path mismatch:

- path: bazel-out/.../external/<repo>/...
- short_path: ../<repo>/...

The previous logic in `rules.bzl` did not match
this shape and fell through to "Handling this type
of (generated?) .proto file was not forseen".

This commit adds a narrow branch in the existing
proto loop to normalize this short_path form to a
repo-relative path and emit the corresponding `-I`
+ input proto args.

This keeps existing behavior for local files,
external source files, and `_virtual_imports`,
while fixing generated protos from external repos.
Now that we've been able to use the UI to remove the stale check-requirements, we can reintroduce the file-based config.
@aviator-app aviator-app bot merged commit 813d325 into main Feb 16, 2026
3 checks passed
@aviator-app aviator-app bot deleted the rjh.cross-repo branch February 16, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments