Closed jbedard closed 2 weeks ago
I will try to create a PR next week if I find some time. Do you know how to deduce the -repo_config
path of the top of your head?
I can also add that this is not a problem with bzlmod and rules_go when you use go mod vendor
for all depedencies. It only manifests when we remove vendoring and use:
# MODULE.bazel
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
I will try to create a PR next week if I find some time. Do you know how to deduce the
-repo_config
path of the top of your head?
Hmm, this is more complicated than I first thought. Does aspect configure
need to run bazel first to generate the gazelle~~go_deps~bazel_gazelle_go_repository_config/WORKSPACE
repository that contains the go_repository(...)
declarations?
The WORKSPACE
files looks something like that:
go_repository(
name = "@gazelle~",
importpath = "github.com/bazelbuild/bazel-gazelle",
module_name = "gazelle",
)
go_repository(
name = "@rules_go~",
importpath = "github.com/bazelbuild/rules_go",
module_name = "rules_go",
)
go_repository(
name = "co_honnef_go_tools",
importpath = "honnef.co/go/tools",
)
...
Here is a repo to reproduce the slow performance behavior. The results of gazelle
vs aspect configure
:
❯ time bzl configure
Updating BUILD files for go
2 BUILD files visited
0 BUILD files updated
bazelisk configure 18.23s user 3.18s system 140% cpu 15.257 total
❯ time bzl run gazelle
INFO: Analyzed target //:gazelle (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
bazel-bin/gazelle-runner.bash
bazel-bin/gazelle
INFO: Elapsed time: 0.073s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/gazelle
bazelisk run gazelle 0.10s user 0.13s system 88% cpu 0.258 total
Hmm, is this really fixed? 🤔 I see the same behavior from latest main.
It is fixed in the aspect private repo. If you're using the cli from this repo you'll have to wait till the change gets pushed here. Sorry I guess that's confusing when it gets closed from the private repo :/
Aha, I understand. I'm just glad to hear it's fixed. Thanks!
On Wed, 6 Nov 2024, 20:24 Jason Bedard, @.***> wrote:
It is fixed in the aspect private repo. If you're using the cli from this repo you'll have to wait till the change gets pushed here. Sorry I guess that's confusing when it gets closed from the private repo :/
— Reply to this email directly, view it on GitHub https://github.com/aspect-build/aspect-cli/issues/760#issuecomment-2460593019, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM3WLVSJ74FVWZU6MBBMODZ7JUFHAVCNFSM6AAAAABQGW54IKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRQGU4TGMBRHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
This will be in the next release which is currently publishing
What happened?
Crashes or really slow when updating go deps in bzlmod.
Version
Development (host) and target OS/architectures:
Output of
bazel --version
:Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved:
How to reproduce
Any other information?
See fix in gazelle sh script: https://github.com/bazel-contrib/bazel-gazelle/blob/b160ccd46fb7c19a49530d08906165c73c343dd1/internal/gazelle.bash.in#L101-L106