Skip to content

Commit

Permalink
bazel protobuf: add AttributeDefinition.cfg_is_host
Browse files Browse the repository at this point in the history
It records whether an attribute entails a transition to the "host" configuration.

Ideally we would record more information about the transition, but the
interface seems very abstract and the implementations are varied and
complex (arbitrary function logic). The "host" flag is at least part
of the Java interface, part of the Bazel manual, and part of the
Blaze query interface.

PiperOrigin-RevId: 239320132
  • Loading branch information
Googler authored and copybara-github committed Mar 20, 2019
1 parent 9bd8833 commit fc69ecd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ private static byte[] getBuildLanguageDefinition(RuleClassProvider provider) {
attrPb.setAllowEmpty(!attr.isNonEmpty());
attrPb.setAllowSingleFile(attr.isSingleArtifact());
attrPb.setConfigurable(attr.isConfigurable());
attrPb.setCfgIsHost(attr.getConfigurationTransition().isHostTransition());

// Encode default value, if simple.
Object v = attr.getDefaultValueUnchecked();
Expand Down
3 changes: 2 additions & 1 deletion src/main/protobuf/build.proto
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ message AttributeDefinition {
optional AttributeValue default = 9; // simple (not computed/late-bound) values only
optional bool executable = 10; // type=label
optional bool configurable = 11;
optional bool nodep = 12; // type=label*
optional bool nodep = 12; // label-valued edge does not establish a dependency
optional bool cfg_is_host = 13; // edge entails a transition to "host" configuration
}

// An AttributeValue represents the value of an attribute.
Expand Down

0 comments on commit fc69ecd

Please sign in to comment.