From 4c902d696ad0a0c558f57a2de3acebde1436d631 Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Wed, 2 Nov 2022 14:17:15 -0400 Subject: [PATCH] bp2build for tidy_timeout_srcs Bug: 195029134 Test: m bp2build Change-Id: I59fdc16d8c224f42167e3b5a3857f4ff2f546825 --- bp2build/cc_library_conversion_test.go | 2 ++ cc/bp2build.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go index 99d806cf7..4c86374b5 100644 --- a/bp2build/cc_library_conversion_test.go +++ b/bp2build/cc_library_conversion_test.go @@ -3522,6 +3522,7 @@ cc_library_static { tidy_checks: ["check1", "check2"], tidy_checks_as_errors: ["check1error", "check2error"], tidy_disabled_srcs: ["bar.cpp"], + tidy_timeout_srcs: ["baz.cpp"], }`, ExpectedBazelTargets: []string{ MakeBazelTarget("cc_library_static", "foo", AttrNameToString{ @@ -3537,6 +3538,7 @@ cc_library_static { "check2error", ]`, "tidy_disabled_srcs": `["bar.cpp"]`, + "tidy_timeout_srcs": `["baz.cpp"]`, }), }, }) diff --git a/cc/bp2build.go b/cc/bp2build.go index 07e3d7f16..6caa85422 100644 --- a/cc/bp2build.go +++ b/cc/bp2build.go @@ -76,7 +76,7 @@ type tidyAttributes struct { Tidy_checks []string Tidy_checks_as_errors []string Tidy_disabled_srcs bazel.LabelListAttribute - // TODO(b/255754964) support Tidy_timeout_srcs + Tidy_timeout_srcs bazel.LabelListAttribute } func (m *Module) convertTidyAttributes(ctx android.BaseMutatorContext, moduleAttrs *tidyAttributes) { @@ -89,13 +89,14 @@ func (m *Module) convertTidyAttributes(ctx android.BaseMutatorContext, moduleAtt } } - archVariantProps := m.GetArchVariantProperties(ctx, &BaseCompilerProperties{}) for axis, configToProps := range archVariantProps { for config, _props := range configToProps { if archProps, ok := _props.(*BaseCompilerProperties); ok { archDisabledSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_disabled_srcs) moduleAttrs.Tidy_disabled_srcs.SetSelectValue(axis, config, archDisabledSrcs) + archTimeoutSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_timeout_srcs) + moduleAttrs.Tidy_timeout_srcs.SetSelectValue(axis, config, archTimeoutSrcs) } } }