diff mbox series

[v3,1/4] tests/lcitool: Generate distribution packages list in JSON format

Message ID 20230711144922.67491-2-philmd@linaro.org
State Superseded
Headers show
Series tests/vm/freebsd: Get up-to-date package list from lcitool | expand

Commit Message

Philippe Mathieu-Daudé July 11, 2023, 2:49 p.m. UTC
Add the generate_pkglist() helper to generate a list of packages
required by a distribution to build QEMU.

Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in
JSON, create the files under tests/vm/generated/ sub-directory;
add a README mentioning the files are generated.

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/lcitool/refresh     | 11 +++++++++++
 tests/vm/generated/README |  5 +++++
 2 files changed, 16 insertions(+)
 create mode 100644 tests/vm/generated/README

Comments

Daniel P. Berrangé July 11, 2023, 3:31 p.m. UTC | #1
On Tue, Jul 11, 2023 at 04:49:19PM +0200, Philippe Mathieu-Daudé wrote:
> Add the generate_pkglist() helper to generate a list of packages
> required by a distribution to build QEMU.
> 
> Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in
> JSON, create the files under tests/vm/generated/ sub-directory;
> add a README mentioning the files are generated.
> 
> Suggested-by: Erik Skultety <eskultet@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/lcitool/refresh     | 11 +++++++++++
>  tests/vm/generated/README |  5 +++++

Or 's/generated/packages/' perhaps ?

>  2 files changed, 16 insertions(+)
>  create mode 100644 tests/vm/generated/README

Either way, at your discretion

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


With regards,
Daniel
Warner Losh July 11, 2023, 7:39 p.m. UTC | #2
On Tue, Jul 11, 2023 at 8:49 AM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> Add the generate_pkglist() helper to generate a list of packages
> required by a distribution to build QEMU.
>
> Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in
> JSON, create the files under tests/vm/generated/ sub-directory;
> add a README mentioning the files are generated.
>
> Suggested-by: Erik Skultety <eskultet@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

also, FreeBSD 14 branches next month... do I just grep for FreeBSD-13 to
find all the places to update for 14.0?

Warner

---
>  tests/lcitool/refresh     | 11 +++++++++++
>  tests/vm/generated/README |  5 +++++
>  2 files changed, 16 insertions(+)
>  create mode 100644 tests/vm/generated/README
>
> diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> index b54566edcc..4584870ea1 100755
> --- a/tests/lcitool/refresh
> +++ b/tests/lcitool/refresh
> @@ -84,6 +84,12 @@ def generate_cirrus(target, trailer=None):
>      generate(filename, cmd, trailer)
>
>
> +def generate_pkglist(vm, target):
> +    filename = Path(src_dir, "tests", "vm", "generated", vm + ".json")
> +    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
> +    generate(filename, cmd, None)
> +
> +
>  # Netmap still needs to be manually built as it is yet to be packaged
>  # into a distro. We also add cscope and gtags which are used in the CI
>  # test
> @@ -191,6 +197,11 @@ try:
>      generate_cirrus("freebsd-13")
>      generate_cirrus("macos-12")
>
> +    #
> +    # VM packages lists
> +    #
> +    generate_pkglist("freebsd", "freebsd-13")
> +
>      sys.exit(0)
>  except Exception as ex:
>      print(str(ex), file=sys.stderr)
> diff --git a/tests/vm/generated/README b/tests/vm/generated/README
> new file mode 100644
> index 0000000000..7ccc6ffd3d
> --- /dev/null
> +++ b/tests/vm/generated/README
> @@ -0,0 +1,5 @@
> +# FILES IN THIS FOLDER WERE AUTO-GENERATED
> +#
> +#  $ make lcitool-refresh
> +#
> +# https://gitlab.com/libvirt/libvirt-ci
> --
> 2.38.1
>
>
Philippe Mathieu-Daudé July 12, 2023, 11:07 a.m. UTC | #3
On 11/7/23 21:39, Warner Losh wrote:
> On Tue, Jul 11, 2023 at 8:49 AM Philippe Mathieu-Daudé 
> <philmd@linaro.org <mailto:philmd@linaro.org>> wrote:
> 
>     Add the generate_pkglist() helper to generate a list of packages
>     required by a distribution to build QEMU.
> 
>     Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in
>     JSON, create the files under tests/vm/generated/ sub-directory;
>     add a README mentioning the files are generated.
> 
>     Suggested-by: Erik Skultety <eskultet@redhat.com
>     <mailto:eskultet@redhat.com>>
>     Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org
>     <mailto:philmd@linaro.org>>
> 
> 
> Reviewed-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> 
> also, FreeBSD 14 branches next month... do I just grep for FreeBSD-13 to 
> find all the places to update for 14.0?

Per docs/about/build-platforms.rst:

   Linux OS, macOS, FreeBSD, NetBSD, OpenBSD
   -----------------------------------------

   The project aims to support the most recent major version at all
   times for up to five years after its initial release. Support
   for the previous major version will be dropped 2 years after the
   new major version is released or when the vendor itself drops
   support, whichever comes first. [...]

We want to be able to test the oldest/newest releases.

Maybe we can add a pair of definitions, so we'd have to only
change 2 lines in a single place when releases occur?


>     @@ -191,6 +197,11 @@ try:
>           generate_cirrus("freebsd-13")
>           generate_cirrus("macos-12")
> 
>     +    #
>     +    # VM packages lists
>     +    #
>     +    generate_pkglist("freebsd", "freebsd-13")
Warner Losh July 12, 2023, 5:57 p.m. UTC | #4
On Wed, Jul 12, 2023 at 5:07 AM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> On 11/7/23 21:39, Warner Losh wrote:
> > On Tue, Jul 11, 2023 at 8:49 AM Philippe Mathieu-Daudé
> > <philmd@linaro.org <mailto:philmd@linaro.org>> wrote:
> >
> >     Add the generate_pkglist() helper to generate a list of packages
> >     required by a distribution to build QEMU.
> >
> >     Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in
> >     JSON, create the files under tests/vm/generated/ sub-directory;
> >     add a README mentioning the files are generated.
> >
> >     Suggested-by: Erik Skultety <eskultet@redhat.com
> >     <mailto:eskultet@redhat.com>>
> >     Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org
> >     <mailto:philmd@linaro.org>>
> >
> >
> > Reviewed-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> >
> > also, FreeBSD 14 branches next month... do I just grep for FreeBSD-13 to
> > find all the places to update for 14.0?
>
> Per docs/about/build-platforms.rst:
>
>    Linux OS, macOS, FreeBSD, NetBSD, OpenBSD
>    -----------------------------------------
>
>    The project aims to support the most recent major version at all
>    times for up to five years after its initial release. Support
>    for the previous major version will be dropped 2 years after the
>    new major version is released or when the vendor itself drops
>    support, whichever comes first. [...]
>
> We want to be able to test the oldest/newest releases.
>
> Maybe we can add a pair of definitions, so we'd have to only
> change 2 lines in a single place when releases occur?
>

I'd love that. There's two bits of information per release: name and
checksum
of release artifacts.

Warner


>
> >     @@ -191,6 +197,11 @@ try:
> >           generate_cirrus("freebsd-13")
> >           generate_cirrus("macos-12")
> >
> >     +    #
> >     +    # VM packages lists
> >     +    #
> >     +    generate_pkglist("freebsd", "freebsd-13")
>
>
diff mbox series

Patch

diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index b54566edcc..4584870ea1 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -84,6 +84,12 @@  def generate_cirrus(target, trailer=None):
     generate(filename, cmd, trailer)
 
 
+def generate_pkglist(vm, target):
+    filename = Path(src_dir, "tests", "vm", "generated", vm + ".json")
+    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
+    generate(filename, cmd, None)
+
+
 # Netmap still needs to be manually built as it is yet to be packaged
 # into a distro. We also add cscope and gtags which are used in the CI
 # test
@@ -191,6 +197,11 @@  try:
     generate_cirrus("freebsd-13")
     generate_cirrus("macos-12")
 
+    #
+    # VM packages lists
+    #
+    generate_pkglist("freebsd", "freebsd-13")
+
     sys.exit(0)
 except Exception as ex:
     print(str(ex), file=sys.stderr)
diff --git a/tests/vm/generated/README b/tests/vm/generated/README
new file mode 100644
index 0000000000..7ccc6ffd3d
--- /dev/null
+++ b/tests/vm/generated/README
@@ -0,0 +1,5 @@ 
+# FILES IN THIS FOLDER WERE AUTO-GENERATED
+#
+#  $ make lcitool-refresh
+#
+# https://gitlab.com/libvirt/libvirt-ci