-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathBUILD.bazel
More file actions
130 lines (125 loc) · 4.3 KB
/
Copy pathBUILD.bazel
File metadata and controls
130 lines (125 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"""The trace loader."""
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_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",
],
"//packages/agent:linux_fips": [
"@trace_loader_binary//:trace_loader",
],
# This shouldn't be needed in practice, but it is used by the systemd
# service, which is used when installing the deb manually.
"//packages/agent:linux_heroku": [
"main_noop.sh",
],
"@platforms//os:macos": [
"@trace_loader_binary//:trace_loader",
],
"//conditions:default": [],
}),
attributes = pkg_attributes(mode = "755"),
prefix = "embedded/bin",
renames = select({
"//packages/agent:linux_heroku": {":main_noop.sh": "trace-loader"},
"//conditions:default": {},
}),
)
go_library(
name = "loader_lib",
srcs = [
"docs.go",
"main_nix.go",
"memory_darwin.go",
"memory_linux.go",
],
importpath = "github.com/DataDog/datadog-agent/cmd/loader",
deps = select({
"@rules_go//go/platform:android": [
"//comp/core/delegatedauth/noop-impl/types",
"//comp/core/log/def",
"//comp/core/secrets/noop-impl/types",
"//comp/otelcol/otlp/configcheck",
"//pkg/config/env",
"//pkg/config/model",
"//pkg/config/setup",
"//pkg/config/utils",
"//pkg/trace/api/loader",
"//pkg/util/defaultpaths",
"//pkg/util/log",
"//pkg/util/log/setup",
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:darwin": [
"//comp/core/delegatedauth/noop-impl/types",
"//comp/core/log/def",
"//comp/core/secrets/noop-impl/types",
"//comp/otelcol/otlp/configcheck",
"//pkg/config/env",
"//pkg/config/model",
"//pkg/config/setup",
"//pkg/config/utils",
"//pkg/trace/api/loader",
"//pkg/util/defaultpaths",
"//pkg/util/log",
"//pkg/util/log/setup",
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:ios": [
"//comp/core/delegatedauth/noop-impl/types",
"//comp/core/log/def",
"//comp/core/secrets/noop-impl/types",
"//comp/otelcol/otlp/configcheck",
"//pkg/config/env",
"//pkg/config/model",
"//pkg/config/setup",
"//pkg/config/utils",
"//pkg/trace/api/loader",
"//pkg/util/defaultpaths",
"//pkg/util/log",
"//pkg/util/log/setup",
"@org_golang_x_sys//unix",
],
"@rules_go//go/platform:linux": [
"//comp/core/delegatedauth/noop-impl/types",
"//comp/core/log/def",
"//comp/core/secrets/noop-impl/types",
"//comp/otelcol/otlp/configcheck",
"//pkg/config/env",
"//pkg/config/model",
"//pkg/config/setup",
"//pkg/config/utils",
"//pkg/trace/api/loader",
"//pkg/util/defaultpaths",
"//pkg/util/log",
"//pkg/util/log/setup",
"@org_golang_x_sys//unix",
],
"//conditions:default": [],
}),
)
# 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"],
# 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:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)