Skip to contentSkip to conversation

virtiofsd: Meson build fix

PATCH In review Philippe Mathieu-Daudé 7 participants 12 messages Apr 29, 2021 – Apr 30, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/2 meson: Select 'have_system' when virtiofsd is enabled

In reply to Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

  $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
  tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +2 -0
index c6f4b0cf5e8..f858935ad95 100644
@@ -51,6 +51,8 @@
   have_system = have_system or target.endswith('-softmmu')
 endforeach
 have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()
 have_block = have_system or have_tools
 
 python = import('python').find_installation()
Signature · 1 line
2.26.3
#0 lore raw

v2 cover virtiofsd: Meson build fix

Meson fix to allow building virtiofsd without sysemu/tools.

Since v1:
- reworked meson (Richard)
- added CI job (Dave)

Regards,

Phil.

Supersedes: <[email protected]>

Philippe Mathieu-Daudé (2):
meson: Select 'have_system' when virtiofsd is enabled
gitlab-ci: Add a job to build virtiofsd standalone

 meson.build    |  2 ++
 .gitlab-ci.yml | 13 +++++++++++++
 2 files changed, 15 insertions(+)
Signature · 1 line
2.26.3
#7 lore raw

PATCH v2 2/2 gitlab-ci: Add a job to build virtiofsd standalone

Add a job which builds virtiofsd without any emulation or tool.

---
https://gitlab.com/philmd/qemu/-/jobs/1222007991
Duration: 7 minutes 48 seconds

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
.gitlab-ci.yml +13 -0
index 52d65d6c04f..ba3c7ade6ca 100644
@@ -800,6 +800,19 @@ build-libvhost-user:
     - meson
     - ninja
 
+build-virtiofsd-fedora:
+  <<: *native_build_job_definition
+  needs:
+    job: amd64-fedora-container
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --enable-virtiofsd
+        --disable-system --disable-user --disable-tools --disable-docs
+  artifacts:
+    expire_in: 2 days
+    paths:
+      - build/tools/virtiofsd/virtiofsd
+
 # No targets are built here, just tools, docs, and unit tests. This
 # also feeds into the eventual documentation deployment steps later
 build-tools-and-docs-debian:
Signature · 1 line
2.26.3
#8 lore raw

Re: [PATCH v2 2/2] gitlab-ci: Add a job to build virtiofsd standalone

Quoted 20 lines · Philippe Mathieu-Daudé

Add a job which builds virtiofsd without any emulation or tool.

---
https://gitlab.com/philmd/qemu/-/jobs/1222007991
Duration: 7 minutes 48 seconds

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
.gitlab-ci.yml +2 -0
index 52d65d6c04f..ba3c7ade6ca 100644
@@ -800,6 +800,19 @@ build-libvhost-user:
     - meson
     - ninja
 
+build-virtiofsd-fedora:
+  <<: *native_build_job_definition

.gitlab-ci.yml build-libvhost-user: · line 814

Quoted 10 lines
.gitlab-ci.yml +10 -0
+  needs:
+    job: amd64-fedora-container
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --enable-virtiofsd
+        --disable-system --disable-user --disable-tools --disable-docs
+  artifacts:
+    expire_in: 2 days
+    paths:
+      - build/tools/virtiofsd/virtiofsd

I'm not convinced that this job is justiable given our need to keep the total CI pipeline size constrained. The precedent this sets is that we need to test every configure args combination for each binary we build. That is not scalable as a pattern. Neither this virtiofsd arg scenario, nor others is going to be commonly used by downstream consumers of QEMU, so the payoff from having this job is also small.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#2 lore raw

Re: [PATCH v2 1/2] meson: Select 'have_system' when virtiofsd is enabled

In reply to Philippe Mathieu-Daudé
Quoted 20 lines · Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

  $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
  tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +0 -0
index c6f4b0cf5e8..f858935ad95 100644

meson.build line 55

Quoted 5 lines
meson.build +2 -0
@@ -51,6 +51,8 @@
   have_system = have_system or target.endswith('-softmmu')
 endforeach
 have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()

This looks odd. The natural assumption is that "have_system" ought to mean "we are building a system emulator", not "we are building a system emulator or virtiofsd".

thanks
-- PMM

#9 lore raw

Re: [PATCH v2 2/2] gitlab-ci: Add a job to build virtiofsd standalone

In reply to Daniel P. Berrangé
Quoted 30 lines · Daniel P. Berrangé
Quoted 29 lines · Philippe Mathieu-Daudé

Add a job which builds virtiofsd without any emulation or tool.

---
https://gitlab.com/philmd/qemu/-/jobs/1222007991
Duration: 7 minutes 48 seconds

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
.gitlab-ci.yml +11 -0
index 52d65d6c04f..ba3c7ade6ca 100644
@@ -800,6 +800,19 @@ build-libvhost-user:
     - meson
     - ninja
 
+build-virtiofsd-fedora:
+  <<: *native_build_job_definition
+  needs:
+    job: amd64-fedora-container
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --enable-virtiofsd
+        --disable-system --disable-user --disable-tools --disable-docs
+  artifacts:
+    expire_in: 2 days
+    paths:
Quoted 8 lines

.gitlab-ci.yml build-libvhost-user: · line 814

Quoted 1 line
.gitlab-ci.yml +1 -0
+      - build/tools/virtiofsd/virtiofsd

I'm not convinced that this job is justiable given our need to keep the total CI pipeline size constrained. The precedent this sets is that we need to test every configure args combination for each binary we build. That is not scalable as a pattern. Neither this virtiofsd arg scenario, nor others is going to be commonly used by downstream consumers of QEMU, so the payoff from having this job is also small.

I'm not sure "our current pipelines is too busy because we don't have a clear idea what is tested and what is duplicated" justifies no more tests can be added, but it is a effective way to have the current set cleaned.

Anyhow, if mainstream isn't interested by this configuration, it could be added to the virtio-fs/qemu fork. Alternatively mainstream with:

only:
variables:
- $CI_PROJECT_NAMESPACE == 'virtio-fs'

#10 lore raw

Re: [PATCH v2 2/2] gitlab-ci: Add a job to build virtiofsd standalone

In reply to Philippe Mathieu-Daudé

Hi,

Quoted 21 lines · Philippe Mathieu-Daudé

Add a job which builds virtiofsd without any emulation or tool.

---
https://gitlab.com/philmd/qemu/-/jobs/1222007991
Duration: 7 minutes 48 seconds

---
  .gitlab-ci.yml | 13 +++++++++++++
  1 file changed, 13 insertions(+)
.gitlab-ci.yml +3 -0
index 52d65d6c04f..ba3c7ade6ca 100644
@@ -800,6 +800,19 @@ build-libvhost-user:
      - meson
      - ninja
 
+build-virtiofsd-fedora:
+  <<: *native_build_job_definition
+  needs:

.gitlab-ci.yml build-libvhost-user: · line 815

Quoted 10 lines
.gitlab-ci.yml +10 -0
+    job: amd64-fedora-container
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --enable-virtiofsd
+        --disable-system --disable-user --disable-tools --disable-docs
+  artifacts:
+    expire_in: 2 days
+    paths:
+      - build/tools/virtiofsd/virtiofsd
+

Why it needs the executable archived?

- Wainer

Quoted 3 lines
.gitlab-ci.yml +0 -0
  # No targets are built here, just tools, docs, and unit tests. This
  # also feeds into the eventual documentation deployment steps later
  build-tools-and-docs-debian:
#11 lore raw

Re: [PATCH v2 2/2] gitlab-ci: Add a job to build virtiofsd standalone

Quoted 27 lines · Wainer dos Santos Moschetta

Hi,

Quoted 24 lines · Philippe Mathieu-Daudé

Add a job which builds virtiofsd without any emulation or tool.

---
https://gitlab.com/philmd/qemu/-/jobs/1222007991
Duration: 7 minutes 48 seconds
---
  .gitlab-ci.yml | 13 +++++++++++++

  1 file changed, 13 insertions(+)
.gitlab-ci.yml +0 -0
index 52d65d6c04f..ba3c7ade6ca 100644
@@ -800,6 +800,19 @@ build-libvhost-user:

      - meson
      - ninja
  +build-virtiofsd-fedora:
+  <<: *native_build_job_definition
+  needs:
+    job: amd64-fedora-container
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --enable-virtiofsd

Quoted 8 lines
Quoted 6 lines

+        --disable-system --disable-user --disable-tools --disable-docs +  artifacts:
+    expire_in: 2 days
+    paths:
+      - build/tools/virtiofsd/virtiofsd
+

Why it needs the executable archived?

I assumed if there were testing jobs as next stage, this is what they would consume? I copy/pasted from another job and adapted, but you are right, it is pointless. AnyhowI understood this job has been discarded during review.

Thanks for having a look!

Phil.

#4 lore raw

Re: [PATCH v2 1/2] meson: Select 'have_system' when virtiofsd is enabled

In reply to Philippe Mathieu-Daudé
Quoted 19 lines · Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

  $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
  tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +0 -0
index c6f4b0cf5e8..f858935ad95 100644

meson.build line 55

Quoted 5 lines
meson.build +2 -0
@@ -51,6 +51,8 @@
   have_system = have_system or target.endswith('-softmmu')
 endforeach
 have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()

I don't think we should satisfy virtiofsd dependencies transiently by depending on system emulation targets.

It's my understanding (and I'm happy to be corrected on this) that the virtiofsd binary is orthogonal to system emulation tools. Consider a situation in which someone wants to develop virtiofsd but doesn't want to wait for the rest of QEMU to build and instead use their own qemu-system-x86_64 installed by their distro.

Connor

Quoted 4 lines
meson.build +0 -0
 have_block = have_system or have_tools
 
 python = import('python').find_installation()
#5 lore raw

Re: [PATCH v2 1/2] meson: Select 'have_system' when virtiofsd is enabled

Quoted 29 lines · Connor Kuehl
Quoted 19 lines · Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

  $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
  tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +0 -0
index c6f4b0cf5e8..f858935ad95 100644

meson.build line 55

Quoted 5 lines
meson.build +2 -0
@@ -51,6 +51,8 @@
   have_system = have_system or target.endswith('-softmmu')
 endforeach
 have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()

I don't think we should satisfy virtiofsd dependencies transiently by depending on system emulation targets.

Quoted 5 lines

It's my understanding (and I'm happy to be corrected on this) that the virtiofsd binary is orthogonal to system emulation tools. Consider a situation in which someone wants to develop virtiofsd but doesn't want to wait for the rest of QEMU to build and instead use their own qemu-system-x86_64 installed by their distro.

This is what I understood in your previous thread with Mahmoud.

Peter questioned this orthogonality in v1, asking why virtiofsd is in the QEMU repository then...

Quoted 7 lines

Connor

Quoted 4 lines
meson.build +0 -0
 have_block = have_system or have_tools
 
 python = import('python').find_installation()
#6 lore raw

Re: [PATCH v2 1/2] meson: Select 'have_system' when virtiofsd is enabled

Quoted 36 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Quoted 29 lines · Connor Kuehl
Quoted 19 lines · Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

  $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
  tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
 meson.build | 2 ++
 1 file changed, 2 insertions(+)
meson.build +0 -0
index c6f4b0cf5e8..f858935ad95 100644

meson.build line 55

Quoted 5 lines
meson.build +2 -0
@@ -51,6 +51,8 @@
   have_system = have_system or target.endswith('-softmmu')
 endforeach
 have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()

I don't think we should satisfy virtiofsd dependencies transiently by depending on system emulation targets.

Quoted 5 lines

It's my understanding (and I'm happy to be corrected on this) that the virtiofsd binary is orthogonal to system emulation tools. Consider a situation in which someone wants to develop virtiofsd but doesn't want to wait for the rest of QEMU to build and instead use their own qemu-system-x86_64 installed by their distro.

Quoted 4 lines

This is what I understood in your previous thread with Mahmoud.

Peter questioned this orthogonality in v1, asking why virtiofsd is in the QEMU repository then...

People were insisting that there was an implementation in when accepting the qemu side patches.

Dave

Quoted 8 lines
Quoted 7 lines

Connor

Quoted 4 lines
meson.build +0 -0
 have_block = have_system or have_tools
 
 python = import('python').find_installation()
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
#3 lore raw

Re: [PATCH v2 1/2] meson: Select 'have_system' when virtiofsd is enabled

In reply to Peter Maydell
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Philippe Mathieu-Daudé

When not explicitly select a sysemu target and building virtiofsd, the seccomp/cap-ng libraries are not resolved, leading to this error:

   $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd
   tools/meson.build:12:6: ERROR: Problem encountered: virtiofsd requires libcap-ng-devel and seccomp-devel

Fix by enabling sysemu (have_system) when virtiofsd is built.

---
  meson.build | 2 ++
  1 file changed, 2 insertions(+)
Quoted 14 lines

meson.build line 55

Quoted 10 lines
meson.build +2 -0
index c6f4b0cf5e8..f858935ad95 100644
@@ -51,6 +51,8 @@
    have_system = have_system or target.endswith('-softmmu')
  endforeach
  have_tools = 'CONFIG_TOOLS' in config_host
+# virtiofsd depends on sysemu
+have_system = have_system or not get_option('virtiofsd').disabled()

This looks odd. The natural assumption is that "have_system" ought to mean "we are building a system emulator", not "we are building a system emulator or virtiofsd".

I agree this is a bit jarring.

If virtiofsd requires libcap-ng-devel and seccomp-devel, those tests only should use

have_system or not get_option('virtiofsd').disabled()

instead of just have_system. (The reason why we have those complicated expressions is to avoid getting warnings on static builds, for libraries that are only available as shared libraries. There are plans to make it look a bit nicer in upstream Meson which the maintainers have already accepted; however, I haven't been able to contribute much to it lately).

Thanks,

Paolo