Skip to content
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

Confusing documentation on recommended race detector usage #2403

Open
rhomel opened this issue Mar 18, 2020 · 1 comment
Open

Confusing documentation on recommended race detector usage #2403

rhomel opened this issue Mar 18, 2020 · 1 comment

Comments

@rhomel
Copy link

rhomel commented Mar 18, 2020

What version of rules_go are you using?

v0.22.1

What did you do?

I'm just trying to understand the recommended usage for the race detector and go_test.

What did you expect to see?

Consistent documentation and or an explanation behind the recommended usage.

What did you see instead?

The "Using the race detector" subsection of modes.rst recommends the following in regards to using the race detector globally:

but in general it is strongly recommended instead to turn it on for specific tests

https://github.com/bazelbuild/rules_go/blob/v0.22.1/go/modes.rst#using-the-race-detector

However the core.rst documentation for go_test race attribute has the following:

In most cases, it's better to enable race detection globally with --features=race on the command line.

https://github.com/bazelbuild/rules_go/blob/v0.22.1/go/core.rst#go_test

So it would be nice to have an explanation for either or both recommendations.

@jayconrod
Copy link
Contributor

The usage will change with #2219, so I'll hold off on modifying the documentation for now.

In short though, use --features=race when possible. race = "on" should only be set on a go_test or go_binary rule if the test won't build without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants