bazelbuild / bazelbuild/bazel

Allow merging Args objects

Open
#6,230 17 comments 0 reactions 0 assignees View on GitHub
not stale P4 team-Local-Exec team-Rules-API type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

Currently if you want to support persistent workers, you must pass a single Args object to your run action. This args file is read and passed as the WorkRequest to the persistent worker. Any other arguments are passed to the persistent worker as launch arguments.

If you build up your arguments in multiple steps into multiple [Args](https://docs.bazel.build/versions/master/skylark/lib/Args.html) objects, there is no way to combine them to end up passing them all in a single object.

### Feature requests: what underlying problem are you trying to solve with this feature?

Currently rules_swift builds up 2 Args objects, one [here](https://github.com/bazelbuild/rules_swift/blob/c8138ccf8cd798aefc9533840fcab72546e4c46c/swift/internal/api.bzl#L676) and another [here](https://github.com/bazelbuild/rules_swift/blob/c8138ccf8cd798aefc9533840fcab72546e4c46c/swift/internal/api.bzl#L471-L479) it then [passes both objects](https://github.com/bazelbuild/rules_swift/blob/c8138ccf8cd798aefc9533840fcab72546e4c46c/swift/internal/api.bzl#L507) to run. It's nice to build these up separately using the Args API, but supporting persistent workers would require combining these, instead of passing them both.

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

macOS

### What's the output of `bazel info release`?

0.17.1

Contributor guide

Open the contributing guide

Research direction

Start by reading the Args API references and the rules_swift call sites in swift/internal/api.bzl, especially the sections around lines 471-479, 507, and 676. Determine how multiple Args objects could be combined for a run action and what persistent-worker behavior must be preserved; done means a single combined object can be passed without losing arguments.

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
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.