Deprecated ctx.outputs.executable used in rules/test_rule

Open
#151 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by opening line_length.bzl and reading the linked Bazel documentation for ctx.outputs and DefaultInfo. Confirm how the rule currently produces its executable, then update the deprecated usage while preserving the example's behavior; done means the example still builds successfully.

Written by the indexing model from the issue text.

Description

In line_length.bzl:

ctx.actions.write(
    output = ctx.outputs.executable,
    content = script,
)

Notice that ctx.outputs.executable default field is used, and the documentation states this is deprecated:

(Deprecated) If the rule is marked executable or test, there is a field named "executable", which is the default executable. It is recommended that instead of using this, you pass another file (either predeclared or not) to the executable arg of DefaultInfo.

Dominant language
Starlark
Stars
957
Forks
578
Avg merge
2d 10h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/examples

All issues in bazelbuild/examples

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.