Skip to content

Commit

Permalink
Remove handcrafted maven dependency resolution for installing netty-t…
Browse files Browse the repository at this point in the history
…cnative (netty tls tracing deps) (#1507)

Summary: Remove handcrafted maven dependency resolution for installing
netty-tcnative (netty tls tracing deps)

See #1506 for the background on this issue.

Relevant Issues: N/A

Type of change: /kind cleanup

Test Plan: Verified the following:
- [x] `netty_tls_trace_bpf_test` passes -- indicating the thriftmux
container is buildable
- [x] Building thriftmux container fails with circular dependency when
rules_jvm_external is at 4.2 (prior to the 4.3 fix).
<details>
<summary> thriftmux container build issue</summary>

```
# Verify rules_jvm_external is reverted to 4.2 (prior to circular dependency fix)
ddelnano@vigenere:~/code/pixie (ddelnano/remove-netty-maven-install-workaround) $ git diff --cached
--
diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl
index e11b40b9ac..26e33ef3a0 100644
--- a/bazel/repository_locations.bzl
+++ b/bazel/repository_locations.bzl
@@ -418,9 +418,9 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://github.com/bazelbuild/rules_python/archive/refs/tags/0.8.1.tar.gz"],
),
rules_jvm_external = dict(
-        urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/5.2.tar.gz"],
-        sha256 = "c9ae901381ae7f7eca08aed96caeb542f96c5449052db9c9d27274a8dc154cdf",
-        strip_prefix = "rules_jvm_external-5.2",
+        urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.2.tar.gz"],
+        sha256 = "2cd77de091e5376afaf9cc391c15f093ebd0105192373b334f0a855d89092ad5",
+        strip_prefix = "rules_jvm_external-4.2",
),
rules_pkg = dict(
sha256 = "eea0f59c28a9241156a47d7a8e32db9122f3d50b505fae0f33de6ce4d9b61834",
 
 
ddelnano@vigenere:~/code/pixie (ddelnano/remove-netty-maven-install-workaround) $ bazel run src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:server_image
INFO: Invocation ID: a6c3bf29-5004-409a-a615-526d5db012e0
INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/a6c3bf29-5004-409a-a615-526d5db012e0
ERROR: /home/ddelnano/.cache/bazel/_bazel_ddelnano/b2e8b093089e374aa7d44dfed4f9953b/external/thrift_deps/BUILD:1223:11: in jvm_import rule @thrift_deps//:io_netty_netty_tcnative_boringssl_static_osx_aarch_64: cycle in dependency graph:
//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:server_image (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:thriftmux_scrooge (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:thrift_library with aspect @io_bazel_rules_scala//twitter_scrooge:twitter_scrooge.bzl%scrooge_scala_aspect
@io_bazel_rules_scala//twitter_scrooge:scrooge_toolchain_impl (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
@io_bazel_rules_scala//twitter_scrooge:scrooge_generator_classpath_provider (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
//external:io_bazel_rules_scala/dependency/thrift/scrooge_generator (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_jars (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
@thrift_deps//:com_twitter_finagle_http_2_13 (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
@thrift_deps//:io_netty_netty_tcnative_boringssl_static (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
.-> @thrift_deps//:io_netty_netty_tcnative_boringssl_static_osx_aarch_64 (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
\|   @thrift_deps//:io_netty_netty_tcnative_boringssl_static_osx_x86_64 (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
`-- @thrift_deps//:io_netty_netty_tcnative_boringssl_static_osx_aarch_64 (4c3c8778e0b5d648c5156237069c088d21305dfbecc1b717ff16b9dd87d7eefb)
ERROR: Analysis of target '//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:server_image' failed; build aborted
INFO: Elapsed time: 13.246s
INFO: 0 processes.
ERROR: Build failed. Not running target
INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/a6c3bf29-5004-409a-a615-526d5db012e0
FAILED: Build did NOT complete successfully (34 packages loaded, 2231 targets configured)
```

</details>

Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano authored Jun 15, 2023
1 parent c081d68 commit 7eef485
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 99 deletions.
10 changes: 0 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,8 @@ load("@pxapi_python_doc_deps//:requirements.bzl", pxapi_py_doc_install_deps = "i
pxapi_py_doc_install_deps()

# Setup thrift: used for building Stirling tracing targets.
load("//bazel:netty.bzl", "fetch_netty_tcnative_jars")
load("//bazel:thrift.bzl", "thrift_deps")

# TODO(ddelnano): Remove once rules_jvm_external is no longer impacted.
# Recent netty-tcnative releases cause rules_jvm_external to fail with a
# cyclic dependency issue due to its use of multi-classifiers. This is fixed
# by installing the netty jars manually and then overriding maven to use them. See
# https://github.com/bazelbuild/rules_jvm_external/issues/704 for more details.
netty_tcnative_version = "2.0.53.Final"

fetch_netty_tcnative_jars(netty_tcnative_version)

thrift_deps(scala_version = scala_version)

load("@thrift_deps//:defs.bzl", thrift_pinned_maven_install = "pinned_maven_install")
Expand Down
36 changes: 0 additions & 36 deletions bazel/netty.bzl

This file was deleted.

5 changes: 0 additions & 5 deletions bazel/thrift.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ def thrift_deps(scala_version):
"ch.qos.logback:logback-classic:1.2.10",
],
repositories = ["https://repo1.maven.org/maven2"],
override_targets = {
"io.netty:netty-tcnative-boringssl-static": "@//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux/netty_deps:io_netty_netty_tcnative_boringssl_static",
"io.netty:netty-tcnative-boringssl-static:linux-aarch_64": "@//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux/netty_deps:io_netty_netty_tcnative_boringssl_static_linux_aarch_64",
"io.netty:netty-tcnative-boringssl-static:linux-x86_64": "@//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux/netty_deps:io_netty_netty_tcnative_boringssl_static_linux_x86_64",
},
)

This file was deleted.

0 comments on commit 7eef485

Please sign in to comment.