bazel-contrib / bazel-contrib/rules_go

using gofmt and go vet in sh_test rules

Open
#511 14 comments 13 reactions 0 assignees View on GitHub
enhancement go k8s tools
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

We have a few lint-style checks for `gofmt` and `go vet` which are implemented as `sh_test`s. We had a `data` dependency on `@io_bazel_rules_go_toolchain//:toolchain`, which brought `external/io_bazel_rules_go_toolchain/bin` into the runfiles for the test, but with the recent refactoring, the `:toolchain` target no longer exists.

I tried updating this to `:go_toolchain`, but that doesn't seem to include any of the Go toolchain in the test runfiles anymore.

Is there a way we can depend on the Go toolchain from outside the `rules_go` repository? I've tried searching through the changes, but I'm having trouble figuring out if this is supposed to be possible.

cc @spxtr

Contributor guide

Open the contributing guide

Research direction

Start by tracing the sh_test data dependencies and the refactored rules_go toolchain targets, then inspect which runfiles are provided by :go_toolchain from outside the rules_go repository. Done means the gofmt and go vet sh_tests can access the required Go toolchain through a supported external dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.