diff options
author | Klaus Aehlig <aehlig@google.com> | 2017-05-29 11:11:00 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-05-29 14:09:03 +0200 |
commit | 88c684c9335f36bd1d804a208fca59b7447d3a32 (patch) | |
tree | f834ed2dded491ac8daa9f5fcf33a5a71da56506 /src | |
parent | 43170513a406405322cc0606dcbf82ed942ae480 (diff) |
BEP: also report make variables
An important part of a configuration are the "make variables", containing
values such as TARGET_CPU. Report them as part of the description of the
configuration.
Change-Id: Id918cc340acac87cf95cc66581345f8060cb4877
PiperOrigin-RevId: 157378950
Diffstat (limited to 'src')
3 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index 44bcbc7857..62307e489c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -2712,13 +2712,12 @@ public final class BuildConfiguration implements BuildEvent { @Override public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventConverters converters) { - return GenericBuildEvent.protoChaining(this) - .setConfiguration( - BuildEventStreamProtos.Configuration.newBuilder() - .setMnemonic(getMnemonic()) - .setPlatformName(getPlatformName()) - .setCpu(getCpu()) - .build()) - .build(); + BuildEventStreamProtos.Configuration.Builder builder = + BuildEventStreamProtos.Configuration.newBuilder() + .setMnemonic(getMnemonic()) + .setPlatformName(getPlatformName()) + .putAllMakeVariable(getMakeEnvironment()) + .setCpu(getCpu()); + return GenericBuildEvent.protoChaining(this).setConfiguration(builder.build()).build(); } } diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index 02f9f2a5f7..6d150d53af 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -268,6 +268,7 @@ message Configuration { string mnemonic = 1; string platform_name = 2; string cpu = 3; + map<string, string> make_variable = 4; } // Payload of the event indicating the expansion of a target pattern. diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh index 6ab1a84029..a4bbffc526 100755 --- a/src/test/shell/integration/build_event_stream_test.sh +++ b/src/test/shell/integration/build_event_stream_test.sh @@ -122,7 +122,7 @@ function test_basic() { # - the command line is reported # - the target_kind is reported # - for single-configuration builds, there is precisely one configuration - # event reported + # event reported; also make variables are shown bazel test --experimental_build_event_text_file=$TEST_log pkg:true \ || fail "bazel test failed" expect_log 'pkg:true' @@ -135,9 +135,11 @@ function test_basic() { expect_log 'SUCCESS' expect_log 'finish_time' expect_not_log 'aborted' - expect_log_once '^configuration ' # target kind for the sh_test expect_log 'target_kind:.*sh' + # configuration reported with make variables + expect_log_once '^configuration ' + expect_log 'key: "TARGET_CPU"' } function test_workspace_status() { |