You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/buf/internal/plugin.bzl b/buf/internal/plugin.bzl
index 45ee608..50e55a4 100755
--- a/buf/internal/plugin.bzl
+++ b/buf/internal/plugin.bzl
@@ -41,9 +41,14 @@ def protoc_plugin_test(ctx, proto_infos, protoc, plugin, config, files_to_includ
# source is the argument passed to protoc. This is the import path "foo/foo.proto"
# We have to trim the prefix if strip_import_prefix attr is used in proto_library.
- sources.append(
- f.path[len(pi.proto_source_root) + 1:] if f.path.startswith(pi.proto_source_root) else f.path,
- )
+ file_path = f.path
+ if file_path.startswith(pi.proto_source_root):
+ file_path = file_path[len(pi.proto_source_root) + 1:]
+
+ if file_path.startswith(ctx.bin_dir.path):
+ file_path = file_path[len(ctx.bin_dir.path) + 1:]
+
+ sources.append(file_path)
args = ctx.actions.args()
args = args.set_param_file_format("multiline")
Under bazel 7.1, I am seeing the following error when running the buf proto lint tests. Under Bazel 6.4 the same test targets pass.
I think its related to bazelbuild/bazel#21075
I can observe that the args params file that is passed to protoc has the following changes when changing bazel versions:
Bazel 6.4
Bazel 7.1
Note that the last argument has the bazel bin dir prefix whereas it previously did not have this.
The text was updated successfully, but these errors were encountered: