Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion bazel/rules/go/go_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def dd_agent_go_binary(name, gc_linkopts = None, gotags = None, exact_gotags = N
})

if exact_gotags:
kwargs["gotags"] = sorted(exact_gotags)
# this might be select()'ed by platform. It is up to the user to sort it.
kwargs["gotags"] = exact_gotags
else:
gotags = gotags or set()
kwargs["gotags"] = select({
Expand Down
26 changes: 18 additions & 8 deletions cmd/loader/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
"""The trace loader."""

load("@rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_go//go:def.bzl", "go_library")
load(
"@rules_pkg//pkg:mappings.bzl",
"pkg_attributes",
"pkg_files",
)
load("//bazel/rules/go:go_binary.bzl", "dd_agent_go_binary")
load("//tasks:build_tags.bzl", "LOADER_TAGS")

package(default_visibility = ["//packages:__subpackages__"])

pkg_files(
name = "trace_loader",
name = "trace_loader_all_files",
# Temporary: Point to prebuilt trace_loader. When we can stamp module deps
# in the file, swap to :loader and rename that as trace-loader.
srcs = select({
"//packages/agent:linux_default": [
"@trace_loader_binary//:trace_loader",
Expand All @@ -23,6 +27,9 @@ pkg_files(
"//packages/agent:linux_heroku": [
"main_noop.sh",
],
"@platforms//os:macos": [
"@trace_loader_binary//:trace_loader",
],
"//conditions:default": [],
}),
attributes = pkg_attributes(mode = "755"),
Expand All @@ -31,7 +38,6 @@ pkg_files(
"//packages/agent:linux_heroku": {":main_noop.sh": "trace-loader"},
"//conditions:default": {},
}),
target_compatible_with = ["@platforms//os:linux"],
)

go_library(
Expand Down Expand Up @@ -108,13 +114,17 @@ go_library(
}),
)

go_binary(
# TODO(ABLD-294): Rename to trace-loader and use this instead of @trace_loader_binary//:trace_loader
dd_agent_go_binary(
name = "loader",
embed = [":loader_lib"],
gotags = ["linux_bpf"], # keep
# keep
# LOADER_TAGS is actually empty. We're including it to keep a consistent style.
exact_gotags = list(LOADER_TAGS) + select({
"@platforms//os:linux": ["linux_bpf"],
"//conditions:default": [],
}),
target_compatible_with = select({
"@platforms//os:linux": [],
"//conditions:default": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)
8 changes: 5 additions & 3 deletions packages/agent/product/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pkg_filegroup(
# TODO: sysprobe - windows
# TODO: systray - windows
# TODO: installer
"//cmd/loader:trace_loader",
":dda_built_trace_agent_binary",
":dda_built_process_agent_binary",
":dda_built_privateactionrunner_binary",
Expand All @@ -62,10 +61,13 @@ pkg_filegroup(
"//pkg/procmgr/rust:all_files_linux",
],
"//packages/agent:linux_heroku": [],
"//conditions:default": [
],
"//conditions:default": [],
}) + select({
"@platforms//os:linux": [
"//cmd/loader:trace_loader_all_files",
],
"@platforms//os:macos": [
"//cmd/loader:trace_loader_all_files",
"//packages/macos/app:all_files",
# TODO: systray
],
Expand Down
Loading