Skip to content

Fix gen-proto.sh paths for the src/ layout - #48

Merged
merlimat merged 1 commit into
oxia-db:mainfrom
merlimat:fix-gen-proto-paths
Oct 4, 2026
Merged

merlimat merged 1 commit into
oxia-db:mainfrom
merlimat:fix-gen-proto-paths

Conversation

@merlimat

@merlimat merlimat commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The proto and the generated code moved under src/, but gen-proto.sh still uses the old paths. Running ./gen-proto.sh from the repo root, as CONTRIBUTING.md says, fails. This affects anyone regenerating the protobuf bindings.

Example

$ uv run ./gen-proto.sh
Could not make proto path relative: oxia/internal/proto/client.proto: No such file or directory

The current script:

python -m grpc.tools.protoc -I. --python_betterproto2_out=oxia/internal/proto oxia/internal/proto/client.proto

Change

The script now uses src as the include root and points at the src/ paths:

python -m grpc.tools.protoc -Isrc --python_betterproto2_out=src/oxia/internal/proto src/oxia/internal/proto/client.proto

The proto's path relative to the include root is still oxia/internal/proto/client.proto. So the generated # sources: header and the package layout don't change. source .venv/bin/activate stays: it does nothing under uv run, but it lets the plain ./gen-proto.sh work after uv sync.

Testing

I ran the script from the repo root, both with uv run --frozen and directly. The regenerated output matches the committed stubs except for the two intentionally hand-edited streaming methods (get_sequence_updates, get_notifications), which return the cancellable call. I restored those after the run.

The proto and generated code moved under src/, but gen-proto.sh still
pointed at oxia/internal/proto, so running it from the repo root as
documented in CONTRIBUTING.md failed with "Could not make proto path
relative".

Use -Isrc and the src/ paths. The proto path relative to the include
root is unchanged, so the generated "# sources:" header stays the same.

Signed-off-by: Matteo Merli <mmerli@apache.org>
@merlimat
merlimat merged commit 593495e into oxia-db:main Oct 4, 2026
6 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.

1 participant