-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to build on non-glibc env #32943
base: main
Are you sure you want to change the base?
Conversation
Add an build option (`--non-glibc`) to build the agent on non-glibc environment like musl libc. The option disables system-probe gpu module and corechecks gpu collector using `github.com/NVIDIA/go-nvml` which depends on a glibc-extended definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just small edits, but approving to not block.
--- | ||
enhancements: | ||
- | | ||
Add an build option (`--non-glibc`) to build the agent on non-glibc environment like musl libc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an build option (`--non-glibc`) to build the agent on non-glibc environment like musl libc. | |
Add an build option (`--non-glibc`) to build the Agent on `non-glibc` environment like musl libc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments
@@ -146,6 +146,7 @@ def build( | |||
bundle_ebpf=False, | |||
agent_bin=None, | |||
run_on=None, # noqa: U100, F841. Used by the run_on_devcontainer decorator | |||
non_glibc=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a glibc=True
argument for the invoke task and have --no-glibc
be the command line option that gets you a non-glibc build.
): | ||
""" | ||
Build the system-probe | ||
""" | ||
raise NameError('test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this.
@@ -3,7 +3,7 @@ | |||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | |||
// Copyright 2016-present Datadog, Inc. | |||
|
|||
//go:build linux && !arm64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go build tags are usually positive assertions, so let's use a glibc
build tag instead and add it to the list of default build tags.
What does this PR do?
Add an build option (
--non-glibc
) to build the agent on non-glibc environment like musl libc.The option disables system-probe gpu module and corechecks gpu collector using
github.com/NVIDIA/go-nvml
which depends on a glibc-extended definition.Motivation
(reported at #32942)
Recently added system-probe gpu module and corechecks gpu collector use github.com/NVIDIA/go-nvml which requires glibc.
So, agent can't be built for non-glibc environments like Alpine Linux and Arch Linux which use musl libc.
Describe how you validated your changes
I applied this change as a patch to seqsense/datadog-agent-alpine#134 and confirmed that the build is fixed by setting the option
--non-glibc
.Possible Drawbacks / Trade-offs
The doesn't take effect unless setting the option.
Additional Notes