pubref/rules_protobuf

name 'FileType' is not defined

firstprayer opened this issue · 2 comments

Got an error saying "name 'FileType' is not defined"

$ bazel build :all  # In the root directory of this project
Starting local Bazel server and connecting to it...
ERROR: /Users/taiyuanz/Projects/rules_protobuf/protobuf/internal/proto_compile.bzl:745:21: name 'FileType' is not defined
ERROR: error loading package '': in /Users/taiyuanz/Projects/rules_protobuf/protobuf/rules.bzl: Extension 'protobuf/internal/proto_compile.bzl' has errors
ERROR: error loading package '': in /Users/taiyuanz/Projects/rules_protobuf/protobuf/rules.bzl: Extension 'protobuf/internal/proto_compile.bzl' has errors
INFO: Elapsed time: 1.751s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
    Fetching @bazel_tools; Restarting.

The following patch should help

diff --git a/protobuf/internal/proto_compile.bzl b/protobuf/internal/proto_compile.bzl
index e48ce45..3512f59 100644
--- a/protobuf/internal/proto_compile.bzl
+++ b/protobuf/internal/proto_compile.bzl
@@ -742,7 +742,7 @@ proto_compile = rule(
       mandatory = False,
     ),
     "protos": attr.label_list(
-      allow_files = FileType([".proto"]),
+      allow_files = [".proto"],
     ),
     "includes": attr.string_list(),
     "excludes": attr.string_list(),

having the same problem