bazelbuild / bazelbuild/bazel

Documentation: upgrade rule() code samples from deprecated outputs attribute

Open
#15,643 0 comments 2 reactions 0 assignees View on GitHub
help wanted P3 team-Documentation team-Rules-API type: documentation (cleanup)
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

Code samples from https://bazel.build/rules/rules#using_the_validations_output_group include

```
rule_with_validation = rule(
implementation = _rule_with_validation_impl,
outputs = {
...
```

but according to https://bazel.build/rules/lib/globals#rule, `output` is deprecated and is disabled with `-incompatible_no_rule_outputs_param`.

Also for `This parameter has been deprecated. Migrate rules to use OutputGroupInfo or attr.output instead.`, let's link to further details / examples.

Let's have doc examples use current best practices.

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

_No response_

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

_No response_

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

_No response_

### 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?

https://github.com/bazelbuild/bazel/issues/7977

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

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the examples on the rules documentation page and compare them with the rule() reference linked in the issue. Update the deprecated outputs examples to current best practices, and add links to further details or examples for the deprecation guidance.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.