···11-diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py
22---- a/python/mach/mach/site.py
33-+++ b/python/mach/mach/site.py
44-@@ -15,10 +15,11 @@
55- import site
66- import subprocess
77- import sys
88- import sysconfig
99- import tempfile
1010-+import warnings
1111- from contextlib import contextmanager
1212- from pathlib import Path
1313- from typing import Callable, Optional
1414-1515- from mach.requirements import (
1616-@@ -817,37 +818,79 @@
1717-1818- class PythonVirtualenv:
1919- """Calculates paths of interest for general python virtual environments"""
2020-2121- def __init__(self, prefix):
2222-- if _is_windows:
2323-- self.bin_path = os.path.join(prefix, "Scripts")
2424-- self.python_path = os.path.join(self.bin_path, "python.exe")
2525-- else:
2626-- self.bin_path = os.path.join(prefix, "bin")
2727-- self.python_path = os.path.join(self.bin_path, "python")
2828- self.prefix = os.path.realpath(prefix)
2929-+ self.paths = self._get_sysconfig_paths(self.prefix)
3030-3131-- @functools.lru_cache(maxsize=None)
3232-- def resolve_sysconfig_packages_path(self, sysconfig_path):
3333-- # macOS uses a different default sysconfig scheme based on whether it's using the
3434-- # system Python or running in a virtualenv.
3535-- # Manually define the scheme (following the implementation in
3636-- # "sysconfig._get_default_scheme()") so that we're always following the
3737-- # code path for a virtualenv directory structure.
3838-- if os.name == "posix":
3939-- scheme = "posix_prefix"
4040-- else:
4141-- scheme = os.name
4242-+ # Name of the Python executable to use in virtual environments.
4343-+ # An executable with the same name as sys.executable might not exist in
4444-+ # virtual environments. An executable with 'python' as the steam —
4545-+ # without version numbers or ABI flags — will always be present in
4646-+ # virtual environments, so we use that.
4747-+ python_exe_name = "python" + sysconfig.get_config_var("EXE")
4848-+
4949-+ self.bin_path = self.paths["scripts"]
5050-+ self.python_path = os.path.join(self.bin_path, python_exe_name)
5151-5252-- sysconfig_paths = sysconfig.get_paths(scheme)
5353-- data_path = Path(sysconfig_paths["data"])
5454-- path = Path(sysconfig_paths[sysconfig_path])
5555-- relative_path = path.relative_to(data_path)
5656-+ @staticmethod
5757-+ def _get_sysconfig_paths(prefix):
5858-+ """Calculate the sysconfig paths of a virtual environment in the given prefix.
5959-6060-- # Path to virtualenv's "site-packages" directory for provided sysconfig path
6161-- return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path))
6262-+ The virtual environment MUST be using the same Python distribution as us.
6363-+ """
6464-+ # Determine the sysconfig scheme used in virtual environments
6565-+ if "venv" in sysconfig.get_scheme_names():
6666-+ # A 'venv' scheme was added in Python 3.11 to allow users to
6767-+ # calculate the paths for a virtual environment, since the default
6868-+ # scheme may not always be the same as used on virtual environments.
6969-+ # Some common examples are the system Python distributed by macOS,
7070-+ # Debian, and Fedora.
7171-+ # For more information, see https://github.com/python/cpython/issues/89576
7272-+ venv_scheme = "venv"
7373-+ elif os.name == "nt":
7474-+ # We know that before the 'venv' scheme was added, on Windows,
7575-+ # the 'nt' scheme was used in virtual environments.
7676-+ venv_scheme = "nt"
7777-+ elif os.name == "posix":
7878-+ # We know that before the 'venv' scheme was added, on POSIX,
7979-+ # the 'posix_prefix' scheme was used in virtual environments.
8080-+ venv_scheme = "posix_prefix"
8181-+ else:
8282-+ # This should never happen with upstream Python, as the 'venv'
8383-+ # scheme should always be available on >=3.11, and no other
8484-+ # platforms are supported by the upstream on older Python versions.
8585-+ #
8686-+ # Since the 'venv' scheme isn't available, and we have no knowledge
8787-+ # of this platform/distribution, fallback to the default scheme.
8888-+ #
8989-+ # Hitting this will likely be the result of running a custom Python
9090-+ # distribution targetting a platform that is not supported by the
9191-+ # upstream.
9292-+ # In this case, unless the Python vendor patched the Python
9393-+ # distribution in such a way as the default scheme may not always be
9494-+ # the same scheme, using the default scheme should be correct.
9595-+ # If the vendor did patch Python as such, to work around this issue,
9696-+ # I would recommend them to define a 'venv' scheme that matches
9797-+ # the layout used on virtual environments in their Python distribution.
9898-+ # (rec. signed Filipe Laíns — upstream sysconfig maintainer)
9999-+ venv_scheme = sysconfig.get_default_scheme()
100100-+ warnings.warn(
101101-+ f"Unknown platform '{os.name}', using the default install scheme '{venv_scheme}'. "
102102-+ "If this is incorrect, please ask your Python vendor to add a 'venv' sysconfig scheme "
103103-+ "(see https://github.com/python/cpython/issues/89576, or check the code comment).",
104104-+ stacklevel=2,
105105-+ )
106106-+ # Build the sysconfig config_vars dictionary for the virtual environment.
107107-+ venv_vars = sysconfig.get_config_vars().copy()
108108-+ venv_vars["base"] = venv_vars["platbase"] = prefix
109109-+ # Get sysconfig paths for the virtual environment.
110110-+ return sysconfig.get_paths(venv_scheme, vars=venv_vars)
111111-+
112112-+ def resolve_sysconfig_packages_path(self, sysconfig_path):
113113-+ return self.paths[sysconfig_path]
114114-115115- def site_packages_dirs(self):
116116- dirs = []
117117- if sys.platform.startswith("win"):
118118- dirs.append(os.path.normpath(os.path.normcase(self.prefix)))
119119-
···156156 connection-monitor-preview = throw "The 'connection-monitor-preview' extension for azure-cli was deprecated upstream"; # Added 2024-11-02, https://github.com/Azure/azure-cli-extensions/pull/8194
157157 deidservice = throw "The 'deidservice' extension for azure-cli was moved under healthcareapis"; # Added 2024-11-19, https://github.com/Azure/azure-cli-extensions/pull/8224
158158 logz = throw "The 'logz' extension for azure-cli was deprecated upstream"; # Added 2024-11-02, https://github.com/Azure/azure-cli-extensions/pull/8459
159159+ spring = throw "The 'spring' extension for azure-cli was deprecated upstream"; # Added 2025-05-07, https://github.com/Azure/azure-cli-extensions/pull/8652
159160}
+3-3
pkgs/by-name/az/azure-cli/package.nix
···2626}:
27272828let
2929- version = "2.71.0";
2929+ version = "2.72.0";
30303131 src = fetchFromGitHub {
3232 name = "azure-cli-${version}-src";
3333 owner = "Azure";
3434 repo = "azure-cli";
3535- rev = "azure-cli-${version}";
3636- hash = "sha256-vtuDgj3UJCmKxYg0OgG59ezQh7HlscNywz61BHDzJF8=";
3535+ tag = "azure-cli-${version}";
3636+ hash = "sha256-LuQhGrAYVgv+OH214A4xz4LV+xwIshNAH8nAlQL4mDc=";
3737 };
38383939 # put packages that needs to be overridden in the py package scope
-5
pkgs/by-name/az/azure-cli/python-packages.nix
···154154 };
155155 });
156156157157- # ModuleNotFoundError: No module named 'azure.mgmt.compute.v2024_07_01'
158158- azure-mgmt-compute =
159159- overrideAzureMgmtPackage super.azure-mgmt-compute "33.0.0" "tar.gz"
160160- "sha256-o8wP5PCcjh01I8G/uSYg3+JjoKiTsKwToz1wV+nd3dI=";
161161-162157 # ImportError: cannot import name 'ResourceSku' from 'azure.mgmt.eventgrid.models'
163158 azure-mgmt-eventgrid =
164159 overrideAzureMgmtPackage super.azure-mgmt-eventgrid "10.2.0b2" "zip"
···22 lib,
33 stdenv,
44 fetchFromGitLab,
55+ fetchpatch,
56 meson,
67 ninja,
78 pkg-config,
···149150 wlroots_0_17 = generic {
150151 version = "0.17.4";
151152 hash = "sha256-AzmXf+HMX/6VAr0LpfHwfmDB9dRrrLQHt7l35K98MVo=";
153153+ patches = [
154154+ (fetchpatch {
155155+ # SIGCHLD here isn't fatal: we have other means of notifying that things were
156156+ # successful or failure, and it causes many compositors to have to do a bunch
157157+ # of extra work: https://github.com/qtile/qtile/issues/5101
158158+ url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/631e5be0d7a7e4c7086b9778bc8fac809f96d336.patch";
159159+ hash = "sha256-3Jnx4ZeKc3+NxraK2T7nZ2ibtWJuTEFmxa976fjAqsM=";
160160+ })
161161+ ];
152162 };
153163154164 wlroots_0_18 = generic {