From be49295381b41b4d50f597e12999b25b913c2eb0 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Wed, 30 Mar 2022 10:50:36 -0700 Subject: [PATCH] make: set --//tools/nogo:fast by default nogo:fast is converted to nogo:full with the opposite meaning. All nogo tests have to be always executed with this option. Analyzing Go Standard Library takes about 10 minutes on buildkite, but it is required only to run nogo tests. PiperOrigin-RevId: 438343203 --- Makefile | 2 +- tools/nogo/BUILD | 3 ++- tools/nogo/defs.bzl | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index cda276b4f..4bd5d4537 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ smoke-race-tests: ## Runs a smoke test after build building runsc in race config .PHONY: smoke-race-tests nogo-tests: - @$(call test,--build_tag_filters=nogo --test_tag_filters=nogo //:all pkg/... tools/...) + @$(call test,--build_tag_filters=nogo --test_tag_filters=nogo --//tools/nogo:full //:all pkg/... tools/...) .PHONY: nogo-tests # For unit tests, we take everything in the root, pkg/... and tools/..., and diff --git a/tools/nogo/BUILD b/tools/nogo/BUILD index 09dfec561..844d68a04 100644 --- a/tools/nogo/BUILD +++ b/tools/nogo/BUILD @@ -4,8 +4,9 @@ load("//tools/nogo:defs.bzl", "nogo_stdlib", "nogo_target") package(licenses = ["notice"]) bool_flag( - name = "fast", + name = "full", build_setting_default = False, + visibility = ["//visibility:public"], ) nogo_target( diff --git a/tools/nogo/defs.bzl b/tools/nogo/defs.bzl index 0d9ca6886..bae41e2d6 100644 --- a/tools/nogo/defs.bzl +++ b/tools/nogo/defs.bzl @@ -65,7 +65,7 @@ NogoStdlibInfo = provider( def _nogo_stdlib_impl(ctx): # If this is disabled, return nothing. - if ctx.attr._fast[BuildSettingInfo].value: + if not ctx.attr._nogo_full[BuildSettingInfo].value: return [NogoStdlibInfo( facts = None, raw_findings = [], @@ -123,8 +123,8 @@ nogo_stdlib = go_rule( default = "//tools/nogo:target", cfg = "target", ), - "_fast": attr.label( - default = "//tools/nogo:fast", + "_nogo_full": attr.label( + default = "//tools/nogo:full", cfg = "host", ), }, @@ -419,6 +419,10 @@ nogo_test = rule( default = "//tools/nogo:target", cfg = "target", ), + "_nogo_full": attr.label( + default = "//tools/nogo:full", + cfg = "exec", + ), }, test = True, )