Skip to content

Commit 2ef1db9

Browse files
octo-sts[bot]AmberArcadiaaborreroOddBloke
authored
Adding VersionStream for datadog-agent-7.73 (wolfi-dev#75786)
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero@chainguard.dev> Signed-off-by: Amber Arcadia <amber.arcadia@chainguard.dev> Co-authored-by: octo-sts[bot] <157150467+octo-sts@users.noreply.github.com> Co-authored-by: Amber Arcadia <amber.arcadia@chainguard.dev> Co-authored-by: Arturo Borrero Gonzalez <arturo.borrero@chainguard.dev> Co-authored-by: Daniel Watkins <daniel.watkins@chainguard.dev>
1 parent 5364820 commit 2ef1db9

7 files changed

Lines changed: 1020 additions & 0 deletions

datadog-agent-7.73.yaml

Lines changed: 866 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Author: Sergio Durigan Junior <sergiodj@chainguard.dev>
2+
Bug-Chainguard: https://github.com/chainguard-dev/internal-dev/issues/12556
3+
4+
datadog-agent version 7.66.0 introduces a few changes that break our
5+
build. Namely:
6+
7+
* https://github.com/DataDog/datadog-agent/commit/494f98eb5db09652258c0e0aac936a35d69d7b62
8+
changed how the system-probe task refers to the embedded clang
9+
compiler. Previously, it would just call "clang" and let $PATH
10+
resolve it, which would conveniently make it use our version of
11+
clang-12 installed under /opt/clang/bin. Now, it hardcodes the
12+
compiler as being /opt/datadog-agent/embedded/bin/clang-bpf. While
13+
this could work fine (because clang-bpf has exactly the same version
14+
as our clang), upstream's clang doesn't come with system headers
15+
available. This makes clang-bpf fail to find stdarg.h, which causes
16+
an FTBFS.
17+
18+
* https://github.com/DataDog/datadog-agent/commit/81ff57c37398943f4e8f486cb51d6ffeb8f901e7
19+
got rid of quite a few headers included in
20+
pkg/security/ebpf/c/prebuilt/probe.c. One of them, <linux/mount.h>,
21+
is actually still necessary to perform our build (otherwise clang
22+
will error out with undefined reference for MNT_INTERNAL).
23+
24+
diff --git a/pkg/security/ebpf/c/prebuilt/probe.c b/pkg/security/ebpf/c/prebuilt/probe.c
25+
index 38655a7246..767c247062 100644
26+
--- a/pkg/security/ebpf/c/prebuilt/probe.c
27+
+++ b/pkg/security/ebpf/c/prebuilt/probe.c
28+
@@ -4,6 +4,8 @@
29+
#include <linux/types.h>
30+
#include <linux/version.h>
31+
32+
+#include <linux/mount.h>
33+
+
34+
#include <net/sock.h>
35+
#include <net/netfilter/nf_conntrack.h>
36+
#include <net/netfilter/nf_nat.h>
37+
diff --git a/tasks/system_probe.py b/tasks/system_probe.py
38+
index c800313532..7a270835e6 100644
39+
--- a/tasks/system_probe.py
40+
+++ b/tasks/system_probe.py
41+
@@ -132,17 +132,17 @@ def ninja_define_ebpf_compiler(
42+
nw.variable("kheaders", get_kernel_headers_flags(kernel_release, arch=arch))
43+
nw.rule(
44+
name="ebpfclang",
45+
- command="/opt/datadog-agent/embedded/bin/clang-bpf -MD -MF $out.d $target $ebpfflags $kheaders $flags -c $in -o $out",
46+
+ command="/opt/clang/bin/clang -MD -MF $out.d $target $ebpfflags $kheaders $flags -c $in -o $out",
47+
depfile="$out.d",
48+
)
49+
50+
- strip = "/opt/datadog-agent/embedded/bin/llvm-strip -g $out"
51+
- strip_lbb = "/opt/datadog-agent/embedded/bin/llvm-strip -w -N \"LBB*\" $out"
52+
+ strip = "/opt/clang/bin/llvm-strip -g $out"
53+
+ strip_lbb = "/opt/clang/bin/llvm-strip -w -N \"LBB*\" $out"
54+
strip_part = f"&& {strip} && {strip_lbb}" if strip_object_files else ""
55+
56+
nw.rule(
57+
name="llc",
58+
- command=f"/opt/datadog-agent/embedded/bin/llc-bpf -march=bpf -filetype=obj -o $out $in {strip_part}",
59+
+ command=f"/opt/clang/bin/llc -march=bpf -filetype=obj -o $out $in {strip_part}",
60+
)
61+
62+
63+
@@ -151,7 +151,7 @@ def ninja_define_co_re_compiler(nw: NinjaWriter, arch: Arch | None = None):
64+
65+
nw.rule(
66+
name="ebpfcoreclang",
67+
- command="/opt/datadog-agent/embedded/bin/clang-bpf -MD -MF $out.d -target bpf $ebpfcoreflags $flags -c $in -o $out",
68+
+ command="/opt/clang/bin/clang -MD -MF $out.d -target bpf $ebpfcoreflags $flags -c $in -o $out",
69+
depfile="$out.d",
70+
)
71+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
diff --git a/pkg/security/resolvers/sbom/collectorv2/sqlite.go b/pkg/security/resolvers/sbom/collectorv2/sqlite.go
2+
index 6e46d97c..5ba3392a 100644
3+
--- a/pkg/security/resolvers/sbom/collectorv2/sqlite.go
4+
+++ b/pkg/security/resolvers/sbom/collectorv2/sqlite.go
5+
@@ -16,6 +16,15 @@ import (
6+
// This is required to load sqlite based RPM databases
7+
func init() {
8+
// mattn/go-sqlite3 is only registering the sqlite3 driver
9+
- // let's register the sqlite (no 3) driver as well
10+
- sql.Register("sqlite", &sqlite3.SQLiteDriver{})
11+
+ // let's register the sqlite (no 3) driver as well, but only if not already registered
12+
+ // to avoid panic from duplicate registration (can happen when both this package and
13+
+ // pkg/util/trivy are imported together like how we bundle during build time)
14+
+ func() {
15+
+ defer func() {
16+
+ if r := recover(); r != nil {
17+
+ // Driver already registered, silently ignore
18+
+ }
19+
+ }()
20+
+ sql.Register("sqlite", &sqlite3.SQLiteDriver{})
21+
+ }()
22+
}
23+
diff --git a/pkg/util/trivy/sqlite.go b/pkg/util/trivy/sqlite.go
24+
index 97f6f93d..e4f33da1 100644
25+
--- a/pkg/util/trivy/sqlite.go
26+
+++ b/pkg/util/trivy/sqlite.go
27+
@@ -18,6 +18,15 @@ import (
28+
// This is required to load sqlite based RPM databases
29+
func init() {
30+
// mattn/go-sqlite3 is only registering the sqlite3 driver
31+
- // let's register the sqlite (no 3) driver as well
32+
- sql.Register("sqlite", &sqlite3.SQLiteDriver{})
33+
+ // let's register the sqlite (no 3) driver as well, but only if not already registered
34+
+ // to avoid panic from duplicate registration (can happen when both this package and
35+
+ // pkg/security/resolvers/sbom/collectorv2 are imported together like how we bundle during build time)
36+
+ func() {
37+
+ defer func() {
38+
+ if r := recover(); r != nil {
39+
+ // Driver already registered, silently ignore
40+
+ }
41+
+ }()
42+
+ sql.Register("sqlite", &sqlite3.SQLiteDriver{})
43+
+ }()
44+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/datadog_checks_dev/pyproject.toml b/datadog_checks_dev/pyproject.toml
2+
index 260e4dc642..8f66624770 100644
3+
--- a/datadog_checks_dev/pyproject.toml
4+
+++ b/datadog_checks_dev/pyproject.toml
5+
@@ -68,7 +68,7 @@ cli = [
6+
"pip-tools",
7+
"pathspec>=0.10.0",
8+
"platformdirs>=2.0.0a3",
9+
- "pydantic>=2.0.2",
10+
+ "pydantic>=2.4.0",
11+
"pysmi==0.3.4",
12+
"securesystemslib[crypto]==0.28.0",
13+
"semver>=2.13.0",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/mysql/hatch.toml b/mysql/hatch.toml
2+
index 2f6784e9ce..b47f98c80c 100644
3+
--- a/mysql/hatch.toml
4+
+++ b/mysql/hatch.toml
5+
@@ -10,7 +10,7 @@ mypy-args = [
6+
mypy-deps = [
7+
"types-cachetools==0.1.10",
8+
"types-enum34==1.1.1",
9+
- "types-pymysql==1.1.0.1",
10+
+ "types-pymysql==1.1.1.1",
11+
]
12+
13+
[[envs.default.matrix]]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/singlestore/hatch.toml b/singlestore/hatch.toml
2+
index 142ef97f7a..7ce040c208 100644
3+
--- a/singlestore/hatch.toml
4+
+++ b/singlestore/hatch.toml
5+
@@ -2,7 +2,7 @@
6+
check-types = false
7+
8+
mypy-deps = [
9+
- "types-PyMySQL==1.1.0.1",
10+
+ "types-PyMySQL==1.1.1.1",
11+
]
12+
13+
[[envs.default.matrix]]
File renamed without changes.

0 commit comments

Comments
 (0)