-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
bazel: add way to run lints w/ bazel-built binaries #61555
Comments
I have a draft commit for this: rickystewart@f8f36b7 Two problems with this:
The problem here is that we haven't appropriately set
Not sure why. We've already determined the |
For point 2, it's either that the lint is working correctly and the compiler is no longer inlining the calls, which would be bad, or that the lint is somehow too fragile with the code paths that it's matching on. I'm guessing it's the latter, since the Bazel sandbox presumably does weird stuff to the paths of generated code. Here's the code that does the path matching: https://github.com/jordanlewis/gcassert/blob/master/gcassert.go Ricky, I'll try to dig into this soon, but realistically it might not be until Friday. Maybe we could poke at it together on a screenshare? |
Hey Jordan -- sure, I'm back in office now, so whenever is fine :) |
filed bazel-contrib/rules_foreign_cc#619 for issues arising from (1). |
My understanding is bazel-contrib/rules_go#2858 (will probably be merged soon) helps with (2), and probably various other Bazel issues as well. |
#65485 for the |
#65517 for remaining issues with |
With this patch, lints can be run with `bazel run build/bazelutil:lint`. The test binary takes the typical Go command-line arguments, so e.g. `bazel run build/bazelutil:lint -- -test.v`. We model this as a `sh_binary` that depends on the lint test binary as well as all the dependencies that it has (`roachvet`, `crlfmt`, and others). The shell script is a light wrapper that finds the actual location of all the dependencies and stages them all in the `PATH` appropriately. We also need to munge `LDFLAGS` because the linter calls into the compiler in a couple places, and `cgo` wants to link into some of the C libraries (`libedit`, `libproj`, etc.) There are a couple tests that are still broken, which are skipped for now. As a next step, we'll want to get this running in CI. Closes cockroachdb#61555 Release note: None
65518: bazel: provide way to run lint in bazel r=rail a=rickystewart With this patch, lints can be run with `bazel run build/bazelutil:lint`. The test binary takes the typical Go command-line arguments, so e.g. `bazel run build/bazelutil:lint -- -test.v`. We model this as a `sh_binary` that depends on the lint test binary as well as all the dependencies that it has (`roachvet`, `crlfmt`, and others). The shell script is a light wrapper that finds the actual location of all the dependencies and stages them all in the `PATH` appropriately. We also need to munge `LDFLAGS` because the linter calls into the compiler in a couple places, and `cgo` wants to link into some of the C libraries (`libedit`, `libproj`, etc.) There are a couple tests that are still broken, which are skipped for now. As a next step, we'll want to get this running in CI. Closes #61555. Release note: None 65678: bazel: fix `pprofui` test in bazel r=rail a=rickystewart We just need to set `HOME` to some value. Also add a couple more `gazelle:resolve` hints. Release note: None (Ignore the bottom commit which comes from #65677.) Co-authored-by: Ricky Stewart <[email protected]>
No description provided.
The text was updated successfully, but these errors were encountered: