From e41a109bc5187226991c82a33bf49aa43b27c66c Mon Sep 17 00:00:00 2001 From: Steve Barrau <98589981+stevebarrau@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:06:34 +0000 Subject: [PATCH] Update go dependencies (#216) This should resolve #211 for good. The java dependencies changes are caused by a run of ./tools/update-dependencies.sh. Co-authored-by: Danilo Cianfrone --- BUILD.bazel | 3 +- MODULE.bazel | 33 +++------- WORKSPACE | 8 ++- go.mod | 23 +++---- go.sum | 42 +++++++------ java/gazelle/BUILD.bazel | 9 +-- java/gazelle/javaconfig/BUILD.bazel | 2 +- java/gazelle/private/bazel/BUILD.bazel | 1 - java/gazelle/private/bazel/bazel.go | 11 +--- .../gazelle/private/servermanager/BUILD.bazel | 2 +- .../private/servermanager/servermanager.go | 28 ++++++--- java/private/contrib_rules_jvm_deps.zip | Bin 297186 -> 297186 bytes .../contrib_rules_jvm/junit5/BUILD.bazel | 3 +- repositories.bzl | 26 +++++--- third_party/go/repositories.bzl | 58 ++++++++---------- 15 files changed, 122 insertions(+), 127 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 7ffba99b..dab4281f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -10,7 +10,8 @@ buildifier( # gazelle:java_maven_install_file frozen_deps_install.json # gazelle:prefix github.com/bazel-contrib/rules_jvm -# gazelle:resolve go github.com/bazelbuild/buildtools/build @com_github_bazelbuild_buildtools//build:go_default_library +# gazelle:repository go_repository name=org_golang_x_tools_go_vcs importpath=golang.org/x/tools/go/vcs + # gazelle:resolve java com.beust.jcommander @contrib_rules_jvm_deps//:com_beust_jcommander # gazelle:resolve java com.beust.jcommander.converters @contrib_rules_jvm_deps//:com_beust_jcommander # gazelle:resolve java com.gazelle.java.javaparser.v0 //java/gazelle/private/javaparser/proto/gazelle/java/javaparser/v0:gazelle_java_build_v0_java_library diff --git a/MODULE.bazel b/MODULE.bazel index 795b6c81..15881a7c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,55 +15,45 @@ bazel_dep( name = "apple_rules_lint", version = "0.3.2", ) - bazel_dep( name = "bazel_skylib", version = "1.4.2", ) - bazel_dep( name = "bazel_skylib_gazelle_plugin", version = "1.4.2", ) - bazel_dep( name = "gazelle", - version = "0.31.1", + version = "0.34.0", repo_name = "bazel_gazelle", ) - bazel_dep( name = "protobuf", version = PROTOBUF_VERSION, repo_name = "com_google_protobuf", ) - bazel_dep( name = "rules_cc", - version = "0.0.6", + version = "0.0.9", ) - bazel_dep( name = "rules_go", - version = "0.40.1", + version = "0.43.0", repo_name = "io_bazel_rules_go", ) - bazel_dep( name = "rules_java", version = "6.1.1", ) - bazel_dep( name = "rules_jvm_external", version = "5.3", ) - bazel_dep( name = "rules_proto", version = "5.3.0-{}".format(PROTOBUF_VERSION), ) - bazel_dep( name = "stardoc", version = "0.5.6", @@ -71,35 +61,27 @@ bazel_dep( ) non_module_deps = use_extension("//java/private:non-module-deps.bzl", "non_module_deps") - use_repo( non_module_deps, "io_grpc_grpc_java", ) linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter") - linter.register(name = "java-checkstyle") - linter.configure( name = "java-checkstyle", config = "//java:checkstyle-default-config", ) - linter.register(name = "java-pmd") - linter.configure( name = "java-pmd", config = "//java:pmd-config", ) - linter.register(name = "java-spotbugs") - linter.configure( name = "java-spotbugs", config = "//java:spotbugs-default-config", ) - use_repo( linter, "apple_linters", @@ -203,7 +185,6 @@ maven.artifact( group = "com.github.spotbugs", version = "4.7.0", ) - use_repo( maven, "com_google_api_grpc_proto_google_common_protos", @@ -221,7 +202,6 @@ dev_maven = use_extension( "maven", dev_dependency = True, ) - dev_maven.install( name = "contrib_rules_jvm_tests", artifacts = [ @@ -241,16 +221,16 @@ dev_maven.install( fail_if_repin_required = True, fetch_sources = True, ) - use_repo( dev_maven, "contrib_rules_jvm_tests", ) -go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") +go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download(version = "1.21.5") +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod") - use_repo( go_deps, "com_github_aristanetworks_goarista", @@ -265,4 +245,5 @@ use_repo( "net_starlark_go", "org_golang_google_grpc", "org_golang_x_tools", + "org_golang_x_tools_go_vcs", ) diff --git a/WORKSPACE b/WORKSPACE index 846fc9e9..1b92f9be 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -148,7 +148,7 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") go_rules_dependencies() -go_register_toolchains(version = "1.18") +go_register_toolchains(version = "1.21.5") gazelle_dependencies() @@ -157,3 +157,9 @@ load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_ rules_proto_dependencies() rules_proto_toolchains() + +load("@googleapis//:repository_rules.bzl", "switched_rules_by_language") + +switched_rules_by_language( + name = "com_google_googleapis_imports", +) diff --git a/go.mod b/go.mod index 3d14854b..e553686e 100644 --- a/go.mod +++ b/go.mod @@ -1,33 +1,34 @@ module github.com/bazel-contrib/rules_jvm -go 1.18 +go 1.21 require ( github.com/aristanetworks/goarista v0.0.0-20220328143245-64c8d3945829 - github.com/bazelbuild/bazel-gazelle v0.25.1-0.20220406134132-bd319f810c16 - github.com/bazelbuild/buildtools v0.0.0-20230111132423-06e8e2436a75 - github.com/bazelbuild/rules_go v0.31.0 + github.com/bazelbuild/bazel-gazelle v0.34.0 + github.com/bazelbuild/buildtools v0.0.0-20231115204819-d4c9dccdfbb1 + github.com/bazelbuild/rules_go v0.43.0 github.com/google/btree v1.1.2 - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.1.2 github.com/hashicorp/golang-lru v0.5.4 github.com/rs/zerolog v1.26.1 github.com/sergi/go-diff v1.2.0 github.com/stretchr/testify v1.7.0 go.starlark.net v0.0.0-20210223155950-e043a3d3c984 - golang.org/x/tools v0.5.0 + golang.org/x/tools v0.14.0 + golang.org/x/tools/go/vcs v0.1.0-deprecated google.golang.org/grpc v1.50.0 ) require ( - github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/mod v0.7.0 // indirect - golang.org/x/net v0.5.0 // indirect - golang.org/x/sys v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/net v0.16.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect diff --git a/go.sum b/go.sum index ac377cc3..c6e2d717 100644 --- a/go.sum +++ b/go.sum @@ -5,14 +5,14 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aristanetworks/goarista v0.0.0-20220328143245-64c8d3945829 h1:xnu1MpGNjnEooJ8lWa3YiU3330zMZISReAosjpZpLzg= github.com/aristanetworks/goarista v0.0.0-20220328143245-64c8d3945829/go.mod h1:FmFEhIzCEWoI0WuuZDSWCu25zCNW/X4Czla0ls/HSrs= -github.com/bazelbuild/bazel-gazelle v0.25.1-0.20220406134132-bd319f810c16 h1:TxcWafIs8LlRONmcmp7KA83f0//+BfvAuHVkibsrT2U= -github.com/bazelbuild/bazel-gazelle v0.25.1-0.20220406134132-bd319f810c16/go.mod h1:rYwSQJrIxPY7p7zjpycNG6VVETEfrUHIb13a2Cgom5Q= -github.com/bazelbuild/buildtools v0.0.0-20230111132423-06e8e2436a75 h1:DraHsDqTYhf6w1369EEdFyA5hjJnGX88xNJRv1+20E0= -github.com/bazelbuild/buildtools v0.0.0-20230111132423-06e8e2436a75/go.mod h1:689QdV3hBP7Vo9dJMmzhoYIyo/9iMhEmHkJcnaPRCbo= -github.com/bazelbuild/rules_go v0.31.0 h1:8/MDe6zCE7nYKXhlbamM1izUgJjw2ce7M5kd4QKF/3Y= -github.com/bazelbuild/rules_go v0.31.0/go.mod h1:MC23Dc/wkXEyk3Wpq6lCqz0ZAYOZDw2DR5y3N1q2i7M= -github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= -github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bazelbuild/bazel-gazelle v0.34.0 h1:YHkwssgvCXDRU7sLCq1kGqaGYO9pKNR1Wku7UT2LhoY= +github.com/bazelbuild/bazel-gazelle v0.34.0/go.mod h1:3wXzAC5rTs8eTQ+t+eTqleUE9W4dDComgXgqDjnI5s4= +github.com/bazelbuild/buildtools v0.0.0-20231115204819-d4c9dccdfbb1 h1:2Gc2Q6hVR1SJ8bBI9Ybzoggp8u/ED2WkM4MfvEIn9+c= +github.com/bazelbuild/buildtools v0.0.0-20231115204819-d4c9dccdfbb1/go.mod h1:689QdV3hBP7Vo9dJMmzhoYIyo/9iMhEmHkJcnaPRCbo= +github.com/bazelbuild/rules_go v0.43.0 h1:Q+vDhH4yzafZ0xHBT0JEVawb+1nDHUXhjvWTqSGCCyU= +github.com/bazelbuild/rules_go v0.43.0/go.mod h1:TFLfii8e49kTgn329knh1lsJFKdxyp/hKlWObY66xwY= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -59,8 +59,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -100,8 +100,8 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -113,8 +113,8 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -132,15 +132,15 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -148,8 +148,10 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= -golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4= +golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/java/gazelle/BUILD.bazel b/java/gazelle/BUILD.bazel index 16121628..96081d9c 100644 --- a/java/gazelle/BUILD.bazel +++ b/java/gazelle/BUILD.bazel @@ -12,9 +12,6 @@ go_library( "lang.go", "resolve.go", ], - data = [ - "//java/src/com/github/bazel_contrib/contrib_rules_jvm/javaparser/generators:Main", - ], importpath = "github.com/bazel-contrib/rules_jvm/java/gazelle", visibility = ["//visibility:public"], deps = [ @@ -32,7 +29,7 @@ go_library( "@bazel_gazelle//repo:go_default_library", "@bazel_gazelle//resolve:go_default_library", "@bazel_gazelle//rule:go_default_library", - "@com_github_bazelbuild_buildtools//build:go_default_library", + "@com_github_bazelbuild_buildtools//build", "@com_github_hashicorp_golang_lru//:golang-lru", "@com_github_rs_zerolog//:zerolog", ], @@ -62,12 +59,12 @@ go_test( "@bazel_gazelle//rule:go_default_library", "@bazel_gazelle//testtools:go_default_library", "@bazel_gazelle//walk:go_default_library", - "@com_github_bazelbuild_buildtools//build:go_default_library", + "@com_github_bazelbuild_buildtools//build", "@com_github_google_go_cmp//cmp", "@com_github_rs_zerolog//:zerolog", "@com_github_sergi_go_diff//diffmatchpatch", "@com_github_stretchr_testify//require", - "@org_golang_x_tools//go/vcs", + "@org_golang_x_tools_go_vcs//:vcs", ], ) diff --git a/java/gazelle/javaconfig/BUILD.bazel b/java/gazelle/javaconfig/BUILD.bazel index b667125e..d8b7accc 100644 --- a/java/gazelle/javaconfig/BUILD.bazel +++ b/java/gazelle/javaconfig/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "github.com/bazel-contrib/rules_jvm/java/gazelle/javaconfig", visibility = ["//visibility:public"], deps = [ - "@com_github_bazelbuild_buildtools//build:go_default_library", + "@com_github_bazelbuild_buildtools//build", ], ) diff --git a/java/gazelle/private/bazel/BUILD.bazel b/java/gazelle/private/bazel/BUILD.bazel index e47c80f8..0114a601 100644 --- a/java/gazelle/private/bazel/BUILD.bazel +++ b/java/gazelle/private/bazel/BUILD.bazel @@ -5,5 +5,4 @@ go_library( srcs = ["bazel.go"], importpath = "github.com/bazel-contrib/rules_jvm/java/gazelle/private/bazel", visibility = ["//java/gazelle:__subpackages__"], - deps = ["@io_bazel_rules_go//go/tools/bazel:go_default_library"], ) diff --git a/java/gazelle/private/bazel/bazel.go b/java/gazelle/private/bazel/bazel.go index 0d5369a5..214bb93c 100644 --- a/java/gazelle/private/bazel/bazel.go +++ b/java/gazelle/private/bazel/bazel.go @@ -1,15 +1,6 @@ package bazel -import ( - "regexp" - - "github.com/bazelbuild/rules_go/go/tools/bazel" -) - -var ( - FindBinary = bazel.FindBinary - ListRunfiles = bazel.ListRunfiles -) +import "regexp" var nonWordRe = regexp.MustCompile(`\W+`) diff --git a/java/gazelle/private/servermanager/BUILD.bazel b/java/gazelle/private/servermanager/BUILD.bazel index e7255a56..f8420e9f 100644 --- a/java/gazelle/private/servermanager/BUILD.bazel +++ b/java/gazelle/private/servermanager/BUILD.bazel @@ -7,8 +7,8 @@ go_library( importpath = "github.com/bazel-contrib/rules_jvm/java/gazelle/private/servermanager", visibility = ["//java/gazelle:__subpackages__"], deps = [ - "//java/gazelle/private/bazel", "//java/gazelle/private/javaparser/proto/gazelle/java/javaparser/v0:javaparser", + "@io_bazel_rules_go//go/runfiles:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/java/gazelle/private/servermanager/servermanager.go b/java/gazelle/private/servermanager/servermanager.go index f8924d18..d3b093f0 100644 --- a/java/gazelle/private/servermanager/servermanager.go +++ b/java/gazelle/private/servermanager/servermanager.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -12,8 +11,8 @@ import ( "sync" "time" - "github.com/bazel-contrib/rules_jvm/java/gazelle/private/bazel" pb "github.com/bazel-contrib/rules_jvm/java/gazelle/private/javaparser/proto/gazelle/java/javaparser/v0" + "github.com/bazelbuild/rules_go/go/runfiles" "google.golang.org/grpc" ) @@ -42,12 +41,12 @@ func (m *ServerManager) Connect() (*grpc.ClientConn, error) { logLevelFlag := fmt.Sprintf("-Dorg.slf4j.simpleLogger.defaultLogLevel=%s", m.javaLogLevel) - javaParserPath, found := bazel.FindBinary("java/src/com/github/bazel_contrib/contrib_rules_jvm/javaparser/generators", "Main") - if !found { - return nil, fmt.Errorf("failed to find javaparser in runfiles") + javaParserPath, err := locateJavaparser() + if err != nil { + return nil, fmt.Errorf("failed to find javaparser in runfiles: %w", err) } - dir, err := ioutil.TempDir(os.Getenv("TMPDIR"), "gazelle-javaparser") + dir, err := os.MkdirTemp(os.Getenv("TMPDIR"), "gazelle-javaparser") if err != nil { return nil, fmt.Errorf("failed to create tmpdir to start javaparser server: %w", err) } @@ -86,6 +85,21 @@ func (m *ServerManager) Connect() (*grpc.ClientConn, error) { return conn, nil } +func locateJavaparser() (string, error) { + rf, err := runfiles.New() + if err != nil { + return "", fmt.Errorf("failed to init new style runfiles: %w", err) + } + + // We want //java/src/com/github/bazel_contrib/contrib_rules_jvm/javaparser/generators:Main + loc, err := rf.Rlocation("contrib_rules_jvm/java/src/com/github/bazel_contrib/contrib_rules_jvm/javaparser/generators/Main") + if err != nil { + return "", fmt.Errorf("failed to call RLocation: %w", err) + } + + return loc, nil +} + func readPort(path string) (int32, error) { startTime := time.Now() for { @@ -93,7 +107,7 @@ func readPort(path string) (int32, error) { return 0, fmt.Errorf("timed out waiting for port file to be written by javaparser server") } - bs, err := ioutil.ReadFile(path) + bs, err := os.ReadFile(path) if err != nil { if errors.Is(err, os.ErrNotExist) { time.Sleep(10 * time.Millisecond) diff --git a/java/private/contrib_rules_jvm_deps.zip b/java/private/contrib_rules_jvm_deps.zip index db008dd69ab61f6d3cc015b60a2c67c0dbaec51a..f33e79f2f2a8efb3f8dedc279874aea75d4516de 100644 GIT binary patch delta 3662 zcmZ`+Piz&(8P}}G5A!IppdZ&d%&?1r3EX zhqgJiR7fRJ6|iHq-=&I3a>ym3>B&7LV2+iVmPoxrbE%qEYNe>hs{Ll4_q~13uM%SS z&CK`h@AsSUpFdsR{^|1e53UYV{qJ+bSFa7PUK=KRj=|g>P*dDd&`QESFr_EODX8 zBO^tcTQ0RoQmfL)Wj0n;I&D&;bFOopO6?-WR$l%=4F5VpC!l$l4v`S9&(d8hZ%#i7 zmlsI);@#6zzdB3e;L`oz&b(%5ZjEJqY#&X4tibIz;!?L^e5s2Ba_rr%(0K@czZ84{CM=-^w8OE@vouT$&n#0s%x%t69vfziNO)+Z zO*A54X`V@qko|o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