[PATCH pushed] meson: drop explicit python interpreter

Peter Krempa posted 1 patch 3 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/642af05e3e58b90cb9d15936678f16bd7e454d26.1705916955.git.pkrempa@redhat.com
src/admin/meson.build   | 4 ++--
src/locking/meson.build | 4 ++--
src/logging/meson.build | 4 ++--
src/lxc/meson.build     | 4 ++--
src/remote/meson.build  | 4 ++--
src/rpc/meson.build     | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
[PATCH pushed] meson: drop explicit python interpreter
Posted by Peter Krempa 3 months, 1 week ago
From: Biswapriyo Nath <nathbappai@gmail.com>

meson wraps python scripts already on win32, so we end up with these
failing commands:

[185/868] Generating src/rpc/virnetprotocol.h with a custom command
FAILED: src/rpc/virnetprotocol.h
"sh" "libvirt/scripts/meson-python.sh" "F:/msys64/ucrt64/bin/python3.EXE" "F:/msys64/ucrt64/bin/python.exe" "libvirt/scripts/rpcgen/main.py" "--mode=header" "../src/rpc/virnetprotocol.x" "src/rpc/virnetprotocol.h"
SyntaxError: Non-UTF-8 code starting with '\x90' in file F:/msys64/ucrt64/bin/python.exe on line 1, but no encoding declared; see https://peps.python.org/pep-0263/ for details

The issue was introduced in a62486b95feed2cf17ce4adbe794a1ecff9ef22a commit.
These changes are similar as e06beacec2f8e57bbc5cd8f6eb9d44a1f291966d commit.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
---

Merged via MR: https://gitlab.com/libvirt/libvirt/-/merge_requests/317

 src/admin/meson.build   | 4 ++--
 src/locking/meson.build | 4 ++--
 src/logging/meson.build | 4 ++--
 src/lxc/meson.build     | 4 ++--
 src/remote/meson.build  | 4 ++--
 src/rpc/meson.build     | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/admin/meson.build b/src/admin/meson.build
index ca2a475a6f..307c1c7a3a 100644
--- a/src/admin/meson.build
+++ b/src/admin/meson.build
@@ -15,7 +15,7 @@ admin_protocol_h = custom_target(
   output: 'admin_protocol.h',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=header', '@INPUT@', '@OUTPUT@',
   ],
 )
@@ -27,7 +27,7 @@ admin_driver_generated += custom_target(
   output: 'admin_protocol.c',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=source', '--header=admin_protocol.h', '@INPUT@', '@OUTPUT@',
   ],
 )
diff --git a/src/locking/meson.build b/src/locking/meson.build
index c661389178..c3dfcf2961 100644
--- a/src/locking/meson.build
+++ b/src/locking/meson.build
@@ -20,7 +20,7 @@ lock_protocol_generated += custom_target(
   output: 'lock_protocol.h',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=header', '@INPUT@', '@OUTPUT@',
   ],
 )
@@ -31,7 +31,7 @@ lock_protocol_generated += custom_target(
   output: 'lock_protocol.c',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=source', '--header=lock_protocol.h', '@INPUT@', '@OUTPUT@',
   ],
 )
diff --git a/src/logging/meson.build b/src/logging/meson.build
index 0e0cc7ab76..67eeacce43 100644
--- a/src/logging/meson.build
+++ b/src/logging/meson.build
@@ -12,7 +12,7 @@ log_protocol_header_generated = custom_target(
   output: 'log_protocol.h',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=header', '@INPUT@', '@OUTPUT@',
   ],
 )
@@ -24,7 +24,7 @@ log_protocol_generated += custom_target(
   output: 'log_protocol.c',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=source', '--header=log_protocol.h', '@INPUT@', '@OUTPUT@',
   ],
 )
diff --git a/src/lxc/meson.build b/src/lxc/meson.build
index edb88a71cb..bf9afabc0f 100644
--- a/src/lxc/meson.build
+++ b/src/lxc/meson.build
@@ -23,7 +23,7 @@ lxc_monitor_protocol_generated += custom_target(
   output: 'lxc_monitor_protocol.h',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=header', '@INPUT@', '@OUTPUT@',
   ]
 )
@@ -34,7 +34,7 @@ lxc_monitor_protocol_generated += custom_target(
   output: 'lxc_monitor_protocol.c',
   depend_files: rpcgen_src,
   command: [
-    meson_python_prog, python3_prog, rpcgen_prog,
+    rpcgen_prog,
     '--mode=source', '--header=lxc_monitor_protocol.h', '@INPUT@', '@OUTPUT@',
   ],
 )
diff --git a/src/remote/meson.build b/src/remote/meson.build
index 16b903fcaf..681c709823 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -27,7 +27,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
     output: protocol_h,
     depend_files: rpcgen_src,
     command: [
-      meson_python_prog, python3_prog, rpcgen_prog,
+      rpcgen_prog,
       '--mode=header', '@INPUT@', '@OUTPUT@',
     ],
   )
@@ -38,7 +38,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
     output: protocol_c,
     depend_files: rpcgen_src,
     command: [
-      meson_python_prog, python3_prog, rpcgen_prog,
+      rpcgen_prog,
       '--mode=source', '--header=' + protocol_h, '@INPUT@', '@OUTPUT@',
     ],
   )
diff --git a/src/rpc/meson.build b/src/rpc/meson.build
index d58f3caaf5..9d98bc6259 100644
--- a/src/rpc/meson.build
+++ b/src/rpc/meson.build
@@ -54,7 +54,7 @@ foreach name : [ 'virnet', 'virkeepalive' ]
     output: header_file,
     depend_files: rpcgen_src,
     command: [
-      meson_python_prog, python3_prog, rpcgen_prog,
+      rpcgen_prog,
       '--mode=header', '@INPUT@', '@OUTPUT@',
     ],
   )
@@ -65,7 +65,7 @@ foreach name : [ 'virnet', 'virkeepalive' ]
     output: source_file,
     depend_files: rpcgen_src,
     command: [
-      meson_python_prog, python3_prog, rpcgen_prog,
+      rpcgen_prog,
       '--mode=source', '--header=' + header_file, '@INPUT@', '@OUTPUT@',
     ],
   )
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH pushed] meson: drop explicit python interpreter
Posted by Daniel P. Berrangé 3 months, 1 week ago
On Mon, Jan 22, 2024 at 10:50:34AM +0100, Peter Krempa wrote:
> From: Biswapriyo Nath <nathbappai@gmail.com>
> 
> meson wraps python scripts already on win32, so we end up with these
> failing commands:
> 
> [185/868] Generating src/rpc/virnetprotocol.h with a custom command
> FAILED: src/rpc/virnetprotocol.h
> "sh" "libvirt/scripts/meson-python.sh" "F:/msys64/ucrt64/bin/python3.EXE" "F:/msys64/ucrt64/bin/python.exe" "libvirt/scripts/rpcgen/main.py" "--mode=header" "../src/rpc/virnetprotocol.x" "src/rpc/virnetprotocol.h"
> SyntaxError: Non-UTF-8 code starting with '\x90' in file F:/msys64/ucrt64/bin/python.exe on line 1, but no encoding declared; see https://peps.python.org/pep-0263/ for details
> 
> The issue was introduced in a62486b95feed2cf17ce4adbe794a1ecff9ef22a commit.
> These changes are similar as e06beacec2f8e57bbc5cd8f6eb9d44a1f291966d commit.
> 
> Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
> ---
> 
> Merged via MR: https://gitlab.com/libvirt/libvirt/-/merge_requests/317
> 
>  src/admin/meson.build   | 4 ++--
>  src/locking/meson.build | 4 ++--
>  src/logging/meson.build | 4 ++--
>  src/lxc/meson.build     | 4 ++--
>  src/remote/meson.build  | 4 ++--
>  src/rpc/meson.build     | 4 ++--
>  6 files changed, 12 insertions(+), 12 deletions(-)

I guess this is the set which impacts wnidows builds, but we still have
alot more of the problematic code pattern

$ git grep meson_python_prog
docs/meson.build:    meson_python_prog, python3_prog.full_path(), meson_install_web_prog.full_path(),
meson.build:      meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(),
src/access/meson.build:      command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ],
src/meson.build:      meson_python_prog, python3_prog, dtrace2systemtap_prog,
src/meson.build:      meson_python_prog, python3_prog, augeas_gentest_prog,
src/meson.build:      meson_python_prog, python3_prog, augeas_gentest_prog,
src/meson.build:      meson_python_prog, python3_prog, gensystemtap_prog,
src/meson.build:  meson_python_prog.full_path(), python3_prog.full_path(), meson_install_dirs_prog.full_path(),
src/network/meson.build:    meson_python_prog.full_path(), python3_prog.full_path(), meson_install_sy


for completeness we should cull the rest, otherwise we're bound to
copy+paste the bad pattern back into something that hits on windows.


> 
> diff --git a/src/admin/meson.build b/src/admin/meson.build
> index ca2a475a6f..307c1c7a3a 100644
> --- a/src/admin/meson.build
> +++ b/src/admin/meson.build
> @@ -15,7 +15,7 @@ admin_protocol_h = custom_target(
>    output: 'admin_protocol.h',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=header', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> @@ -27,7 +27,7 @@ admin_driver_generated += custom_target(
>    output: 'admin_protocol.c',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=source', '--header=admin_protocol.h', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> diff --git a/src/locking/meson.build b/src/locking/meson.build
> index c661389178..c3dfcf2961 100644
> --- a/src/locking/meson.build
> +++ b/src/locking/meson.build
> @@ -20,7 +20,7 @@ lock_protocol_generated += custom_target(
>    output: 'lock_protocol.h',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=header', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> @@ -31,7 +31,7 @@ lock_protocol_generated += custom_target(
>    output: 'lock_protocol.c',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=source', '--header=lock_protocol.h', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> diff --git a/src/logging/meson.build b/src/logging/meson.build
> index 0e0cc7ab76..67eeacce43 100644
> --- a/src/logging/meson.build
> +++ b/src/logging/meson.build
> @@ -12,7 +12,7 @@ log_protocol_header_generated = custom_target(
>    output: 'log_protocol.h',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=header', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> @@ -24,7 +24,7 @@ log_protocol_generated += custom_target(
>    output: 'log_protocol.c',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=source', '--header=log_protocol.h', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> diff --git a/src/lxc/meson.build b/src/lxc/meson.build
> index edb88a71cb..bf9afabc0f 100644
> --- a/src/lxc/meson.build
> +++ b/src/lxc/meson.build
> @@ -23,7 +23,7 @@ lxc_monitor_protocol_generated += custom_target(
>    output: 'lxc_monitor_protocol.h',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=header', '@INPUT@', '@OUTPUT@',
>    ]
>  )
> @@ -34,7 +34,7 @@ lxc_monitor_protocol_generated += custom_target(
>    output: 'lxc_monitor_protocol.c',
>    depend_files: rpcgen_src,
>    command: [
> -    meson_python_prog, python3_prog, rpcgen_prog,
> +    rpcgen_prog,
>      '--mode=source', '--header=lxc_monitor_protocol.h', '@INPUT@', '@OUTPUT@',
>    ],
>  )
> diff --git a/src/remote/meson.build b/src/remote/meson.build
> index 16b903fcaf..681c709823 100644
> --- a/src/remote/meson.build
> +++ b/src/remote/meson.build
> @@ -27,7 +27,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
>      output: protocol_h,
>      depend_files: rpcgen_src,
>      command: [
> -      meson_python_prog, python3_prog, rpcgen_prog,
> +      rpcgen_prog,
>        '--mode=header', '@INPUT@', '@OUTPUT@',
>      ],
>    )
> @@ -38,7 +38,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
>      output: protocol_c,
>      depend_files: rpcgen_src,
>      command: [
> -      meson_python_prog, python3_prog, rpcgen_prog,
> +      rpcgen_prog,
>        '--mode=source', '--header=' + protocol_h, '@INPUT@', '@OUTPUT@',
>      ],
>    )
> diff --git a/src/rpc/meson.build b/src/rpc/meson.build
> index d58f3caaf5..9d98bc6259 100644
> --- a/src/rpc/meson.build
> +++ b/src/rpc/meson.build
> @@ -54,7 +54,7 @@ foreach name : [ 'virnet', 'virkeepalive' ]
>      output: header_file,
>      depend_files: rpcgen_src,
>      command: [
> -      meson_python_prog, python3_prog, rpcgen_prog,
> +      rpcgen_prog,
>        '--mode=header', '@INPUT@', '@OUTPUT@',
>      ],
>    )
> @@ -65,7 +65,7 @@ foreach name : [ 'virnet', 'virkeepalive' ]
>      output: source_file,
>      depend_files: rpcgen_src,
>      command: [
> -      meson_python_prog, python3_prog, rpcgen_prog,
> +      rpcgen_prog,
>        '--mode=source', '--header=' + header_file, '@INPUT@', '@OUTPUT@',
>      ],
>    )
> -- 
> 2.43.0
> _______________________________________________
> Devel mailing list -- devel@lists.libvirt.org
> To unsubscribe send an email to devel-leave@lists.libvirt.org

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 :|
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH pushed] meson: drop explicit python interpreter
Posted by Peter Krempa 3 months, 1 week ago
On Mon, Jan 22, 2024 at 10:04:27 +0000, Daniel P. Berrangé wrote:
> On Mon, Jan 22, 2024 at 10:50:34AM +0100, Peter Krempa wrote:
> > From: Biswapriyo Nath <nathbappai@gmail.com>
> > 
> > meson wraps python scripts already on win32, so we end up with these
> > failing commands:
> > 
> > [185/868] Generating src/rpc/virnetprotocol.h with a custom command
> > FAILED: src/rpc/virnetprotocol.h
> > "sh" "libvirt/scripts/meson-python.sh" "F:/msys64/ucrt64/bin/python3.EXE" "F:/msys64/ucrt64/bin/python.exe" "libvirt/scripts/rpcgen/main.py" "--mode=header" "../src/rpc/virnetprotocol.x" "src/rpc/virnetprotocol.h"
> > SyntaxError: Non-UTF-8 code starting with '\x90' in file F:/msys64/ucrt64/bin/python.exe on line 1, but no encoding declared; see https://peps.python.org/pep-0263/ for details
> > 
> > The issue was introduced in a62486b95feed2cf17ce4adbe794a1ecff9ef22a commit.
> > These changes are similar as e06beacec2f8e57bbc5cd8f6eb9d44a1f291966d commit.
> > 
> > Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
> > ---
> > 
> > Merged via MR: https://gitlab.com/libvirt/libvirt/-/merge_requests/317
> > 
> >  src/admin/meson.build   | 4 ++--
> >  src/locking/meson.build | 4 ++--
> >  src/logging/meson.build | 4 ++--
> >  src/lxc/meson.build     | 4 ++--
> >  src/remote/meson.build  | 4 ++--
> >  src/rpc/meson.build     | 4 ++--
> >  6 files changed, 12 insertions(+), 12 deletions(-)
> 
> I guess this is the set which impacts wnidows builds, but we still have
> alot more of the problematic code pattern
> 
> $ git grep meson_python_prog
> docs/meson.build:    meson_python_prog, python3_prog.full_path(), meson_install_web_prog.full_path(),
> meson.build:      meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(),
> src/access/meson.build:      command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ],
> src/meson.build:      meson_python_prog, python3_prog, dtrace2systemtap_prog,
> src/meson.build:      meson_python_prog, python3_prog, augeas_gentest_prog,
> src/meson.build:      meson_python_prog, python3_prog, augeas_gentest_prog,
> src/meson.build:      meson_python_prog, python3_prog, gensystemtap_prog,
> src/meson.build:  meson_python_prog.full_path(), python3_prog.full_path(), meson_install_dirs_prog.full_path(),
> src/network/meson.build:    meson_python_prog.full_path(), python3_prog.full_path(), meson_install_sy
> 
> 
> for completeness we should cull the rest, otherwise we're bound to
> copy+paste the bad pattern back into something that hits on windows.

Yeah, I've noted on my todo list to ensure that meson_python_prog and
python3_prog objects to be removed so that it doesn't happen again.

I didn't start yet, so go ahead
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org