[PATCH] rpc: Require dtrace sources to be generated first

Michal Privoznik posted 1 patch 2 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/7f3e123a70182575a882665fc024632180b37724.1639998089.git.mprivozn@redhat.com
src/rpc/meson.build | 1 +
1 file changed, 1 insertion(+)
[PATCH] rpc: Require dtrace sources to be generated first
Posted by Michal Privoznik 2 years, 4 months ago
The virt_socket_lib is built from virnetsocket.c (among others).
But this file includes virprobe.h which includes libvirt_probes.h
which is a generated file. But this dependency is not recorded in
meson which may lead to a failed build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

I don't know if this is the right fix or we need to go with
declare_dependency(), or even something else. But this fixes the build
for me.

 src/rpc/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/rpc/meson.build b/src/rpc/meson.build
index 7fde92e6cf..36a2809adf 100644
--- a/src/rpc/meson.build
+++ b/src/rpc/meson.build
@@ -9,6 +9,7 @@ socket_sources = [
 virt_socket_lib = static_library(
   'virt_socket',
   [
+    dtrace_gen_headers,
     socket_sources,
   ],
   dependencies: [
-- 
2.32.0

Re: [PATCH] rpc: Require dtrace sources to be generated first
Posted by Daniel P. Berrangé 2 years, 3 months ago
On Mon, Dec 20, 2021 at 12:02:41PM +0100, Michal Privoznik wrote:
> The virt_socket_lib is built from virnetsocket.c (among others).
> But this file includes virprobe.h which includes libvirt_probes.h
> which is a generated file. But this dependency is not recorded in
> meson which may lead to a failed build.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> 
> I don't know if this is the right fix or we need to go with
> declare_dependency(), or even something else. But this fixes the build
> for me.

We do similar to this in other places for dtrace_gen_headers

> 
>  src/rpc/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/rpc/meson.build b/src/rpc/meson.build
> index 7fde92e6cf..36a2809adf 100644
> --- a/src/rpc/meson.build
> +++ b/src/rpc/meson.build
> @@ -9,6 +9,7 @@ socket_sources = [
>  virt_socket_lib = static_library(
>    'virt_socket',
>    [
> +    dtrace_gen_headers,
>      socket_sources,
>    ],
>    dependencies: [

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


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 :|