bazelbuild / bazelbuild/bazel

Add support for .bazelrc contents that represent a combination of configurations

Open
#22,931 0 comments 1 reaction 0 assignees View on GitHub
team-Core type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

Today if you have custom configurations that in your .bazelrc such as `--config=ci` which translates to enabling all `build:ci --whatever` lines, you can easily support logical OR statements such as `--config=ci --config=remote`:

```
build:ci --option1
build:remote --option1
```

Where you can make either config enable some set of options. Alternatively you can split out the shared options into a single shared config:

```
build:shared --option1
build:ci --config=shared
build:remote --config=shared
```

This is great for the logical OR case, but there isn't a way to do this for the logical AND case.

I propose we add support for a new combination in the `.bazelrc` file such as:

```
build:ci,remote
```

Where the option is only enabled when _both_ `--config=ci` and `--config=remote` are passed.

I'm interested to hear about folks interest in something like this

Contributor guide

Open the contributing guide

Research direction

Start by locating Bazel's .bazelrc configuration parsing and existing --config handling; the issue names no source file or test. Review how configuration combinations are represented, then define tests for build:ci,remote requiring both configurations and for its interaction with existing configuration syntax. Done means the proposed combination is supported and covered by tests.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.