Skip to content

Commit 94f2dda

Browse files
[skip ci] working branch - merge 61a1af6 on top of main at adbf998
{"baseBranch":"main","baseCommit":"adbf998302d7c48e3a0aaf132522180b4c36a2de","createdAt":"2026-01-15T11:45:19.668257Z","headSha":"61a1af61ada1de24c8e5111f8a610de739ad508f","id":"bac12025-8d88-483f-b7bc-0f4f37ff6cf3","priority":"200","pullRequestNumber":"44881","queuedAt":"2026-01-15T11:45:19.666882Z","status":"STATUS_QUEUED"}
2 parents 897d3a4 + 61a1af6 commit 94f2dda

File tree

105 files changed

+22972
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+22972
-23
lines changed

MODULE.bazel

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ bazel_dep(name = "rules_shell", version = "0.6.1")
3434

3535
bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True)
3636

37-
# Rust support
38-
bazel_dep(name = "rules_rust", version = "0.68.1")
39-
40-
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
41-
rust.toolchain(
42-
edition = "2021",
43-
versions = ["1.92.0"],
44-
)
45-
use_repo(rust, "rust_toolchains")
46-
47-
register_toolchains("@rust_toolchains//:all")
48-
4937
# Temporary until rules_pkg 1.2.0 is in BCR
5038
archive_override(
5139
module_name = "rules_pkg",
@@ -180,6 +168,28 @@ use_repo(pip, "py_dev_requirements")
180168

181169
register_toolchains("@pythons_hub//:all")
182170

171+
#######################
172+
## Rust dependencies ##
173+
#######################
174+
175+
bazel_dep(name = "rules_rust", version = "0.68.1")
176+
177+
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
178+
rust.toolchain(
179+
edition = "2021",
180+
versions = ["1.92.0"],
181+
)
182+
use_repo(rust, "rust_toolchains")
183+
184+
register_toolchains("@rust_toolchains//:all")
185+
186+
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
187+
188+
include("//deps:crates.MODULE.bazel")
189+
190+
crate.from_specs()
191+
use_repo(crate, "crates")
192+
183193
#########################
184194
## Native dependencies ##
185195
#########################

MODULE.bazel.lock

Lines changed: 2785 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/crates.MODULE.bazel

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
2+
crate.spec(
3+
package = "anyhow",
4+
version = "1.0.98",
5+
)
6+
crate.spec(
7+
package = "cap-std",
8+
version = "3.4",
9+
)
10+
crate.spec(
11+
features = ["derive"],
12+
package = "clap",
13+
version = "4.5",
14+
)
15+
crate.spec(
16+
package = "dircpy",
17+
version = "0.3.19",
18+
)
19+
crate.spec(
20+
package = "elf",
21+
version = "0.8.0",
22+
)
23+
crate.spec(
24+
package = "glob-match",
25+
version = "0.2",
26+
)
27+
crate.spec(
28+
package = "http-body-util",
29+
version = "0.1",
30+
)
31+
crate.spec(
32+
package = "hyper",
33+
version = "1",
34+
)
35+
crate.spec(
36+
default_features = False,
37+
features = [
38+
"http1",
39+
"server",
40+
"tokio",
41+
],
42+
package = "hyper-util",
43+
version = "0.1",
44+
)
45+
crate.spec(
46+
package = "log",
47+
version = "0.4",
48+
)
49+
crate.spec(
50+
default_features = False,
51+
package = "lru",
52+
version = "0.16.0",
53+
)
54+
crate.spec(
55+
package = "memchr",
56+
version = "2.7.6",
57+
)
58+
crate.spec(
59+
package = "memmap2",
60+
version = "0.9",
61+
)
62+
crate.spec(
63+
features = ["signal"],
64+
package = "nix",
65+
version = "0.29",
66+
)
67+
crate.spec(
68+
package = "nom",
69+
version = "7.1",
70+
)
71+
crate.spec(
72+
package = "normalize-path",
73+
version = "0.2",
74+
)
75+
crate.spec(
76+
features = ["macros"],
77+
package = "phf",
78+
version = "0.11",
79+
)
80+
crate.spec(
81+
features = ["serialize"],
82+
package = "quick-xml",
83+
version = "0.37",
84+
)
85+
crate.spec(
86+
package = "rmp-serde",
87+
version = "1.3",
88+
)
89+
crate.spec(
90+
package = "scopeguard",
91+
version = "1.2",
92+
)
93+
crate.spec(
94+
features = [
95+
"derive",
96+
"std",
97+
],
98+
package = "serde",
99+
version = "1.0.219",
100+
)
101+
crate.spec(
102+
package = "serde_json",
103+
version = "1.0",
104+
)
105+
crate.spec(
106+
features = [
107+
"colors",
108+
"timestamps",
109+
],
110+
package = "simple_logger",
111+
version = "5.0",
112+
)
113+
crate.spec(
114+
package = "temp-env",
115+
version = "0.3",
116+
)
117+
crate.spec(
118+
package = "tempfile",
119+
version = "3.0",
120+
)
121+
crate.spec(
122+
package = "thiserror",
123+
version = "2.0.12",
124+
)
125+
crate.spec(
126+
features = [
127+
"macros",
128+
"net",
129+
"rt-multi-thread",
130+
"signal",
131+
],
132+
package = "tokio",
133+
version = "1",
134+
)
135+
crate.spec(
136+
package = "uzers",
137+
version = "0.12",
138+
)
139+
crate.spec(
140+
package = "walkdir",
141+
version = "2",
142+
)
143+
crate.spec(
144+
package = "yaml-rust2",
145+
version = "0.9",
146+
)
147+
crate.spec(
148+
default_features = False,
149+
features = ["deflate"],
150+
package = "zip",
151+
version = "2.1",
152+
)

pkg/discovery/module/impl_linux_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,18 @@ func TestRustBinary(t *testing.T) {
437437

438438
require.FileExists(t, binaryPath, "Rust binary should be built")
439439

440-
cmd := exec.Command(binaryPath)
441-
output, err := cmd.CombinedOutput()
440+
truePath := "/bin/true"
441+
if _, err := os.Stat(truePath); os.IsNotExist(err) {
442+
truePath = "/usr/bin/true"
443+
}
442444

445+
env := os.Environ()
446+
env = append(env, "DD_DISCOVERY_ENABLED=false")
447+
// Fake system-probe binary with empty configuration file
448+
cmd := exec.Command(binaryPath, "--", truePath, "-c", "/dev/null")
449+
cmd.Env = env
450+
output, err := cmd.CombinedOutput()
443451
require.NoError(t, err, "Rust binary should execute successfully")
444-
require.Contains(t, string(output), "Hello from Rust test binary!")
445-
require.Equal(t, 0, cmd.ProcessState.ExitCode(), "Binary should exit with code 0")
452+
require.Contains(t, string(output), "Discovery is disabled")
453+
require.Equal(t, 0, cmd.ProcessState.ExitCode(), "Binary should exit with code 0", string(output))
446454
}

pkg/discovery/module/rust/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)