bazelbuild / bazelbuild/bazel

Regular rules in module extensions

Open
#20,286 4 comments 2 reactions 0 assignees View on GitHub
area-Bzlmod not stale P3 team-ExternalDeps type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

I wrote a proposal. See https://docs.google.com/document/d/1OsEHpsJXXMC9SFAmAh20S42Dbmgdj4cNyYAsFOHMibo/edit#heading=h.kzp6mqja2p3t

Repository rules are described as “a rule that enables non-hermetic operation at the loading phase of bazel”. However, the vast majority of repository rules are not nonhermetic - they are completely hermetic operations that simple happen to output build files.

In theory, there's nothing stopping us from instead using regular rules to generate repositories. I've created a design to do so.

### Which category does this issue belong to?

External Dependency

### What underlying problem are you trying to solve with this feature?

* Can't to execute repo rules on RBE
* Can't depend on regular rules from repo rules
* Can't use toolchains to build binaries in repo rules
* Can't glob in repo rules for your dependencies
* Simplify module extension implementation and make it more familiar with regular rule authors.

### Which operating system are you running Bazel on?

N/A

### What is the output of `bazel info release`?

N/A

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

No. I also discussed this with the bazel team a few weeks ago, and they said this wasn't possible. This is my proposal to make it possible

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Read the linked design proposal first, then locate Bazel's module-extension and repository-rule implementation; the issue names no files or tests. Done would require a reviewed design and an implemented, tested way for regular rules to generate repositories while addressing the listed dependency, RBE, toolchain, and glob constraints.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.