Open tmc opened 2 years ago
Not only that. All dependencies through buf show up as "x.proto not found" which is very annoying
At the very least, there should be either documentation or configuration to search for proto files in buf's cache. I'm using the following stanza in my specific environment (Windows 11 Remote WSL Debian), and it seems to be working well, but YMMV:
"protoc": {
"options": [
"--proto_path=${workspaceFolder}",
"--proto_path=${userHome}/.cache/buf/v1/module/data/",
]
}
Update: I've moved to trunk.io
"--proto_path=${userHome}/.cache/buf/v1/module/data/",
FYI - we're in the progress of releasing support for a newer cache format which uses content addressable storage, so this workaround won't work for long. In general, the Buf CLI cache folder format is subject to change and should be considered an internal implementation detail.
Found workaround. Run this to vendor deps into local dir (e.g. ~/.local/proto):
yq '.deps' buf.yaml | sed 's|^-*||' | xargs -I {} buf export {} --output $PROTO_VENDOR_DIR
And add to .vscode/settings.json
:
"protoc": {
"options": [
"--proto_path=$PROTO_VENDOR_DIR"
]
}
Buf has emerged as a major player for improving protobuf development -- optionally leaning on it for things like formatting or linting could be quite helpful.