bazelbuild / bazelbuild/bazel

Validate that action mnemonics are string literals - makes allowing custom mnemonics safer

Closed
#23,575 1 comment 0 reactions 0 assignees View on GitHub
team-Starlark-Integration type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

Customizing mnemonic for actions is a useful feature that improves the output for users and also allows build engineers to use features such as `--modify_execution_info` more effectively.

However, to avoid issues related to an explosion of mnemonics (which may cause problems) it was suggested that a safeguard should be added to Bazel to ensure that mnemonics are literals. This prevents users from creating a large number of actions named eg. `"some-name-" + i` in a loop or list comprehension.

Related issue: https://github.com/bazelbuild/bazel-skylib/pull/491

### Which category does this issue belong to?

Starlark Integration

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

Trying to improve safety.

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

_No response_

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

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Research direction

Review Bazel's Starlark Integration handling of custom action mnemonics; the issue names no specific files, tests, or entry points. Define validation that accepts string literals while rejecting computed or loop-generated mnemonic values, then add coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.