gvisor/tools/nogo
Adin Scannell 3817c7349d Remove go_tool_library references.
This is required only for the built-in bazel nogo functionality.
Since we roll these targets manually via the wrappers, we don't need
to use go_tool_library. The inconsistent use of these targets leads
to conflicting instantiations of go_default_library and go_tool_library,
which both contain the same output files.

PiperOrigin-RevId: 355184975
2021-02-02 09:37:09 -08:00
..
check Add nogo configuration. 2020-10-26 11:11:46 -07:00
filter Remove existing nogo exceptions. 2020-12-11 12:06:49 -08:00
BUILD Remove go_tool_library references. 2021-02-02 09:37:09 -08:00
README.md Add internal nogo analysis & checkescape tool. 2020-04-20 20:58:20 -07:00
analyzers.go Add nogo configuration. 2020-10-26 11:11:46 -07:00
build.go Add nogo configuration. 2020-10-26 11:11:46 -07:00
config-schema.json Add YAML validation for configuration files. 2021-01-05 10:43:04 -08:00
config.go Add nogo configuration. 2020-10-26 11:11:46 -07:00
defs.bzl Remove go_tool_library references. 2021-02-02 09:37:09 -08:00
findings.go Add nogo configuration. 2020-10-26 11:11:46 -07:00
nogo.go Add nogo configuration. 2020-10-26 11:11:46 -07:00

README.md

Extended "nogo" analysis

This package provides a build aspect that perform nogo analysis. This will be automatically injected to all relevant libraries when using the default go_binary and go_library rules.

It exists for several reasons.

  • The default nogo provided by bazel is insufficient with respect to the possibility of binary analysis. This package allows us to analyze the generated binary in addition to using the standard analyzers.

  • The configuration provided in this package is much richer than the standard nogo JSON blob. Specifically, it allows us to exclude specific structures from the composite rules (such as the Ranges that are common with the set types).

  • The bazel version of nogo is run directly against the go_library and go_binary targets, meaning that any change to the configuration requires a rebuild from scratch (for some reason included all C++ source files in the process). Using an aspect is more efficient in this regard.

  • The checks supported by this package are exported as tests, which makes it easier to reason about and plumb into the build system.

  • For uninteresting reasons, it is impossible to integrate the default nogo analyzer provided by bazel with internal Google tooling. To provide a consistent experience, this package allows those systems to be unified.

To use this package, import nogo_test from defs.bzl and add a single dependency which is a go_binary or go_library rule.