* Wrap bzl_library in a macro so that we can force off some
global attribures that are never appropriate for BUILD files.
Removes:
- *_compatible_with
- features
* cdate
* linty
* linty
* more lint
Allow `bzl_library` to depend on non-`bzl_library` targets
Notably, `filegroup`. `bzl_library` doesn't actually read anything from the `StarlarkLibraryInfo` provider, and requiring all deps to be other `bzl_library` targets is really painful for anyone loading .bzls from `@bazel_tools` or `@platforms` because those core modules/repos don't want a dependency on Skylib just for access to `bzl_library`.
The medium-term plan will be to move `bzl_library` into `@bazel_tools`; but before then, this can serve as a stop-gap.
Co-authored-by: Alexandre Rostovtsev <arostovtsev@google.com>
This improves the error in the case your bzl_library does nothing.
Otherwise you end up with something weirder later:
```
BUILD:35:12: in deps attribute of bzl_library rule LABEL: 'DEP' does not produce any bzl_library deps files (expected .bzl)
```
Ideally we could set `allow_empty = False` on `srcs` but currently it's
valid to just have a bzl_library target that aggregates multiple other
libraries in its deps.
Co-authored-by: Ivo List <ilist@google.com>
* Fix lint issues
- Move the doc string into the `doc` attributes on the rule/attr calls.
- Move the print() below the load() statements.
* Also run buildifier in --lint=fix mode to catch issues on Travis.
Most notably, this renames/moves a few important identifiers:
//:skylark_library.bzl -> //:bzl_library.bzl
skylark_library -> bzl_library
SkylarkLibraryInfo -> StarlarkLibraryInfo