bazel-contrib / bazel-contrib/rules_go
GoStdLib is slow with remote caching / execution
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
### What version of rules_go are you using?
Upgrading from 0.19.1 to 0.19.2+
### What version of gazelle are you using?
0.18.1
### What version of Bazel are you using?
0.28.1
### Does this issue reproduce with the latest releases of all the above?
Yes
### What operating system and processor architecture are you using?
Linux EC2 instance c5.large
### Any other potentially useful information about your toolchain?
rules_docker 0.7.0
Remote caching to Google storage bucket turned on
### What did you do?
Using go_image to build the following:
```
go_image(
name = "image",
embed = ["@com_github_traum_ferienwohnungen_conntrack_stats_exporter//:go_default_library"],
base = ":base",
goarch = "amd64",
goos = "linux",
pure = "on",
)
```
results in a build time approaching 20 minutes
`[55 / 78] GoStdlib external/io_bazel_rules_go/linux_amd64_pure_stripped/stdlib%/pkg; 1166s remote-cache, linux-sandbox`
but only when using rules_go to higher than 0.19.1. Using 0.19.1, stdlib takes only about 10s.
What changed between releases that could cause this?
Contributor guide
Research direction
Start with the go_image target and its GoStdlib action, reproducing the build on Linux with remote caching enabled. Compare rules_go 0.19.1 against 0.19.2 and later using the versions and Bazel configuration in the report; done means the regression is explained and the excessive stdlib build time is addressed or documented with a confirmed cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100