Skip to content

[feature request] Consider moving bzl_library.bzl into @bazel_tools #18391

Open
@jmillikin

Description

@jmillikin

Description of the feature request:

Skylib's bzl_library.bzl provides a StarlarkLibraryInfo provider and bzl_library rule, which are used for aggregating .bzl rules files for use by other analysis tools.

The definition of that provider and rule are quite stable (basically unchanged since 2018), and it has no dependencies on any other part of skylib.

The natural way to use that file is to load it from every BUILD file in a ruleset, like this:

# rules_example/example/BUILD
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

bzl_library(
    name = "bzl_srcs",
    srcs = ["defs.bzl", "repository.bzl", "toolchain.bzl"],
    deps = ["//example/internal:bzl_srcs"],
)

However, since the load needs to fetch skylib before evaluation continues, this means that skylib becomes a hard dependency for every client of the ruleset.

Given that the bzl_library.bzl file is generic, broadly useful, and very stable, could it be bundled into @bazel_tools instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)team-Rules-APIAPI for writing rules/aspects: providers, runfiles, actions, artifactstype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions