Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Some rules will be incompatible with Bazel 0.27 #56

Closed
apt-itude opened this issue Jun 4, 2019 · 0 comments · Fixed by #57
Closed

Some rules will be incompatible with Bazel 0.27 #56

apt-itude opened this issue Jun 4, 2019 · 0 comments · Fixed by #57

Comments

@apt-itude
Copy link
Contributor

The use of the the single_file attribute is deprecated and should be replaced by allow_single_file (see bazelbuild/bazel#5818).

Certain rules such as npm_packages still use this attribute, so building produces this error:

ERROR: /Users/athompson/.cache/bazel/_bazel_athompson/13d84619eb7379140847c87225e1148e/external/bazel_javascript/internal/npm_packages/rule.bzl:38:25: Traceback (most recent call last):
    File "/Users/athompson/.cache/bazel/_bazel_athompson/13d84619eb7379140847c87225e1148e/external/bazel_javascript/internal/npm_packages/rule.bzl", line 36
        rule(attrs = {"package_json": attr.la..."))}, <2 more arguments>)
    File "/Users/athompson/.cache/bazel/_bazel_athompson/13d84619eb7379140847c87225e1148e/external/bazel_javascript/internal/npm_packages/rule.bzl", line 38, in rule
        attr.label(allow_files = True, single_file = ..., ...)
'single_file' is no longer supported. use allow_single_file instead. You can use --incompatible_disable_deprecated_attr_params=false to temporarily disable this check.

This is not a dealbreaker for the time being since Bazel 0.27 has not even been release yet and the --incompatible_disable_deprecated_attr_params flag will allow us to disable that check if we need to, but I just wanted to get ahead of it.

The issue linked above claims that these attributes can be automatically fixed using buildifier --lint=fix, so that may be all that's necessary.

apt-itude added a commit to 128technology/bazel-javascript that referenced this issue Jun 5, 2019
@fwouts fwouts closed this as completed in #57 Jun 6, 2019
fwouts pushed a commit that referenced this issue Jun 6, 2019
Fixes #56

This change is the result of running buildifier --lint=fix on all Starlark and BUILD files, which automatically changed all usages of the single_file and allow_files attributes to allow_single_file. This avoids the need to pass --incompatible_disable_deprecated_attr_params when Bazel 0.27 becomes available.

It also cleaned up a few load statements as a side effect.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant