<div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you want to do a minimal build of libvirt you can run meson with<br>
--auto-features=disabled which will disable most of the features and you<br>
can explicitly enable only the things that you want to use (this is what<br>
most distributions are doing when building packages). I just noticed<br>
that there are some build options where this doesn't work so I'll post<br>
patches to fix them.</blockquote><div><br></div><div>When you happen to do this, can you share a link where I can download the patches? <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>The last part I have to ask what do you mean by "without dynamic lib<br>
dependencies"? If you mean that libvirt.so should be statically linked<br>
that is not currently possible. We would have to add option to make it<br>
possible and update all dependency() and find_library() calls in all<br>
meson.build files to look only for static libraries.</div></blockquote><div><br></div><div>Uh, I wonder what the meson option <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>default_library         shared                                                                    [shared, static, both]</div></blockquote><div><br></div><div>is for? <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>In addition I think we should add build options which would allow users<br>
to disable tests, documentation, examples and other bits that end-users<br>
don't have to use.</div></blockquote><div><br></div><div>That makes sense.</div><div><br></div><div>Thank you Martin and Pavel for replying back so quickly. I'll try to do the compilation with the auto features disabled and  see how long I can  go from there, this is probably going to be a whack-a-mole game<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 8, 2020 at 3:18 AM Pavel Hrdina <<a href="mailto:phrdina@redhat.com">phrdina@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Oct 08, 2020 at 09:38:22AM +0200, Martin Kletzander wrote:<br>
> On Wed, Oct 07, 2020 at 04:50:26PM -0700, Román González wrote:<br>
> > Hello there,<br>
> > <br>
> > I'm trying to play with musl and libvirt to see if I'm able to build a<br>
> > libvirt client binary without dynamic lib dependencies. I have two<br>
> > questions:<br>
> > <br>
> > 1) to your knowledge, is this exercise futile?<br>
> > <br>
> > 2) Do you know if there is a way to *only* compile the library bits?<br>
> > <br>
> > I want to reduce the number of dependencies in the build, and only<br>
> > construct the libvirt libraries, not libvirtd nor virsh.<br>
> > <br>
> <br>
> You can disable building the daemon with -Ddriver_libvirtd=disabled (if I am<br>
> reading the code correctly).  I do not think there is something similar for the<br>
> clients, but I might be wrong.  Pavel (Cc'd) would definitely know or at least<br>
> be able to find it out more easily.  If it is not possible now then it should<br>
> not be that difficult to add such option, I think.<br>
<br>
Correct, using that option you can disable libvirtd which should reduce<br>
some dependencies but there is no option to disable virsh. We can<br>
possibly introduce an option to disable libvirt clients but that would<br>
save you only readline as a dependency which you can disable by using<br>
-Dreadline=disabled .<br>
<br>
If you want to do a minimal build of libvirt you can run meson with<br>
--auto-features=disabled which will disable most of the features and you<br>
can explicitly enable only the things that you want to use (this is what<br>
most distributions are doing when building packages). I just noticed<br>
that there are some build options where this doesn't work so I'll post<br>
patches to fix them.<br>
<br>
The last part I have to ask what do you mean by "without dynamic lib<br>
dependencies"? If you mean that libvirt.so should be statically linked<br>
that is not currently possible. We would have to add option to make it<br>
possible and update all dependency() and find_library() calls in all<br>
meson.build files to look only for static libraries.<br>
<br>
In addition I think we should add build options which would allow users<br>
to disable tests, documentation, examples and other bits that end-users<br>
don't have to use.<br>
<br>
Pavel<br>
</blockquote></div></div>