-
Notifications
You must be signed in to change notification settings - Fork 434
Fix ldcache update on non debian systems #1444
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
base: main
Are you sure you want to change the base?
Conversation
|
/cherry-pick release-1.18 |
9a32323 to
fb95f58
Compare
aa0c6fa to
a854d3d
Compare
cdesiniotis
left a comment
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 left a couple of comments / questions, but no blockers.
internal/ldconfig/ldconfig.go
Outdated
| if len(args) < 1 { | ||
| return nil, fmt.Errorf("incorrect arguments: %v", args) | ||
| } | ||
| fs := flag.NewFlagSet(args[1], flag.ExitOnError) |
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.
Question -- is args[1] the right name to give to this flag set? What about something along the lines of ldconfig-options?
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.
You're right. This was definitely a copy-paste error on my part.
2794eaa to
0b28791
Compare
internal/ldconfig/ldconfig.go
Outdated
| func (l *Ldconfig) getSystemSerachPaths() []string { | ||
| func (l *Ldconfig) getSystemSearchPaths() []string { | ||
| if l.isDebianLikeContainer { | ||
| debianSystemSearchPaths() |
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've been debugging issues on my homelab cluster with the latest CTK release, and I just spotted this code here. I think it's missing a return. I can send a PR for the existing code, or we can roll that fix into this PR.
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 #1457
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.
Thanks for the fix. In order to minimize backport churn, let's add the commit to this PR.
This change ensures that the ldcache in a non-debian container includes libraries at /lib64 and /usr/lib64 when running on debian host. This is required because the system search paths do not include these folders by default resulting in a non-debian container missing system libraries from the ldcache. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
f432507 to
70cca03
Compare
|
I'm preparing a follow up / alternative to this patch to handle additional cases I've ran into recently. Should have it out as a branch in an hour or so. |
This change fixes the update of the ldcache when running a non-debian (including ubuntu) container on a debian-like system. Here the ldcache in the container does not initially include system libraries from
/lib64or/usr/lib64since thisldconfigfrom the host that is executed in the container's namespace does not process those paths by default.This is related to #1403 and will need to be updated once that is merged since we would also need to NOT include
lib64and/usr/lib64in the list of folders if it's already present in the config folders for some reason.Testing
The expected behaviour when using
runcdirectly:The current behaviour:
(note that
libc.so.6is not present in the ldcache since/lib64(linked to/usr/lib64) is not processed).The updated behaviour: