-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: x/tools/go/analysis/internal/checker: check should accept custom build flags #65776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CC @alandonovan |
This feature is already supported by the unitchecker analysis driver, as shown by this example based on the
This works even with the -vettool flag, which specifies an arbitrary unitchecker-based driver. For example:
So you may be able to use that instead. (Bonus: it's more efficient, because it does an "incremental build", just like You are correct that the {single,multi}checker driver (whose common implementation is internal/checker) does not currently support build tags, even though it declares a non-functional flag named We could revive this flag to support the desired behavior with a small patch such as this:
But it would need some extra care to address alternative go/packages drivers such as Blaze, Bazel, Pants, Buck, and so on; the packages.Config.BuildFlags field doesn't feel like it was designed with portability in mind. |
Proposal Details
checker always load packages with empty BuildFlags. however, analysis code in other build tags are needed
The text was updated successfully, but these errors were encountered: