-
Notifications
You must be signed in to change notification settings - Fork 594
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
interfaces,dirs: add ldconfig backend #14926
base: master
Are you sure you want to change the base?
interfaces,dirs: add ldconfig backend #14926
Conversation
Tue Jan 14 19:56:29 UTC 2025 Failures:Prepare:
Restoring:
|
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.
This looks sensible to me, and clean. Thank you
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.
One main question.
Further usually interfaces decide to do different things depending if the slot is implicit (see the usage of the implicitSystemPermanent/ConnectedSlot helpers) but maybe here we want to do something at the backend level?
dirs/dirs.go
Outdated
@@ -465,6 +466,7 @@ func SetRootDir(rootdir string) { | |||
|
|||
SnapDataDir = filepath.Join(rootdir, "/var/snap") | |||
SnapAppArmorDir = filepath.Join(rootdir, snappyDir, "apparmor", "profiles") | |||
SnapLdconfigDir = filepath.Join(rootdir, "etc/ld.so.conf.d") |
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.
nitpick: the style here seems to be /etc...
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.
Changed
interfaces/ldconfig/backend.go
Outdated
// the rootfs. For snaps, we will create files in | ||
// /var/lib/snapd/ldconfig/ that will be used to generate a cache | ||
// specific to each snap. | ||
ldconfigPath := filepath.Join(dir, "snapd.conf") |
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'm confused, specification are per snap app set but here we reuse the same file? won't multiple snap stomp on each ther?
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 have changed this. However I started to re-think about this and I am not sure anymore, maybe I'm missing some piece. I created snapd.conf
thinking of it as the only config file for the "system" (rootfs) snap (the implementation is not considering exporting libraries to snap yet). That is, the "snap app set" here is the rootfs. Afaiu any change in interfaces would trigger the call to Setup(), and having multiple files will help with knowing where libraries come from (this could still be done by adding comments in snapd.conf
), but there is no other practical effect as the call to ldconfig
will process all files in here.
My plan for the implementation for the snaps case, is to have also only one config file per snap, that will be seen in ld.so.conf.d/ but only for the mount namespace of the snap, that would be a mix of the contents of the app base and of these files generated by snapd (that will be found also in the rootfs in, maybe, /var/lib/snapd/ldconfig/).
This backend will expose libraries coming from snaps to either the rootfs or to other snaps (currently supporting only the former).
df1088b
to
c5cad2c
Compare
This backend will expose libraries coming from snaps to either the
rootfs or to other snaps (currently supporting only the former).