qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl
@ 2023-01-09 18:14 marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 1/5] build-sys: fix crlf-ending C code marcandre.lureau
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Fix the shader compilation error on win32/msys2 and convert the related script
from perl to python.

v2:
- add a few patches to drop perl from the build dependencies
- add some tags for v1 patches
- add copyright header to the python script

Marc-André Lureau (5):
  build-sys: fix crlf-ending C code
  .gitlab-ci.d/windows: do not disable opengl
  configure: replace Perl usage with sed
  meson: replace Perl usage with Python
  Draft: Update lcitool

 configure                                     |  8 +++---
 meson.build                                   |  2 +-
 .gitlab-ci.d/cirrus/freebsd-12.vars           |  2 +-
 .gitlab-ci.d/cirrus/freebsd-13.vars           |  2 +-
 .gitlab-ci.d/cirrus/macos-12.vars             |  2 +-
 .gitlab-ci.d/windows.yml                      |  5 ++--
 scripts/ci/setup/build-environment.yml        |  1 -
 scripts/shaderinclude.pl                      | 16 ------------
 scripts/shaderinclude.py                      | 26 +++++++++++++++++++
 tests/docker/dockerfiles/alpine.docker        |  1 -
 tests/docker/dockerfiles/centos8.docker       |  1 -
 .../dockerfiles/debian-amd64-cross.docker     |  1 -
 tests/docker/dockerfiles/debian-amd64.docker  |  1 -
 .../dockerfiles/debian-arm64-cross.docker     |  1 -
 .../dockerfiles/debian-armel-cross.docker     |  1 -
 .../dockerfiles/debian-armhf-cross.docker     |  1 -
 .../dockerfiles/debian-mips64el-cross.docker  |  1 -
 .../dockerfiles/debian-mipsel-cross.docker    |  1 -
 .../dockerfiles/debian-ppc64el-cross.docker   |  1 -
 .../dockerfiles/debian-s390x-cross.docker     |  1 -
 .../dockerfiles/debian-tricore-cross.docker   |  1 -
 .../dockerfiles/fedora-win32-cross.docker     |  5 ++--
 .../dockerfiles/fedora-win64-cross.docker     |  5 ++--
 tests/docker/dockerfiles/fedora.docker        |  5 ++--
 tests/docker/dockerfiles/opensuse-leap.docker |  1 -
 tests/docker/dockerfiles/ubuntu2004.docker    |  1 -
 tests/lcitool/libvirt-ci                      |  2 +-
 tests/lcitool/projects/qemu.yml               |  1 -
 tests/lcitool/refresh                         |  6 ++---
 tests/qapi-schema/meson.build                 |  7 ++---
 tests/vm/centos.aarch64                       |  2 +-
 31 files changed, 50 insertions(+), 61 deletions(-)
 delete mode 100644 scripts/shaderinclude.pl
 create mode 100755 scripts/shaderinclude.py

-- 
2.39.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2 1/5] build-sys: fix crlf-ending C code
  2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
@ 2023-01-09 18:14 ` marcandre.lureau
  2023-01-09 19:02   ` John Snow
  2023-01-09 18:14 ` [PATCH v2 2/5] .gitlab-ci.d/windows: do not disable opengl marcandre.lureau
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

On msys2, the shader-to-C script produces bad C:
./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character [-Werror]

Fix it by changing the line ending from crlf to lf, and convert the
script to Python (qemu build seems perl-free after that).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
---
 meson.build              |  2 +-
 scripts/shaderinclude.pl | 16 ----------------
 scripts/shaderinclude.py | 26 ++++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 17 deletions(-)
 delete mode 100644 scripts/shaderinclude.pl
 create mode 100755 scripts/shaderinclude.py

diff --git a/meson.build b/meson.build
index 175517eafd..b3c6db8343 100644
--- a/meson.build
+++ b/meson.build
@@ -2781,7 +2781,7 @@ config_host_data.set('CONFIG_SLIRP', slirp.found())
 genh += configure_file(output: 'config-host.h', configuration: config_host_data)
 
 hxtool = find_program('scripts/hxtool')
-shaderinclude = find_program('scripts/shaderinclude.pl')
+shaderinclude = find_program('scripts/shaderinclude.py')
 qapi_gen = find_program('scripts/qapi-gen.py')
 qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py',
                      meson.current_source_dir() / 'scripts/qapi/commands.py',
diff --git a/scripts/shaderinclude.pl b/scripts/shaderinclude.pl
deleted file mode 100644
index cd3bb40b12..0000000000
--- a/scripts/shaderinclude.pl
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-my $file = shift;
-open FILE, "<", $file or die "open $file: $!";
-my $name = $file;
-$name =~ s|.*/||;
-$name =~ s/[-.]/_/g;
-print "static GLchar ${name}_src[] =\n";
-while (<FILE>) {
-    chomp;
-    printf "    \"%s\\n\"\n", $_;
-}
-print "    \"\\n\";\n";
-close FILE;
diff --git a/scripts/shaderinclude.py b/scripts/shaderinclude.py
new file mode 100755
index 0000000000..ab2aade2cd
--- /dev/null
+++ b/scripts/shaderinclude.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2023 Red Hat, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import sys
+import os
+
+
+def main(args):
+    file_path = args[1]
+    basename = os.path.basename(file_path)
+    varname = basename.replace('-', '_').replace('.', '_')
+
+    with os.fdopen(sys.stdout.fileno(), "wt", closefd=False, newline='\n') as stdout:
+        with open(file_path, "r", encoding='utf-8') as file:
+            print(f'static GLchar {varname}_src[] =', file=stdout)
+            for line in file:
+                line = line.rstrip()
+                print(f'    "{line}\\n"', file=stdout)
+            print('    "\\n";', file=stdout)
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/5] .gitlab-ci.d/windows: do not disable opengl
  2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 1/5] build-sys: fix crlf-ending C code marcandre.lureau
@ 2023-01-09 18:14 ` marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 3/5] configure: replace Perl usage with sed marcandre.lureau
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The previous patch should fix shader compilation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/windows.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml
index 22f794e537..5e59a7cc96 100644
--- a/.gitlab-ci.d/windows.yml
+++ b/.gitlab-ci.d/windows.yml
@@ -71,7 +71,7 @@ msys2-64bit:
   # for the msys2 64-bit job, due to the build could not complete within
   # the project timeout.
   - ..\msys64\usr\bin\bash -lc '../configure --target-list=x86_64-softmmu
-      --without-default-devices --disable-opengl'
+      --without-default-devices'
   - ..\msys64\usr\bin\bash -lc 'make'
   # qTests don't run successfully with "--without-default-devices",
   # so let's exclude the qtests from CI for now.
@@ -113,7 +113,6 @@ msys2-32bit:
   - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
   - mkdir output
   - cd output
-  - ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu
-        --disable-opengl'
+  - ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu'
   - ..\msys64\usr\bin\bash -lc 'make'
   - ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt; exit 1; } ;'
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/5] configure: replace Perl usage with sed
  2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 1/5] build-sys: fix crlf-ending C code marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 2/5] .gitlab-ci.d/windows: do not disable opengl marcandre.lureau
@ 2023-01-09 18:14 ` marcandre.lureau
  2023-01-09 18:42   ` Peter Maydell
  2023-01-09 18:14 ` [PATCH v2 4/5] meson: replace Perl usage with Python marcandre.lureau
  2023-01-09 18:14 ` [PATCH v2 5/5] Draft: Update lcitool marcandre.lureau
  4 siblings, 1 reply; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Let's try to reduce our Perl usage during config/build-time.

Note: this patch might be dropped if "configure: remove
backwards-compatibility code" is merged earlier.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 2281892657..e45acde404 100755
--- a/configure
+++ b/configure
@@ -2571,11 +2571,9 @@ else
   if test -f meson-private/cmd_line.txt; then
     # Adjust old command line options whose type was changed
     # Avoids having to use "setup --wipe" when Meson is upgraded
-    perl -i -ne '
-      s/^gettext = true$/gettext = auto/;
-      s/^gettext = false$/gettext = disabled/;
-      /^b_staticpic/ && next;
-      print;' meson-private/cmd_line.txt
+    sed -i.bak 's/^gettext = true/gettext = auto/g' -e \
+      's/^gettext = false/gettext = disabled/g' -e \
+      '/^b_staticpic/d' meson-private/cmd_line.txt
   fi
 fi
 
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/5] meson: replace Perl usage with Python
  2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
                   ` (2 preceding siblings ...)
  2023-01-09 18:14 ` [PATCH v2 3/5] configure: replace Perl usage with sed marcandre.lureau
@ 2023-01-09 18:14 ` marcandre.lureau
  2023-01-09 18:51   ` Peter Maydell
  2023-01-09 18:14 ` [PATCH v2 5/5] Draft: Update lcitool marcandre.lureau
  4 siblings, 1 reply; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Let's try to remove Perl usage during build time.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/qapi-schema/meson.build | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 9dfe98bc9a..d85b14f28c 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -259,22 +259,23 @@ if build_docs
   # Fix possible inconsistency in line endings in generated output and
   # in the golden reference (which could otherwise cause test failures
   # on Windows hosts). Unfortunately diff --strip-trailing-cr
-  # is GNU-diff only. The odd-looking perl is because we must avoid
+  # is GNU-diff only. The odd-looking python is because we must avoid
   # using an explicit '\' character in the command arguments to
   # a custom_target(), as Meson will unhelpfully replace it with a '/'
   # (https://github.com/mesonbuild/meson/issues/1564)
+  remove_cr = [python, '-c', 'import sys;[sys.stdout.write(line.replace(chr(13), "")) for line in sys.stdin]']
   qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
                                     output: ['doc-good.txt.nocr'],
                                     input: qapi_doc_out[0],
                                     build_by_default: true,
-                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+                                    command: [remove_cr, '@INPUT@'],
                                     capture: true)
 
   qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
                                     output: ['doc-good.ref.nocr'],
                                     input: files('doc-good.txt'),
                                     build_by_default: true,
-                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+                                    command: [remove_cr, '@INPUT@'],
                                     capture: true)
 
   test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0], qapi_doc_out_nocr[0]],
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 5/5] Draft: Update lcitool
  2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
                   ` (3 preceding siblings ...)
  2023-01-09 18:14 ` [PATCH v2 4/5] meson: replace Perl usage with Python marcandre.lureau
@ 2023-01-09 18:14 ` marcandre.lureau
  2023-01-09 18:27   ` Daniel P. Berrangé
  4 siblings, 1 reply; 13+ messages in thread
From: marcandre.lureau @ 2023-01-09 18:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Alex Bennée, Markus Armbruster,
	Ed Maste, Philippe Mathieu-Daudé, Paolo Bonzini,
	Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Marc-André Lureau,
	Richard Henderson, qemu-s390x, Wainer dos Santos Moschetta,
	Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

- Update to fedora-37
- Drop perl

Note: see https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/344 merge
status before merging with proper submodule sha1.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 .gitlab-ci.d/cirrus/freebsd-12.vars                   | 2 +-
 .gitlab-ci.d/cirrus/freebsd-13.vars                   | 2 +-
 .gitlab-ci.d/cirrus/macos-12.vars                     | 2 +-
 scripts/ci/setup/build-environment.yml                | 1 -
 tests/docker/dockerfiles/alpine.docker                | 1 -
 tests/docker/dockerfiles/centos8.docker               | 1 -
 tests/docker/dockerfiles/debian-amd64-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-amd64.docker          | 1 -
 tests/docker/dockerfiles/debian-arm64-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-armel-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-armhf-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 -
 tests/docker/dockerfiles/debian-mipsel-cross.docker   | 1 -
 tests/docker/dockerfiles/debian-ppc64el-cross.docker  | 1 -
 tests/docker/dockerfiles/debian-s390x-cross.docker    | 1 -
 tests/docker/dockerfiles/debian-tricore-cross.docker  | 1 -
 tests/docker/dockerfiles/fedora-win32-cross.docker    | 5 ++---
 tests/docker/dockerfiles/fedora-win64-cross.docker    | 5 ++---
 tests/docker/dockerfiles/fedora.docker                | 5 ++---
 tests/docker/dockerfiles/opensuse-leap.docker         | 1 -
 tests/docker/dockerfiles/ubuntu2004.docker            | 1 -
 tests/lcitool/libvirt-ci                              | 2 +-
 tests/lcitool/projects/qemu.yml                       | 1 -
 tests/lcitool/refresh                                 | 6 +++---
 tests/vm/centos.aarch64                               | 2 +-
 25 files changed, 14 insertions(+), 33 deletions(-)

diff --git a/.gitlab-ci.d/cirrus/freebsd-12.vars b/.gitlab-ci.d/cirrus/freebsd-12.vars
index e3fc3235b9..f32f01a954 100644
--- a/.gitlab-ci.d/cirrus/freebsd-12.vars
+++ b/.gitlab-ci.d/cirrus/freebsd-12.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
 NINJA='/usr/local/bin/ninja'
 PACKAGING_COMMAND='pkg'
 PIP3='/usr/local/bin/pip-3.8'
-PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
+PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
 PYPI_PKGS=''
 PYTHON='/usr/local/bin/python3'
diff --git a/.gitlab-ci.d/cirrus/freebsd-13.vars b/.gitlab-ci.d/cirrus/freebsd-13.vars
index 9f56babd9c..813c051616 100644
--- a/.gitlab-ci.d/cirrus/freebsd-13.vars
+++ b/.gitlab-ci.d/cirrus/freebsd-13.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
 NINJA='/usr/local/bin/ninja'
 PACKAGING_COMMAND='pkg'
 PIP3='/usr/local/bin/pip-3.8'
-PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
+PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
 PYPI_PKGS=''
 PYTHON='/usr/local/bin/python3'
diff --git a/.gitlab-ci.d/cirrus/macos-12.vars b/.gitlab-ci.d/cirrus/macos-12.vars
index ef9e14b373..33bb4e1040 100644
--- a/.gitlab-ci.d/cirrus/macos-12.vars
+++ b/.gitlab-ci.d/cirrus/macos-12.vars
@@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake'
 NINJA='/opt/homebrew/bin/ninja'
 PACKAGING_COMMAND='brew'
 PIP3='/opt/homebrew/bin/pip3'
-PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
+PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
 PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme'
 PYTHON='/opt/homebrew/bin/python3'
diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/build-environment.yml
index b04c2b7cee..58438008ee 100644
--- a/scripts/ci/setup/build-environment.yml
+++ b/scripts/ci/setup/build-environment.yml
@@ -155,7 +155,6 @@
           - nettle-devel
           - ninja-build
           - nmap-ncat
-          - perl-Test-Harness
           - pixman-devel
           - python36
           - rdma-core-devel
diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
index 094f66f4eb..3293c790c9 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -77,7 +77,6 @@ RUN apk update && \
         numactl-dev \
         openssh-client \
         pcre-dev \
-        perl \
         pixman-dev \
         pkgconf \
         pulseaudio-dev \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index 1f70d41aeb..f13745e6cc 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -91,7 +91,6 @@ RUN dnf distro-sync -y && \
         openssh-clients \
         pam-devel \
         pcre-static \
-        perl \
         pixman-devel \
         pkgconfig \
         pulseaudio-libs-devel \
diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker
index 5e57309361..d0ace6d0f7 100644
--- a/tests/docker/dockerfiles/debian-amd64-cross.docker
+++ b/tests/docker/dockerfiles/debian-amd64-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index bfeab01ee3..0517c4c315 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -108,7 +108,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       nettle-dev \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker
index 98885bd0ee..9ac1c1ba3f 100644
--- a/tests/docker/dockerfiles/debian-arm64-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker
index d5c08714e4..8be492f4ad 100644
--- a/tests/docker/dockerfiles/debian-armel-cross.docker
+++ b/tests/docker/dockerfiles/debian-armel-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker
index 471444fcf4..da789e04af 100644
--- a/tests/docker/dockerfiles/debian-armhf-cross.docker
+++ b/tests/docker/dockerfiles/debian-armhf-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker
index 15b0224b76..8b7c59c4f9 100644
--- a/tests/docker/dockerfiles/debian-mips64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker
index a5d3ca6e2f..f9f1ed5fd2 100644
--- a/tests/docker/dockerfiles/debian-mipsel-cross.docker
+++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
index d2954e61f6..e423d88c2d 100644
--- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker
index d43ce16317..c1134f4cec 100644
--- a/tests/docker/dockerfiles/debian-s390x-cross.docker
+++ b/tests/docker/dockerfiles/debian-s390x-cross.docker
@@ -40,7 +40,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       ncat \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index b573b9ded2..34b2cea4e3 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -28,7 +28,6 @@ RUN apt update && \
        locales \
        make \
        ninja-build \
-       perl-base \
        pkgconf \
        python3-pip \
        python3-setuptools \
diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker
index 75383ba185..de811b332b 100644
--- a/tests/docker/dockerfiles/fedora-win32-cross.docker
+++ b/tests/docker/dockerfiles/fedora-win32-cross.docker
@@ -1,10 +1,10 @@
 # THIS FILE WAS AUTO-GENERATED
 #
-#  $ lcitool dockerfile --layers all --cross mingw32 fedora-35 qemu
+#  $ lcitool dockerfile --layers all --cross mingw32 fedora-37 qemu
 #
 # https://gitlab.com/libvirt/libvirt-ci
 
-FROM registry.fedoraproject.org/fedora:35
+FROM registry.fedoraproject.org/fedora:37
 
 RUN dnf install -y nosync && \
     echo -e '#!/bin/sh\n\
@@ -42,7 +42,6 @@ exec "$@"' > /usr/bin/nosync && \
                nmap-ncat \
                openssh-clients \
                pcre-static \
-               perl-base \
                python3 \
                python3-PyYAML \
                python3-numpy \
diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker
index 98c03dc13b..71681d6f92 100644
--- a/tests/docker/dockerfiles/fedora-win64-cross.docker
+++ b/tests/docker/dockerfiles/fedora-win64-cross.docker
@@ -1,10 +1,10 @@
 # THIS FILE WAS AUTO-GENERATED
 #
-#  $ lcitool dockerfile --layers all --cross mingw64 fedora-35 qemu
+#  $ lcitool dockerfile --layers all --cross mingw64 fedora-37 qemu
 #
 # https://gitlab.com/libvirt/libvirt-ci
 
-FROM registry.fedoraproject.org/fedora:35
+FROM registry.fedoraproject.org/fedora:37
 
 RUN dnf install -y nosync && \
     echo -e '#!/bin/sh\n\
@@ -42,7 +42,6 @@ exec "$@"' > /usr/bin/nosync && \
                nmap-ncat \
                openssh-clients \
                pcre-static \
-               perl-base \
                python3 \
                python3-PyYAML \
                python3-numpy \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index d200c7fc10..ca3793b04b 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -1,10 +1,10 @@
 # THIS FILE WAS AUTO-GENERATED
 #
-#  $ lcitool dockerfile --layers all fedora-35 qemu
+#  $ lcitool dockerfile --layers all fedora-37 qemu
 #
 # https://gitlab.com/libvirt/libvirt-ci
 
-FROM registry.fedoraproject.org/fedora:35
+FROM registry.fedoraproject.org/fedora:37
 
 RUN dnf install -y nosync && \
     echo -e '#!/bin/sh\n\
@@ -98,7 +98,6 @@ exec "$@"' > /usr/bin/nosync && \
                openssh-clients \
                pam-devel \
                pcre-static \
-               perl-base \
                pixman-devel \
                pkgconfig \
                pulseaudio-libs-devel \
diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker
index 4361b01464..680f49e7dc 100644
--- a/tests/docker/dockerfiles/opensuse-leap.docker
+++ b/tests/docker/dockerfiles/opensuse-leap.docker
@@ -88,7 +88,6 @@ RUN zypper update -y && \
            openssh \
            pam-devel \
            pcre-devel-static \
-           perl-base \
            pkgconfig \
            python3-Pillow \
            python3-PyYAML \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 9417bca2fa..6594bba338 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -105,7 +105,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
                       nettle-dev \
                       ninja-build \
                       openssh-client \
-                      perl-base \
                       pkgconf \
                       python3 \
                       python3-numpy \
diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci
index e3eb28cf2e..53f124b75d 160000
--- a/tests/lcitool/libvirt-ci
+++ b/tests/lcitool/libvirt-ci
@@ -1 +1 @@
-Subproject commit e3eb28cf2e17fbcf7fe7e19505ee432b8ec5bbb5
+Subproject commit 53f124b75dc1314e310aa2ed775a9f7761a34ec8
diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
index c62dbc00f9..c2af92348a 100644
--- a/tests/lcitool/projects/qemu.yml
+++ b/tests/lcitool/projects/qemu.yml
@@ -83,7 +83,6 @@ packages:
  - ncursesw
  - pam
  - pcre-static
- - perl
  - pixman
  - pkg-config
  - pulseaudio
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index fa966e4009..a5ea0efc3b 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -111,7 +111,7 @@ try:
     generate_dockerfile("centos8", "centos-stream-8")
     generate_dockerfile("debian-amd64", "debian-11",
                         trailer="".join(debian11_extras))
-    generate_dockerfile("fedora", "fedora-35")
+    generate_dockerfile("fedora", "fedora-37")
     generate_dockerfile("opensuse-leap", "opensuse-leap-153")
     generate_dockerfile("ubuntu2004", "ubuntu-2004",
                         trailer="".join(ubuntu2004_tsanhack))
@@ -161,12 +161,12 @@ try:
                         trailer=cross_build("s390x-linux-gnu-",
                                             "s390x-softmmu,s390x-linux-user"))
 
-    generate_dockerfile("fedora-win32-cross", "fedora-35",
+    generate_dockerfile("fedora-win32-cross", "fedora-37",
                         cross="mingw32",
                         trailer=cross_build("i686-w64-mingw32-",
                                             "i386-softmmu"))
 
-    generate_dockerfile("fedora-win64-cross", "fedora-35",
+    generate_dockerfile("fedora-win64-cross", "fedora-37",
                         cross="mingw64",
                         trailer=cross_build("x86_64-w64-mingw32-",
                                             "x86_64-softmmu"))
diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64
index 2de7ef6992..3f58de1e64 100755
--- a/tests/vm/centos.aarch64
+++ b/tests/vm/centos.aarch64
@@ -28,7 +28,7 @@ DEFAULT_CONFIG = {
         "dnf config-manager --set-enabled powertools, "
         "dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo, "
         "dnf install -y make ninja-build git python38 gcc gcc-c++ flex bison "\
-            "glib2-devel perl pixman-devel zlib-devel docker-ce.aarch64, "
+            "glib2-devel pixman-devel zlib-devel docker-ce.aarch64, "
         "systemctl enable docker, "
     ),
     # We increase beyond the default time since during boot
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/5] Draft: Update lcitool
  2023-01-09 18:14 ` [PATCH v2 5/5] Draft: Update lcitool marcandre.lureau
@ 2023-01-09 18:27   ` Daniel P. Berrangé
  2023-01-09 18:30     ` Marc-André Lureau
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel P. Berrangé @ 2023-01-09 18:27 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Ed Maste,
	Philippe Mathieu-Daudé, Paolo Bonzini, Cornelia Huck,
	Eric Farman, John Snow, Halil Pasic, Christian Borntraeger,
	Thomas Huth, Cleber Rosa, Beraldo Leal, Li-Wen Hsu,
	David Hildenbrand, kraxel, Richard Henderson, qemu-s390x,
	Wainer dos Santos Moschetta, Michael Roth

On Mon, Jan 09, 2023 at 10:14:47PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> - Update to fedora-37
> - Drop perl
> 
> Note: see https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/344 merge
> status before merging with proper submodule sha1.

There is no need to wait for that change. We don't use the qemu.yml
file in lcitool.git, and it should be ignored. The one you changed
in qemu.git is the canonical one 


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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/5] Draft: Update lcitool
  2023-01-09 18:27   ` Daniel P. Berrangé
@ 2023-01-09 18:30     ` Marc-André Lureau
  2023-01-09 18:42       ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Marc-André Lureau @ 2023-01-09 18:30 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Ed Maste,
	Philippe Mathieu-Daudé, Paolo Bonzini, Cornelia Huck,
	Eric Farman, John Snow, Halil Pasic, Christian Borntraeger,
	Thomas Huth, Cleber Rosa, Beraldo Leal, Li-Wen Hsu,
	David Hildenbrand, kraxel, Richard Henderson, qemu-s390x,
	Wainer dos Santos Moschetta, Michael Roth

Hi

On Mon, Jan 9, 2023 at 10:28 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Mon, Jan 09, 2023 at 10:14:47PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > - Update to fedora-37
> > - Drop perl
> >
> > Note: see https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/344 merge
> > status before merging with proper submodule sha1.
>
> There is no need to wait for that change. We don't use the qemu.yml
> file in lcitool.git, and it should be ignored. The one you changed
> in qemu.git is the canonical one
>

Ok, in that case we don't need to bump to fedora-37 either.

I'll drop the lcitool update, as I don't have a reason to do it now.



-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 5/5] Draft: Update lcitool
  2023-01-09 18:30     ` Marc-André Lureau
@ 2023-01-09 18:42       ` Daniel P. Berrangé
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2023-01-09 18:42 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Ed Maste,
	Philippe Mathieu-Daudé, Paolo Bonzini, Cornelia Huck,
	Eric Farman, John Snow, Halil Pasic, Christian Borntraeger,
	Thomas Huth, Cleber Rosa, Beraldo Leal, Li-Wen Hsu,
	David Hildenbrand, kraxel, Richard Henderson, qemu-s390x,
	Wainer dos Santos Moschetta, Michael Roth

On Mon, Jan 09, 2023 at 10:30:56PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Mon, Jan 9, 2023 at 10:28 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Mon, Jan 09, 2023 at 10:14:47PM +0400, marcandre.lureau@redhat.com wrote:
> > > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >
> > > - Update to fedora-37
> > > - Drop perl
> > >
> > > Note: see https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/344 merge
> > > status before merging with proper submodule sha1.
> >
> > There is no need to wait for that change. We don't use the qemu.yml
> > file in lcitool.git, and it should be ignored. The one you changed
> > in qemu.git is the canonical one
> >
> 
> Ok, in that case we don't need to bump to fedora-37 either.

Fedora 35 is end of life, so isn't a platform targetted
by QEMU any more. IOW we should bump to newer Fedora
regardless, but it is independant of dropping perl.


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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 3/5] configure: replace Perl usage with sed
  2023-01-09 18:14 ` [PATCH v2 3/5] configure: replace Perl usage with sed marcandre.lureau
@ 2023-01-09 18:42   ` Peter Maydell
  0 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2023-01-09 18:42 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Daniel P. Berrangé, Alex Bennée,
	Markus Armbruster, Ed Maste, Philippe Mathieu-Daudé,
	Paolo Bonzini, Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Richard Henderson,
	qemu-s390x, Wainer dos Santos Moschetta, Michael Roth

On Mon, 9 Jan 2023 at 18:16, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Let's try to reduce our Perl usage during config/build-time.
>
> Note: this patch might be dropped if "configure: remove
> backwards-compatibility code" is merged earlier.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  configure | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index 2281892657..e45acde404 100755
> --- a/configure
> +++ b/configure
> @@ -2571,11 +2571,9 @@ else
>    if test -f meson-private/cmd_line.txt; then
>      # Adjust old command line options whose type was changed
>      # Avoids having to use "setup --wipe" when Meson is upgraded
> -    perl -i -ne '
> -      s/^gettext = true$/gettext = auto/;
> -      s/^gettext = false$/gettext = disabled/;
> -      /^b_staticpic/ && next;
> -      print;' meson-private/cmd_line.txt
> +    sed -i.bak 's/^gettext = true/gettext = auto/g' -e \
> +      's/^gettext = false/gettext = disabled/g' -e \
> +      '/^b_staticpic/d' meson-private/cmd_line.txt

This doesn't work on macos sed, because POSIX sed allows

 sed command file
or
 sed -e command -e command file
but not
 sed command -e command file

The fix is easy, prefix the first command with '-e'.

-i is not POSIX sed, but luckily the BSD sed implements it.

The two gettext matches have lost the trailing '$' in the regex.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 4/5] meson: replace Perl usage with Python
  2023-01-09 18:14 ` [PATCH v2 4/5] meson: replace Perl usage with Python marcandre.lureau
@ 2023-01-09 18:51   ` Peter Maydell
  2023-01-09 18:55     ` Marc-André Lureau
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Maydell @ 2023-01-09 18:51 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Daniel P. Berrangé, Alex Bennée,
	Markus Armbruster, Ed Maste, Philippe Mathieu-Daudé,
	Paolo Bonzini, Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Richard Henderson,
	qemu-s390x, Wainer dos Santos Moschetta, Michael Roth

On Mon, 9 Jan 2023 at 18:16, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Let's try to remove Perl usage during build time.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  tests/qapi-schema/meson.build | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
> index 9dfe98bc9a..d85b14f28c 100644
> --- a/tests/qapi-schema/meson.build
> +++ b/tests/qapi-schema/meson.build
> @@ -259,22 +259,23 @@ if build_docs
>    # Fix possible inconsistency in line endings in generated output and
>    # in the golden reference (which could otherwise cause test failures
>    # on Windows hosts). Unfortunately diff --strip-trailing-cr
> -  # is GNU-diff only. The odd-looking perl is because we must avoid
> +  # is GNU-diff only. The odd-looking python is because we must avoid
>    # using an explicit '\' character in the command arguments to
>    # a custom_target(), as Meson will unhelpfully replace it with a '/'
>    # (https://github.com/mesonbuild/meson/issues/1564)

This comment is not applicable to your Python rewrite of this.
It's talking about the way that the Perl code has to create
a variable with a '\r' value in a weird way (using "$x = chr 13")
and then do a substitution using that variable, rather than the obvious
direct s// command ("s/\r//"), to work around a meson bug if the code
has a literal \ character in it. Your python has no '\'s in it.

> +  remove_cr = [python, '-c', 'import sys;[sys.stdout.write(line.replace(chr(13), "")) for line in sys.stdin]']
>    qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
>                                      output: ['doc-good.txt.nocr'],
>                                      input: qapi_doc_out[0],
>                                      build_by_default: true,
> -                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
> +                                    command: [remove_cr, '@INPUT@'],
>                                      capture: true)
>
>    qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
>                                      output: ['doc-good.ref.nocr'],
>                                      input: files('doc-good.txt'),
>                                      build_by_default: true,
> -                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
> +                                    command: [remove_cr, '@INPUT@'],
>                                      capture: true)
>
>    test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0], qapi_doc_out_nocr[0]],
> --
> 2.39.0

Maybe we should consider putting the Python into a script in
scripts/ ? "Remove \r characters" is pretty trivial, but on the
other hand I think this is the only Meson custom_target() we
have where we directly invoke a script interpreter with a
bit of inline script, and inline bits of script doesn't really
seem to be a style Meson encourages (unlike Make).

thanks
-- PMM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 4/5] meson: replace Perl usage with Python
  2023-01-09 18:51   ` Peter Maydell
@ 2023-01-09 18:55     ` Marc-André Lureau
  0 siblings, 0 replies; 13+ messages in thread
From: Marc-André Lureau @ 2023-01-09 18:55 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, Daniel P. Berrangé, Alex Bennée,
	Markus Armbruster, Ed Maste, Philippe Mathieu-Daudé,
	Paolo Bonzini, Cornelia Huck, Eric Farman, John Snow, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Richard Henderson,
	qemu-s390x, Wainer dos Santos Moschetta, Michael Roth

Hi

On Mon, Jan 9, 2023 at 10:52 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Mon, 9 Jan 2023 at 18:16, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Let's try to remove Perl usage during build time.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  tests/qapi-schema/meson.build | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
> > index 9dfe98bc9a..d85b14f28c 100644
> > --- a/tests/qapi-schema/meson.build
> > +++ b/tests/qapi-schema/meson.build
> > @@ -259,22 +259,23 @@ if build_docs
> >    # Fix possible inconsistency in line endings in generated output and
> >    # in the golden reference (which could otherwise cause test failures
> >    # on Windows hosts). Unfortunately diff --strip-trailing-cr
> > -  # is GNU-diff only. The odd-looking perl is because we must avoid
> > +  # is GNU-diff only. The odd-looking python is because we must avoid
> >    # using an explicit '\' character in the command arguments to
> >    # a custom_target(), as Meson will unhelpfully replace it with a '/'
> >    # (https://github.com/mesonbuild/meson/issues/1564)
>
> This comment is not applicable to your Python rewrite of this.

To my interpretation, the comment still applies. I would have written
a much simpler sed invocation if we were allowed to use backslashes.

> It's talking about the way that the Perl code has to create
> a variable with a '\r' value in a weird way (using "$x = chr 13")
> and then do a substitution using that variable, rather than the obvious
> direct s// command ("s/\r//"), to work around a meson bug if the code
> has a literal \ character in it. Your python has no '\'s in it.
>
> > +  remove_cr = [python, '-c', 'import sys;[sys.stdout.write(line.replace(chr(13), "")) for line in sys.stdin]']
> >    qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
> >                                      output: ['doc-good.txt.nocr'],
> >                                      input: qapi_doc_out[0],
> >                                      build_by_default: true,
> > -                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
> > +                                    command: [remove_cr, '@INPUT@'],
> >                                      capture: true)
> >
> >    qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
> >                                      output: ['doc-good.ref.nocr'],
> >                                      input: files('doc-good.txt'),
> >                                      build_by_default: true,
> > -                                    command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
> > +                                    command: [remove_cr, '@INPUT@'],
> >                                      capture: true)
> >
> >    test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0], qapi_doc_out_nocr[0]],
> > --
> > 2.39.0
>
> Maybe we should consider putting the Python into a script in
> scripts/ ? "Remove \r characters" is pretty trivial, but on the
> other hand I think this is the only Meson custom_target() we
> have where we directly invoke a script interpreter with a
> bit of inline script, and inline bits of script doesn't really
> seem to be a style Meson encourages (unlike Make).

It's a quite simple one-liner, and I hope we can drop it when meson
fix the mentionned bug. But I am fine putting it in a script, if that
can help.

-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/5] build-sys: fix crlf-ending C code
  2023-01-09 18:14 ` [PATCH v2 1/5] build-sys: fix crlf-ending C code marcandre.lureau
@ 2023-01-09 19:02   ` John Snow
  0 siblings, 0 replies; 13+ messages in thread
From: John Snow @ 2023-01-09 19:02 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Daniel P. Berrangé, Alex Bennée,
	Markus Armbruster, Ed Maste, Philippe Mathieu-Daudé,
	Paolo Bonzini, Cornelia Huck, Eric Farman, Halil Pasic,
	Christian Borntraeger, Thomas Huth, Cleber Rosa, Beraldo Leal,
	Li-Wen Hsu, David Hildenbrand, kraxel, Richard Henderson,
	qemu-s390x, Wainer dos Santos Moschetta, Michael Roth

On Mon, Jan 9, 2023 at 1:14 PM <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> On msys2, the shader-to-C script produces bad C:
> ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character [-Werror]
>
> Fix it by changing the line ending from crlf to lf, and convert the
> script to Python (qemu build seems perl-free after that).
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Acked-by: Thomas Huth <thuth@redhat.com>
> ---
>  meson.build              |  2 +-
>  scripts/shaderinclude.pl | 16 ----------------
>  scripts/shaderinclude.py | 26 ++++++++++++++++++++++++++
>  3 files changed, 27 insertions(+), 17 deletions(-)
>  delete mode 100644 scripts/shaderinclude.pl
>  create mode 100755 scripts/shaderinclude.py
>
> diff --git a/meson.build b/meson.build
> index 175517eafd..b3c6db8343 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2781,7 +2781,7 @@ config_host_data.set('CONFIG_SLIRP', slirp.found())
>  genh += configure_file(output: 'config-host.h', configuration: config_host_data)
>
>  hxtool = find_program('scripts/hxtool')
> -shaderinclude = find_program('scripts/shaderinclude.pl')
> +shaderinclude = find_program('scripts/shaderinclude.py')
>  qapi_gen = find_program('scripts/qapi-gen.py')
>  qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py',
>                       meson.current_source_dir() / 'scripts/qapi/commands.py',
> diff --git a/scripts/shaderinclude.pl b/scripts/shaderinclude.pl
> deleted file mode 100644
> index cd3bb40b12..0000000000
> --- a/scripts/shaderinclude.pl
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/usr/bin/env perl
> -use strict;
> -use warnings;
> -
> -my $file = shift;
> -open FILE, "<", $file or die "open $file: $!";
> -my $name = $file;
> -$name =~ s|.*/||;
> -$name =~ s/[-.]/_/g;
> -print "static GLchar ${name}_src[] =\n";
> -while (<FILE>) {
> -    chomp;
> -    printf "    \"%s\\n\"\n", $_;
> -}
> -print "    \"\\n\";\n";
> -close FILE;
> diff --git a/scripts/shaderinclude.py b/scripts/shaderinclude.py
> new file mode 100755
> index 0000000000..ab2aade2cd
> --- /dev/null
> +++ b/scripts/shaderinclude.py
> @@ -0,0 +1,26 @@
> +#!/usr/bin/env python3
> +#
> +# Copyright (C) 2023 Red Hat, Inc.
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +import sys
> +import os
> +
> +
> +def main(args):
> +    file_path = args[1]
> +    basename = os.path.basename(file_path)
> +    varname = basename.replace('-', '_').replace('.', '_')
> +
> +    with os.fdopen(sys.stdout.fileno(), "wt", closefd=False, newline='\n') as stdout:

fancy ~

> +        with open(file_path, "r", encoding='utf-8') as file:
> +            print(f'static GLchar {varname}_src[] =', file=stdout)
> +            for line in file:
> +                line = line.rstrip()
> +                print(f'    "{line}\\n"', file=stdout)
> +            print('    "\\n";', file=stdout)
> +
> +
> +if __name__ == '__main__':
> +    sys.exit(main(sys.argv))
> --
> 2.39.0
>

ACK on the Python.

--js



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-01-09 19:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09 18:14 [PATCH v2 0/5] Fix win32/msys2 shader compilation & drop perl marcandre.lureau
2023-01-09 18:14 ` [PATCH v2 1/5] build-sys: fix crlf-ending C code marcandre.lureau
2023-01-09 19:02   ` John Snow
2023-01-09 18:14 ` [PATCH v2 2/5] .gitlab-ci.d/windows: do not disable opengl marcandre.lureau
2023-01-09 18:14 ` [PATCH v2 3/5] configure: replace Perl usage with sed marcandre.lureau
2023-01-09 18:42   ` Peter Maydell
2023-01-09 18:14 ` [PATCH v2 4/5] meson: replace Perl usage with Python marcandre.lureau
2023-01-09 18:51   ` Peter Maydell
2023-01-09 18:55     ` Marc-André Lureau
2023-01-09 18:14 ` [PATCH v2 5/5] Draft: Update lcitool marcandre.lureau
2023-01-09 18:27   ` Daniel P. Berrangé
2023-01-09 18:30     ` Marc-André Lureau
2023-01-09 18:42       ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).