meson: Fix MESONINTROSPECT parsing
v3 cover meson: Fix MESONINTROSPECT parsing
The arguments in MESONINTROSPECT are quoted with shlex.quote() so it must be parsed with shlex.split().
To: Beraldo Leal <[email protected]>
To: Peter Maydell <[email protected]>
Cc: [email protected]
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Daniel P. Berrangé <[email protected]>
Cc: Marc-André Lureau <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Cleber Rosa <[email protected]>
Cc: John Snow <[email protected]>
Cc: Michael Tokarev <[email protected]>
Changes in v3:
- Ensured meson>=1.4.0 on Windows.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Added patch "buildsys: Bump known good meson version to v1.4.0".
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Akihiko Odaki (2):
buildsys: Bump known good meson version to v1.4.0
meson: Fix MESONINTROSPECT parsing
configure | 5 +++++ python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.4.0-py3-none-any.whl | Bin 0 -> 935471 bytes pythondeps.toml | 2 +- scripts/symlink-install-tree.py | 3 ++- 6 files changed, 10 insertions(+), 4 deletions(-)
---
base-commit: ba49d760eb04630e7b15f423ebecf6c871b8f77b
change-id: 20240326-meson-b5e2c7a2fb2f
Best regards,
Signature · 1 line
Akihiko Odaki <[email protected]>
PATCH v3 1/2 buildsys: Bump known good meson version to v1.4.0
We need meson v1.4.0 to fix MESONINTROSPECT quoting on Windows:
https://github.com/mesonbuild/meson/pull/12807
--- python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.4.0-py3-none-any.whl | Bin 0 -> 935471 bytes pythondeps.toml | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-)
python/scripts/vendor.py +2 -2
@@ -41,8 +41,8 @@ def main() -> int: parser.parse_args() packages = { - "meson==1.2.3": - "4533a43c34548edd1f63a276a42690fce15bde9409bcf20c4b8fa3d7e4d7cac1", + "meson==1.4.0": + "476a458d51fcfa322a6bdc64da5138997c542d08e6b2e49b9fa68c46fd7c4475", "tomli==2.0.1": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
python/wheels/meson-1.2.3-py3-none-any.whl deleted binary +0 -0
python/wheels/meson-1.4.0-py3-none-any.whl new file binary +0 -0
pythondeps.toml +1 -1
@@ -19,7 +19,7 @@ [meson] # The install key should match the version in python/wheels/ -meson = { accepted = ">=0.63.0", installed = "1.2.3", canary = "meson" } +meson = { accepted = ">=0.63.0", installed = "1.4.0", canary = "meson" } [docs] sphinx = { accepted = ">=1.6", installed = "5.3.0", canary = "sphinx-build" }
Signature · 1 line
2.44.0
PATCH v3 2/2 meson: Fix MESONINTROSPECT parsing
In reply to Akihiko OdakiThe arguments in MESONINTROSPECT are quoted with shlex.quote() so it must be parsed with shlex.split().
meson<1.4.0 quotes arguments in MESONINTROSPECT with the Windows-specific format on the platform, which is incompatible with shlex.split(). meson>=1.4.0 uses shlex.quote() also on the platform and fixes the incompatibility so make sure meson>=1.4.0 on Windows.
--- configure | 5 +++++ scripts/symlink-install-tree.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)
configure +5 -0
@@ -956,6 +956,11 @@ fi $mkvenv ensuregroup --dir "${source_path}/python/wheels" \ ${source_path}/pythondeps.toml meson || exit 1 +# Windows needs: https://github.com/mesonbuild/meson/pull/12807 +if test "$host_os" = "windows"; then + $mkvenv ensure --dir "$source_path/python/wheels" 'meson>=1.4.0' || exit 1 +fi + # At this point, we expect Meson to be installed and available. # We expect mkvenv or pip to have created pyvenv/bin/meson for us. # We ignore PATH completely here: we want to use the venv's Meson
scripts/symlink-install-tree.py +2 -1
@@ -4,6 +4,7 @@ import errno import json import os +import shlex import subprocess import sys
@@ -14,7 +15,7 @@ def destdir_join(d1: str, d2: str) -> str: return str(PurePath(d1, *PurePath(d2).parts[1:])) introspect = os.environ.get('MESONINTROSPECT') -out = subprocess.run([*introspect.split(' '), '--installed'], +out = subprocess.run([*shlex.split(introspect), '--installed'], stdout=subprocess.PIPE, check=True).stdout for source, dest in json.loads(out).items(): bundle_dest = destdir_join('qemu-bundle', dest)
Signature · 1 line
2.44.0
Quoted 31 lines · Akihiko Odaki
The arguments in MESONINTROSPECT are quoted with
shlex.quote()so it must be parsed withshlex.split().Signed-off-by Akihiko Odaki <[email protected]>To: Beraldo Leal <[email protected]>
To: Peter Maydell <[email protected]>
Cc: [email protected]
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Daniel P. Berrangé <[email protected]>
Cc: Marc-André Lureau <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Cleber Rosa <[email protected]>
Cc: John Snow <[email protected]>
Cc: Michael Tokarev <[email protected]>Changes in v3:
- Ensured meson>=1.4.0 on Windows.
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Added patch "buildsys: Bump known good meson version to v1.4.0".
- Link to v1: https://lore.kernel.org/r/[email protected]---
Akihiko Odaki (2):
buildsys: Bump known good meson version to v1.4.0
meson: Fix MESONINTROSPECT parsing
Quoted 7 lines
configure | 5 +++++ python/scripts/vendor.py | 4 ++-- python/wheels/meson-1.2.3-py3-none-any.whl | Bin 964928 -> 0 bytes python/wheels/meson-1.4.0-py3-none-any.whl | Bin 0 -> 935471 bytes pythondeps.toml | 2 +- scripts/symlink-install-tree.py | 3 ++- 6 files changed, 10 insertions(+), 4 deletions(-)
I've just had a report of somebody running into this "if you have a ~ in your build dir then symlink-install-tree breaks" bug, and realized we never applied this series.
We've just required rust 1.5.0 (commit 07f0d32641e0) because we need it for the Rust support, so we don't need patch 1 here any more or the windows-specific bits in patch 2. So I think we can just update the symlink-install-tree script now, which ironically is what v1 of this patchset did :-) (Though if we cared about fixing this in the stable branches that would be more awkward.)
-- PMM