On Tue, Sep 26, 2023 at 08:12:43AM -0500, Andrea Bolognani wrote: > On Tue, Sep 26, 2023 at 01:14:33PM +0100, Daniel P. Berrangé wrote: > > On Tue, Sep 26, 2023 at 07:02:19AM -0500, Andrea Bolognani wrote: > > > I don't think it helps much with not storing additional data inside > > > the build system, unless we want to store the contents of the various > > > common snippets in separate files? Something like > > > > > > common_service = fs.read('common_service.inc') > > > unit_conf = configuration_data({ > > > 'common_service' = common_service, > > > }) > > > > > > We'd have to fake fs.read() because it was introduced in 0.57 though. > > > And we'd have to run the contents of the common parts through > > > variable substitution anyway, because they will contain a bunch of > > > lines like > > > > > > Also=@service@.socket > > > Also=@service@-ro.socket > > > Also=@service@-admin.socket > > > > > > I'm not sure the result would look much better, but I can give it a > > > try. > > > > Don't try to do any of this in meson. We should just have a standalone > > python script that can combine the daemon specific unit file contents > > with the common unit file contents. eg > > > > scripts/merge-unit-file.py \ > > src/qemu/virtqemud.service.in \ > > src/rpc/virtd.service.in \ > > build/src/virtqemud.service > > It feels a bit silly to shell out to Python to perform what is > ultimately a bunch of variable substitutions, as if that wasn't part > of Meson's core feature set... But I'll give it a try and see how it > turns out.
IMHO Meson's job is to control the build process, rather than to actually be the build process. I think of this as "compiling" the unit files and the python sript is our compiler, which meson is to control. > Can you please take a look at the remaining patches in the meantime, > and provide feedback on the changes that are made to the various > services and sockets as part of them? Thanks in advance :) With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|