Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Error in label: label() got unexpected keyword argument 'single_file' #260

Open
jon-whit opened this issue Dec 9, 2020 · 2 comments

Comments

@jon-whit
Copy link

jon-whit commented Dec 9, 2020

I have a repository structure like this:

api-protos/
  protos/
    BUILD
    pubsub/
      BUILD
      v1alpha2/
        pubsub.proto
        BUILD
  WORKSPACE

In my WORKSPACE file I have this:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
  name = "org_pubref_rules_protobuf",
  remote = "https://github.com/pubref/rules_protobuf",
  tag = "v0.8.2"
)

git_repository(
    name = "org_pubref_rules_node",
    remote = "https://github.com/pubref/rules_node.git",
    tag = "v0.5.0"
)

load("@org_pubref_rules_node//node:rules.bzl", "node_repositories", "yarn_modules")
node_repositories()

load("@org_pubref_rules_protobuf//node:rules.bzl", "node_proto_repositories")
node_proto_repositories()

yarn_modules(
    name = "yarn_modules",
    deps = {
        "google-protobuf": "3.4.0",
        "grpc": "1.6.0"
    },
)

and the protos/pubsub/v1alpha2/BUILD file has:

load("@org_pubref_rules_protobuf//node:rules.bzl", "node_proto_library")

node_proto_library(
    name = "pubsub",
    protos = ["pubsub.proto"],
    verbose = 0,
    with_grpc = True,
)

If I run bazel build //protos/pubsub/v1alpha2:pubsub I get the following error:

DEBUG: Rule 'org_pubref_rules_node' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "c7b9ae3eb2fa75bec2fdd4d188b57ab431796f5d", shallow_since = "1555893501 -0600" and dropping ["tag"]
DEBUG: Repository org_pubref_rules_node instantiated at:
  /..../api-protos/WORKSPACE:9:15: in <toplevel>
Repository rule git_repository defined at:
  /..../external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: Traceback (most recent call last):
	File "/..../external/org_pubref_rules_node/node/internal/yarn_modules.bzl", line 105, column 28, in <toplevel>
		"_node": attr.label(
Error in label: label() got unexpected keyword argument 'single_file'
ERROR: error loading package '': in /..../external/org_pubref_rules_node/node/rules.bzl: Extension file 'node/internal/yarn_modules.bzl' has errors
INFO: Elapsed time: 0.058s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

How do I fix that?

@jon-whit
Copy link
Author

jon-whit commented Dec 9, 2020

It looks like this is mostly an issue of the newer verion of Bazel not supporting things like FileType and allow_single (now allow_single_file) etc..

What's the latest working version of bazel that this repository works with?

@ahashour
Copy link

Hitting the same error? any updates

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

No branches or pull requests

2 participants