@@ -23,6 +23,10 @@ load("@bazel_features//:deps.bzl", "bazel_features_deps")
2323
2424bazel_features_deps ()
2525
26+ load ("@rules_cc//cc:extensions.bzl" , "compatibility_proxy_repo" )
27+
28+ compatibility_proxy_repo ()
29+
2630# Order is important. Try to go from most basic/primitive to higher level packages.
2731# - go_rules_dependencies
2832# - protobuf_deps
@@ -49,6 +53,10 @@ go_register_toolchains()
4953# gazelle:repository_macro go_deps.bzl%pl_go_dependencies
5054pl_go_dependencies ()
5155
56+ load ("@rules_java//java:rules_java_deps.bzl" , "rules_java_dependencies" )
57+
58+ rules_java_dependencies ()
59+
5260load ("@com_google_protobuf//:protobuf_deps.bzl" , "protobuf_deps" )
5361
5462protobuf_deps ()
@@ -57,17 +65,34 @@ load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
5765
5866grpc_deps ()
5967
60- load ("@io_bazel_rules_scala//:scala_config .bzl" , "scala_config " )
68+ load ("@io_bazel_rules_scala//scala:deps .bzl" , "rules_scala_dependencies " )
6169
62- scala_version = "2.13.6"
70+ rules_scala_dependencies ()
6371
64- scala_config ( scala_version = scala_version )
72+ load ( "@io_bazel_rules_scala//:scala_config.bzl" , "scala_config" )
6573
66- load ( "@io_bazel_rules_scala//scala:scala.bzl" , "scala_repositories" )
74+ scala_version = "2.13.16"
6775
68- scala_repositories ( )
76+ scala_config ( scala_version = scala_version )
6977
70- load ("@io_bazel_rules_scala//scala:toolchains.bzl" , "scala_register_toolchains" )
78+ load ("@io_bazel_rules_scala//scala:toolchains.bzl" , "scala_register_toolchains" , "scala_toolchains" )
79+
80+ scala_toolchains (
81+ fetch_sources = True ,
82+ twitter_scrooge = {
83+ "libthrift" : "@thrift_deps//:org_apache_thrift_libthrift" ,
84+ # Use scrooge_core_with_finagle to include finagle on the compile classpath
85+ # for generated thrift service code. Must use @px// prefix to reference
86+ # the main workspace from within the generated @rules_scala_toolchains repo.
87+ "scrooge_core" : "@px//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_core_with_finagle" ,
88+ "scrooge_generator" : "@thrift_deps//:com_twitter_scrooge_generator_2_13" ,
89+ "util_core" : "@thrift_deps//:com_twitter_util_core_2_13" ,
90+ "util_logging" : "@thrift_deps//:com_twitter_util_logging_2_13" ,
91+ "javax_annotation_api" : "@thrift_deps//:javax_annotation_javax_annotation_api" ,
92+ "mustache" : "@thrift_deps//:com_github_spullara_mustache_java_compiler" ,
93+ "scopt" : "@thrift_deps//:com_github_scopt_scopt_2_13" ,
94+ },
95+ )
7196
7297scala_register_toolchains ()
7398
@@ -187,26 +212,6 @@ load("@thrift_deps//:defs.bzl", thrift_pinned_maven_install = "pinned_maven_inst
187212
188213thrift_pinned_maven_install ()
189214
190- # twitter_scrooge will use incompatible versions of @scrooge_jars and @thrift_jars.
191- # These bind statements ensure that the correct versions of finagle libthrift, scrooge core
192- # and scrooge generator are used to ensure successful compilation.
193- # See https://github.com/bazelbuild/rules_scala/issues/592 and
194- # https://github.com/bazelbuild/rules_scala/pull/847 for more details.
195- bind (
196- name = "io_bazel_rules_scala/dependency/thrift/scrooge_core" ,
197- actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_jars" ,
198- )
199-
200- bind (
201- name = "io_bazel_rules_scala/dependency/thrift/scrooge_generator" ,
202- actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_jars" ,
203- )
204-
205- bind (
206- name = "io_bazel_rules_scala/dependency/thrift/libthrift" ,
207- actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:thrift_jars" ,
208- )
209-
210215# gazelle:repo bazel_gazelle
211216# Gazelle depes need to be loaded last to make sure they don't override our dependencies.
212217# The first one wins when it comes to package declaration.
0 commit comments