[PATCH 4/4] hexagon: use env keyword argument to pass PYTHONPATH

Paolo Bonzini posted 4 patches 4 years, 8 months ago
Maintainers: Taylor Simpson <tsimpson@quicinc.com>
[PATCH 4/4] hexagon: use env keyword argument to pass PYTHONPATH
Posted by Paolo Bonzini 4 years, 8 months ago
This feature is new in meson 0.57 and allows getting rid of the "env" wrapper.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/hexagon/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build
index bb0b4fb621..aaeee11ac1 100644
--- a/target/hexagon/meson.build
+++ b/target/hexagon/meson.build
@@ -156,7 +156,8 @@ dectree_generated = custom_target(
     'dectree_generated.h.inc',
     output: 'dectree_generated.h.inc',
     depends: [iset_py],
-    command: ['env', 'PYTHONPATH=' + meson.current_build_dir(), files('dectree.py'), '@OUTPUT@'],
+    env: {'PYTHONPATH': meson.current_build_dir()},
+    command: [python, files('dectree.py'), '@OUTPUT@'],
 )
 hexagon_ss.add(dectree_generated)
 
-- 
2.29.2


Re: [PATCH 4/4] hexagon: use env keyword argument to pass PYTHONPATH
Posted by Richard Henderson 4 years, 8 months ago
On 3/10/21 4:49 AM, Paolo Bonzini wrote:
> This feature is new in meson 0.57 and allows getting rid of the "env" wrapper.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/hexagon/meson.build | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build
> index bb0b4fb621..aaeee11ac1 100644
> --- a/target/hexagon/meson.build
> +++ b/target/hexagon/meson.build
> @@ -156,7 +156,8 @@ dectree_generated = custom_target(
>       'dectree_generated.h.inc',
>       output: 'dectree_generated.h.inc',
>       depends: [iset_py],
> -    command: ['env', 'PYTHONPATH=' + meson.current_build_dir(), files('dectree.py'), '@OUTPUT@'],
> +    env: {'PYTHONPATH': meson.current_build_dir()},
> +    command: [python, files('dectree.py'), '@OUTPUT@'],
>   )
>   hexagon_ss.add(dectree_generated)
>   
> 

This also fixes the python command nit I mentioned vs patch 1.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~