-
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: provide way to run lint in bazel #65518
Conversation
6a127dd
to
0c6ffba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rail)
DEPS.bzl, line 2345 at r1 (raw file):
build_file_proto_mode = "disable_global", importpath = "github.com/knz/go-libedit", patch_args = ["-p1"],
Interesting. Does it mean that you can't have multiple patches with different patch level? Sounds like a flaw in gazelle.
Yeah, it's weird. We haven't had to do too much with these patches so far, so it hasn't affected us. bors r=rail |
Build failed: |
No idea what went wrong, let's try that again. bors r=rail |
bors r- |
Canceled. |
085ebbe
to
984877a
Compare
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
bors r=rail |
Build succeeded: |
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 aswell as all the dependencies that it has (
roachvet
,crlfmt
, andothers). 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 callsinto the compiler in a couple places, and
cgo
wants to link into someof 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