Skip to content

Commit

Permalink
Support bzlmod repositories
Browse files Browse the repository at this point in the history
unused_deps seems to be broken for repositories that have migrated over
to bzlmod.

Specifically, the reference to the aspect must be done via the canonical
name for the workspace now.
(This probably even needs to change once WORKSPACE is defunct in Bazel 9)

This will break users of unused_deps if they are not on bzlmod but given
the latest release of Bazel 8 this is the direction we are headed.
Existing WORKSPACE users can pin to a previous version.
(Alternatively we could maybe support a flag)

fixes bazelbuild#1315
  • Loading branch information
fzakaria committed Dec 10, 2024
1 parent 8bd806d commit e5325fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unused_deps/unused_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func main() {
buildCmd = append(buildCmd, config.DefaultExtraBuildFlags...)
buildCmd = append(buildCmd, "--output_groups=+unused_deps_outputs")
buildCmd = append(buildCmd, "--override_repository=unused_deps="+aspectDir)
buildCmd = append(buildCmd, "--aspects=@unused_deps//:unused_deps.bzl%javac_params")
buildCmd = append(buildCmd, "--aspects=@@unused_deps//:unused_deps.bzl%javac_params")
buildCmd = append(buildCmd, buildOptions()...)

blazeArgs := append(buildCmd, targetPatterns...)
Expand Down

0 comments on commit e5325fd

Please sign in to comment.