Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
aac4009
Upgrade amqp_code_generator to work with python 3.12 and upgrade all …
ddelnano Dec 1, 2025
6d58d64
Upgrade protocol_inference to work with python 3.12 and upgrade all deps
ddelnano Dec 1, 2025
0c37ce7
Upgrade src/api/python deps to work with bazel supplied python 3.12 a…
ddelnano Dec 1, 2025
dfba5fa
Upgrade bazel's python to 3.12
ddelnano Dec 5, 2025
bb563ac
Replace GUARDED_BY with ABSL_GUARDED_BY in preparation for abseil upg…
ddelnano Dec 1, 2025
eb296d8
Fix linting
ddelnano Dec 5, 2025
fba1df5
Upgrade rules_scala
ddelnano Dec 5, 2025
4341ecf
Upgrade bazel to v6.5.0. This is required to get protobuf compiling p…
ddelnano Dec 5, 2025
ed6793f
Upgrade a bunch of deps. Realize that protobuf requires bazel 7
ddelnano Dec 6, 2025
f723eed
Use bazel 6.5.0
ddelnano Dec 8, 2025
054e2f6
Update eigen repository to work with tensorflow 2.22.0. Comment out t…
ddelnano Dec 8, 2025
0fdcc3e
Upgrade rules_scala, tensorflow, bazel_features. Get build passing ex…
ddelnano Dec 8, 2025
57710ed
Replace raw use of bazel with bazelisk
ddelnano Dec 8, 2025
c225707
Add include to fix issues in gcc build
ddelnano Dec 8, 2025
bb506c7
Upgrade rules_scala to 7.1.0 to include scrooge fixes and fix scala b…
ddelnano Dec 8, 2025
4582736
Fix tensorflow compilation with flatbuffer upgrade and v2.22.0 patch
ddelnano Dec 8, 2025
bdc1c10
Fix protobuf_javascript to be able to find our node binary
ddelnano Dec 8, 2025
9328ec9
Upgrade to bazel 7
ddelnano Dec 9, 2025
5ff3529
Trigger build
ddelnano Dec 9, 2025
69ce16e
#ci:ignore-deps
ddelnano Dec 9, 2025
f68a003
Keep zsh completions
ddelnano Dec 9, 2025
246038d
Remove '//command_line_option:is host configuration' as host configur…
ddelnano Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Global bazelrc file, see https://docs.bazel.build/versions/master/guide.html#bazelrc.

common --noenable_bzlmod --enable_workspace

# Use strict action env to prevent leaks of env vars.
build --incompatible_strict_action_env

Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.0
7.7.1
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0


load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
Expand Down
72 changes: 43 additions & 29 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ pl_register_cc_toolchains()
# Install Pixie Labs Dependencies.
pl_deps()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")

compatibility_proxy_repo()

# Order is important. Try to go from most basic/primitive to higher level packages.
# - go_rules_dependencies
# - protobuf_deps
Expand All @@ -45,6 +53,10 @@ go_register_toolchains()
# gazelle:repository_macro go_deps.bzl%pl_go_dependencies
pl_go_dependencies()

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()
Expand All @@ -53,17 +65,39 @@ load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()

load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
load("@io_bazel_rules_scala//scala:deps.bzl", "rules_scala_dependencies")

scala_version = "2.13.6"
rules_scala_dependencies()

scala_config(scala_version = scala_version)
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")

load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_version = "2.13.16"

scala_repositories()
scala_config(scala_version = scala_version)

load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains", "scala_toolchains")

# Configure twitter_scrooge toolchain with custom dependencies from thrift_deps.
# Note: thrift_deps must be loaded before this is evaluated.
# The finagle dependencies (finagle-thrift, finagle-core) are needed as compile
# dependencies for the generated scrooge code when thrift services are defined.
# We use scrooge_core_with_finagle which bundles finagle deps with scrooge_core.
scala_toolchains(
fetch_sources = True,
twitter_scrooge = {
"libthrift": "@thrift_deps//:org_apache_thrift_libthrift",
# Use scrooge_core_with_finagle to include finagle on the compile classpath
# for generated thrift service code. Must use @px// prefix to reference
# the main workspace from within the generated @rules_scala_toolchains repo.
"scrooge_core": "@px//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_core_with_finagle",
"scrooge_generator": "@thrift_deps//:com_twitter_scrooge_generator_2_13",
"util_core": "@thrift_deps//:com_twitter_util_core_2_13",
"util_logging": "@thrift_deps//:com_twitter_util_logging_2_13",
"javax_annotation_api": "@thrift_deps//:javax_annotation_javax_annotation_api",
"mustache": "@thrift_deps//:com_github_spullara_mustache_java_compiler",
"scopt": "@thrift_deps//:com_github_scopt_scopt_2_13",
},
)

scala_register_toolchains()

Expand Down Expand Up @@ -141,17 +175,17 @@ tf_workspace0()
pl_model_files()

python_register_toolchains(
name = "python3_10",
name = "python3_12",
# Allow the root user to build the code base since this is a current requirement for
# building in a containerized environment. See https://github.com/bazelbuild/rules_python/pull/713
# for more details.
ignore_root_user_error = True,
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.10",
python_version = "3.12",
)

load("@python3_10//:defs.bzl", "interpreter")
load("@python3_12//:defs.bzl", "interpreter")

# Setup the environment for the open-source python API.
pip_parse(
Expand Down Expand Up @@ -183,26 +217,6 @@ load("@thrift_deps//:defs.bzl", thrift_pinned_maven_install = "pinned_maven_inst

thrift_pinned_maven_install()

# twitter_scrooge will use incompatible versions of @scrooge_jars and @thrift_jars.
# These bind statements ensure that the correct versions of finagle libthrift, scrooge core
# and scrooge generator are used to ensure successful compilation.
# See https://github.com/bazelbuild/rules_scala/issues/592 and
# https://github.com/bazelbuild/rules_scala/pull/847 for more details.
bind(
name = "io_bazel_rules_scala/dependency/thrift/scrooge_core",
actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_jars",
)

bind(
name = "io_bazel_rules_scala/dependency/thrift/scrooge_generator",
actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:scrooge_jars",
)

bind(
name = "io_bazel_rules_scala/dependency/thrift/libthrift",
actual = "//src/stirling/source_connectors/socket_tracer/testing/containers/thriftmux:thrift_jars",
)

# gazelle:repo bazel_gazelle
# Gazelle depes need to be loaded last to make sure they don't override our dependencies.
# The first one wins when it comes to package declaration.
Expand Down
1 change: 0 additions & 1 deletion bazel/cc_toolchains/sysroots/images.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def _sysroot_variant_image_factory(variant):
return _image_from_sysroot_info(ctx, sysroot_toolchain.sysroot)

return rule(
name = "sysroot_{variant}_image".format(variant = variant),
implementation = _impl,
attrs = dicts.add(_container.image.attrs, {
"default_image": attr.label(mandatory = True, doc = "Default container_image to use if no sysroot toolchain is found"),
Expand Down
7 changes: 6 additions & 1 deletion bazel/cc_toolchains/toolchain_features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ def pl_toolchain_pre_features(ctx):
# pl_toolchain_post_features are added to the command line after all of the default features.
def pl_toolchain_post_features(ctx):
features = []
features += _libstdcpp(ctx)
if ctx.attr.compiler == "clang":
features += _clang_features(ctx)
else:
features += _libstdcpp(ctx)

features += _external_dep(ctx)

Expand Down Expand Up @@ -148,6 +149,10 @@ def _libcpp(ctx):
return [
feature(
name = "libc++",
# Enable by default for clang toolchains since they bundle libc++ and don't have libstdc++.
# This is especially important for exec toolchains where --features=libc++ from bazelrc
# may not be applied in Bazel 7+.
enabled = True,
flag_sets = [
flag_set(
actions = all_cpp_compile_actions + [ACTION_NAMES.lto_backend],
Expand Down
66 changes: 40 additions & 26 deletions bazel/cc_toolchains/unix_cc_toolchain_config.patch
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
diff --color -Naur a/cc_toolchain_config.bzl b/cc_toolchain_config.bzl
--- a/cc_toolchain_config.bzl 2023-01-06 15:34:50.000000000 -0800
+++ b/cc_toolchain_config.bzl 2023-01-22 15:33:16.794758043 -0800
@@ -27,6 +27,7 @@
diff --git a/cc_toolchain_config.bzl b/cc_toolchain_config.bzl
index 0b77afc..a046faf 100644
--- a/cc_toolchain_config.bzl
+++ b/cc_toolchain_config.bzl
@@ -27,6 +27,7 @@ load(
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
+load(":toolchain_features.bzl", "pl_toolchain_pre_features", "PL_EXTRA_CC_CONFIG_ATTRS", "pl_toolchain_post_features", "pl_action_configs")

def layering_check_features(compiler):
if compiler != "clang":
@@ -147,7 +148,7 @@
@@ -147,7 +148,7 @@ def _impl(ctx):
tool_path(name = name, path = path)
for name, path in ctx.attr.tool_paths.items()
]
- action_configs = []
+ action_configs = pl_action_configs(ctx)

llvm_cov_action = action_config(
action_name = ACTION_NAMES.llvm_cov,
@@ -168,6 +169,10 @@
@@ -168,6 +169,10 @@ def _impl(ctx):
name = "supports_start_end_lib",
enabled = True,
)
+ default_opt_level_flags_feature = feature(
+ name = "default_opt_level_flags",
+ enabled = True,
+ )

default_compile_flags_feature = feature(
name = "default_compile_flags",
@@ -203,7 +208,7 @@
@@ -203,7 +208,7 @@ def _impl(ctx):
flags = ctx.attr.dbg_compile_flags,
),
] if ctx.attr.dbg_compile_flags else []),
Expand All @@ -38,7 +39,7 @@ diff --color -Naur a/cc_toolchain_config.bzl b/cc_toolchain_config.bzl
),
flag_set(
actions = all_compile_actions,
@@ -212,7 +217,7 @@
@@ -212,7 +217,7 @@ def _impl(ctx):
flags = ctx.attr.opt_compile_flags,
),
] if ctx.attr.opt_compile_flags else []),
Expand All @@ -47,7 +48,7 @@ diff --color -Naur a/cc_toolchain_config.bzl b/cc_toolchain_config.bzl
),
flag_set(
actions = all_cpp_compile_actions + [ACTION_NAMES.lto_backend],
@@ -244,7 +249,7 @@
@@ -244,7 +249,7 @@ def _impl(ctx):
flags = ctx.attr.opt_link_flags,
),
] if ctx.attr.opt_link_flags else []),
Expand All @@ -56,44 +57,57 @@ diff --color -Naur a/cc_toolchain_config.bzl b/cc_toolchain_config.bzl
),
],
)
@@ -1255,6 +1260,7 @@
@@ -1255,6 +1260,7 @@ def _impl(ctx):
strip_debug_symbols_feature,
coverage_feature,
supports_pic_feature,
+ default_opt_level_flags_feature,
] + (
[
supports_start_end_lib_feature,
@@ -1276,6 +1282,7 @@
@@ -1276,6 +1282,7 @@ def _impl(ctx):
else:
features = [
supports_pic_feature,
+ default_opt_level_flags_feature,
] + (
[
supports_start_end_lib_feature,
@@ -1294,6 +1301,7 @@
@@ -1294,6 +1301,17 @@ def _impl(ctx):
unfiltered_compile_flags_feature,
] + layering_check_features(ctx.attr.compiler)

+ features = pl_toolchain_pre_features(ctx) + features + pl_toolchain_post_features(ctx)
+
+ sysroot_path = ctx.attr.builtin_sysroot
+ # Only override with toolchain sysroot if this cc_toolchain is configured to use a sysroot
+ # (i.e., builtin_sysroot is non-empty). This prevents exec toolchains from incorrectly
+ # inheriting the target sysroot.
+ if sysroot_path:
+ sysroot_toolchain = ctx.toolchains["@px//bazel/cc_toolchains/sysroots/build:toolchain_type"]
+ if sysroot_toolchain:
+ sysroot_path = sysroot_toolchain.sysroot.path
+
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
@@ -1313,7 +1321,7 @@

@@ -1308,7 +1322,7 @@ def _impl(ctx):
abi_version = ctx.attr.abi_version,
abi_libc_version = ctx.attr.abi_libc_version,
tool_paths = tool_paths,
- builtin_sysroot = ctx.attr.builtin_sysroot,
+ builtin_sysroot = sysroot_path,
)

cc_toolchain_config = rule(
implementation = _impl,
- attrs = {
+ attrs = dict({
"cpu": attr.string(mandatory = True),
"compiler": attr.string(mandatory = True),
"toolchain_identifier": attr.string(mandatory = True),
@@ -1336,6 +1344,6 @@
@@ -1336,5 +1350,8 @@ cc_toolchain_config = rule(
"coverage_link_flags": attr.string_list(),
"supports_start_end_lib": attr.bool(),
"builtin_sysroot": attr.string(),
- },
+ }, **PL_EXTRA_CC_CONFIG_ATTRS),
+ } | PL_EXTRA_CC_CONFIG_ATTRS,
provides = [CcToolchainConfigInfo],
+ toolchains = [
+ config_common.toolchain_type("@px//bazel/cc_toolchains/sysroots/build:toolchain_type", mandatory = False),
+ ],
)
35 changes: 35 additions & 0 deletions bazel/external/flatbuffers_local_changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index b4f015a0..70848962 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,5 +1,3 @@
-load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
-load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

licenses(["notice"])
@@ -8,12 +6,7 @@ package(
default_visibility = ["//visibility:public"],
)

-npm_link_all_packages(name = "node_modules")

-npm_link_package(
- name = "node_modules/flatbuffers",
- src = "//ts:flatbuffers",
-)

exports_files([
"LICENSE",
@@ -40,11 +33,9 @@ filegroup(
"BUILD.bazel",
"WORKSPACE",
"build_defs.bzl",
- "typescript.bzl",
"//grpc/src/compiler:distribution",
"//reflection:distribution",
"//src:distribution",
- "//ts:distribution",
] + glob([
"include/flatbuffers/*.h",
]),
8 changes: 4 additions & 4 deletions bazel/external/grpc_go_toolchain.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl
index 4d8afa3131..514189f9a5 100644
--- a/bazel/grpc_extra_deps.bzl
+++ b/bazel/grpc_extra_deps.bzl
@@ -53,7 +53,7 @@ def grpc_extra_deps(ignore_version_differences = False):
@@ -63,7 +63,7 @@ def grpc_extra_deps(ignore_version_differences = False):
api_dependencies()

go_rules_dependencies()
- go_register_toolchains(version = "1.18")
- go_register_toolchains(version = "1.22.5")
+ go_register_toolchains()
gazelle_dependencies()

# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
19 changes: 16 additions & 3 deletions bazel/external/protobuf_javascript.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
diff --git a/generator/BUILD.bazel b/generator/BUILD.bazel
index ac7756d..a3480c8 100644
--- a/generator/BUILD.bazel
+++ b/generator/BUILD.bazel
@@ -2,7 +2,7 @@ genrule(
name = "generate_version_header",
srcs = ["//:package.json"],
outs = ["version.h"],
- cmd = "node $(location //:generate-version-header.js) $(OUTS)",
+ cmd = "/opt/px_dev/tools/node/bin/node $(location //:generate-version-header.js) $(OUTS)",
tools = ["//:generate-version-header.js"],
)

diff --git a/generator/js_generator.cc b/generator/js_generator.cc
index 97b5844..1351a54 100644
index 7ba8bf0..09b1391 100644
--- a/generator/js_generator.cc
+++ b/generator/js_generator.cc
@@ -3650,6 +3650,9 @@ void Generator::GenerateFile(const GeneratorOptions& options,
@@ -3647,6 +3647,9 @@ void Generator::GenerateFile(const GeneratorOptions& options,

for (int i = 0; i < file->dependency_count(); i++) {
const std::string& name = file->dependency(i)->name();
const std::string name = std::string(file->dependency(i)->name());
+ if (ModuleAlias(name) == "gogoproto_gogo_pb") {
+ continue;
+ }
Expand Down
Loading
Loading