[PATCH] scripts/meson-dist.py: Git builddir from env too

Michal Privoznik posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/b09acf0c592ff9f67549fb8104a1a36b5facc982.1714396536.git.mprivozn@redhat.com
meson.build           | 4 ++--
scripts/meson-dist.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
[PATCH] scripts/meson-dist.py: Git builddir from env too
Posted by Michal Privoznik 1 year, 9 months ago
When meson runs a dist script it set both MESON_BUILD_ROOT and
MESON_DIST_ROOT envvars [1]. But for some reason, we took the
former as an argument and obtained the latter via env.
Well, obtain both via env.

1: https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonadd_dist_script
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Another option is to pass both directories as arguments. But this
inconsistent solution bothers me. Especially since I want to copy the
script somewhere else (stay tuned to learn more).

 meson.build           | 4 ++--
 scripts/meson-dist.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 1518afa1cb..5aa50e0d64 100644
--- a/meson.build
+++ b/meson.build
@@ -2195,8 +2195,8 @@ if git
 
   foreach file : dist_files
     meson.add_dist_script(
-      meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(),
-      meson.project_build_root(), file
+      meson_python_prog.full_path(), python3_prog.full_path(),
+      meson_dist_prog.full_path(), file
     )
   endforeach
 endif
diff --git a/scripts/meson-dist.py b/scripts/meson-dist.py
index bb751b97d3..39dd4fbab0 100755
--- a/scripts/meson-dist.py
+++ b/scripts/meson-dist.py
@@ -4,9 +4,9 @@ import os
 import shutil
 import sys
 
-meson_build_root = sys.argv[1]
-file_name = sys.argv[2]
+file_name = sys.argv[1]
 
+meson_build_root = os.environ['MESON_BUILD_ROOT']
 meson_dist_root = os.environ['MESON_DIST_ROOT']
 
 shutil.copy(os.path.join(meson_build_root, file_name),
-- 
2.43.2
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH] scripts/meson-dist.py: Git builddir from env too
Posted by Ján Tomko 1 year, 9 months ago
In the commit summary:

s/Git/Get/

On a Monday in 2024, Michal Privoznik wrote:
>When meson runs a dist script it set both MESON_BUILD_ROOT and

*sets

>MESON_DIST_ROOT envvars [1]. But for some reason, we took the
>former as an argument and obtained the latter via env.
>Well, obtain both via env.
>
>1: https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonadd_dist_script
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
>
>Another option is to pass both directories as arguments. But this
>inconsistent solution bothers me. Especially since I want to copy the
>script somewhere else (stay tuned to learn more).
>
> meson.build           | 4 ++--
> scripts/meson-dist.py | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org