bazelbuild / bazelbuild/bazel

Generic `--host_opt` flag

Open
#13,048 3 comments 1 reaction 0 assignees View on GitHub
not stale P2 team-Configurability type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

One thing we see come up a lot is needing to pass options that we pass to our build differently for the host configuration. In some cases bazel has a flag for this like `--host_swiftcopt` / `--swiftcopt` etc. In other cases, for whatever reason, bazel does not yet have a flag for the use case, such as https://github.com/bazelbuild/bazel/pull/13001 or `--host_features` and how `--features` applies everywhere.

I think it would be useful for there to be a generic `--host_opt` flag with syntax such as `--host_opt=--normal_opt=value` that allowed you to pass through arbitrary bazel options to the host configuration.

This opens the door for much more API usage for the host configuration, but I think that could be preferred to the trade off of trying to add a host flag for ever applicable option.

Contributor guide

Open the contributing guide

Research direction

Review the existing --host_swiftcopt/--swiftcopt and --host_features/--features behavior, along with Bazel's option parsing and host-configuration handling. Done means the proposed --host_opt=--normal_opt=value syntax is defined, arbitrary supported options can be passed to the host configuration, and behavior is covered by appropriate 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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.