bazelbuild / bazelbuild/bazel

Multi-arg parameter file arg format strings

Open
#26,030 2 comments 0 reactions 0 assignees View on GitHub
P4 stale team-Rules-API type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the feature request:

At present, `Args.use_param_file` in starlark takes a single format string as the means of encoding how to tell a tool that it's spilled args into a parameter file. This works great for syntaxes with prefix characters like `@params` or flags supporting = characters like `--file=params`, but it doesn't work for syntaxes which need multiple args, such as `-e params`. Perhaps this function could optionally take a list of strings to support this.

### Which category does this issue belong to?

Rules API

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

The `unsquashfs` tool can take a list of paths to extract in the form of individual command line args or in the form of a file named after the `-e` command line flag. That is, these two are equivalent:

```
unsquashfs foo.squash bar baz
```
```
echo -e 'bar\nbaz' > params
unsquashfs foo.squash -e params
```

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

Ubuntu 20.04

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

6.5.0

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

```text

```

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

I filed this after a slack conversation indicating it would be a good RFE.

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

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the Args.use_param_file Starlark API and trace how its format string is converted into command-line arguments. Check the existing tests for parameter-file argument formatting, then add coverage for a multi-argument form such as -e params. Done means callers can express both single-format and multi-argument syntaxes without breaking existing behavior.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.