Get the version of the meson executable that will be used. Returns: Version string (e.g., "1.10.1") or "unknown" on error
()
| 59 | |
| 60 | |
| 61 | def get_meson_version() -> str: |
| 62 | """ |
| 63 | Get the version of the meson executable that will be used. |
| 64 | |
| 65 | Returns: |
| 66 | Version string (e.g., "1.10.1") or "unknown" on error |
| 67 | """ |
| 68 | try: |
| 69 | result = subprocess.run( |
| 70 | [get_meson_executable(), "--version"], |
| 71 | capture_output=True, |
| 72 | text=True, |
| 73 | encoding="utf-8", |
| 74 | errors="replace", |
| 75 | timeout=5, |
| 76 | ) |
| 77 | if result.returncode == 0: |
| 78 | return result.stdout.strip() |
| 79 | return "unknown" |
| 80 | except (subprocess.SubprocessError, FileNotFoundError): |
| 81 | return "unknown" |
| 82 | |
| 83 | |
| 84 | def check_meson_version_compatibility(build_dir: Path) -> tuple[bool, str]: |
no test coverage detected