···1-diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py
2---- a/python/mach/mach/site.py
3-+++ b/python/mach/mach/site.py
4-@@ -15,10 +15,11 @@
5- import site
6- import subprocess
7- import sys
8- import sysconfig
9- import tempfile
10-+import warnings
11- from contextlib import contextmanager
12- from pathlib import Path
13- from typing import Callable, Optional
14-15- from mach.requirements import (
16-@@ -817,37 +818,79 @@
17-18- class PythonVirtualenv:
19- """Calculates paths of interest for general python virtual environments"""
20-21- def __init__(self, prefix):
22-- if _is_windows:
23-- self.bin_path = os.path.join(prefix, "Scripts")
24-- self.python_path = os.path.join(self.bin_path, "python.exe")
25-- else:
26-- self.bin_path = os.path.join(prefix, "bin")
27-- self.python_path = os.path.join(self.bin_path, "python")
28- self.prefix = os.path.realpath(prefix)
29-+ self.paths = self._get_sysconfig_paths(self.prefix)
30-31-- @functools.lru_cache(maxsize=None)
32-- def resolve_sysconfig_packages_path(self, sysconfig_path):
33-- # macOS uses a different default sysconfig scheme based on whether it's using the
34-- # system Python or running in a virtualenv.
35-- # Manually define the scheme (following the implementation in
36-- # "sysconfig._get_default_scheme()") so that we're always following the
37-- # code path for a virtualenv directory structure.
38-- if os.name == "posix":
39-- scheme = "posix_prefix"
40-- else:
41-- scheme = os.name
42-+ # Name of the Python executable to use in virtual environments.
43-+ # An executable with the same name as sys.executable might not exist in
44-+ # virtual environments. An executable with 'python' as the steam —
45-+ # without version numbers or ABI flags — will always be present in
46-+ # virtual environments, so we use that.
47-+ python_exe_name = "python" + sysconfig.get_config_var("EXE")
48-+
49-+ self.bin_path = self.paths["scripts"]
50-+ self.python_path = os.path.join(self.bin_path, python_exe_name)
51-52-- sysconfig_paths = sysconfig.get_paths(scheme)
53-- data_path = Path(sysconfig_paths["data"])
54-- path = Path(sysconfig_paths[sysconfig_path])
55-- relative_path = path.relative_to(data_path)
56-+ @staticmethod
57-+ def _get_sysconfig_paths(prefix):
58-+ """Calculate the sysconfig paths of a virtual environment in the given prefix.
59-60-- # Path to virtualenv's "site-packages" directory for provided sysconfig path
61-- return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path))
62-+ The virtual environment MUST be using the same Python distribution as us.
63-+ """
64-+ # Determine the sysconfig scheme used in virtual environments
65-+ if "venv" in sysconfig.get_scheme_names():
66-+ # A 'venv' scheme was added in Python 3.11 to allow users to
67-+ # calculate the paths for a virtual environment, since the default
68-+ # scheme may not always be the same as used on virtual environments.
69-+ # Some common examples are the system Python distributed by macOS,
70-+ # Debian, and Fedora.
71-+ # For more information, see https://github.com/python/cpython/issues/89576
72-+ venv_scheme = "venv"
73-+ elif os.name == "nt":
74-+ # We know that before the 'venv' scheme was added, on Windows,
75-+ # the 'nt' scheme was used in virtual environments.
76-+ venv_scheme = "nt"
77-+ elif os.name == "posix":
78-+ # We know that before the 'venv' scheme was added, on POSIX,
79-+ # the 'posix_prefix' scheme was used in virtual environments.
80-+ venv_scheme = "posix_prefix"
81-+ else:
82-+ # This should never happen with upstream Python, as the 'venv'
83-+ # scheme should always be available on >=3.11, and no other
84-+ # platforms are supported by the upstream on older Python versions.
85-+ #
86-+ # Since the 'venv' scheme isn't available, and we have no knowledge
87-+ # of this platform/distribution, fallback to the default scheme.
88-+ #
89-+ # Hitting this will likely be the result of running a custom Python
90-+ # distribution targetting a platform that is not supported by the
91-+ # upstream.
92-+ # In this case, unless the Python vendor patched the Python
93-+ # distribution in such a way as the default scheme may not always be
94-+ # the same scheme, using the default scheme should be correct.
95-+ # If the vendor did patch Python as such, to work around this issue,
96-+ # I would recommend them to define a 'venv' scheme that matches
97-+ # the layout used on virtual environments in their Python distribution.
98-+ # (rec. signed Filipe Laíns — upstream sysconfig maintainer)
99-+ venv_scheme = sysconfig.get_default_scheme()
100-+ warnings.warn(
101-+ f"Unknown platform '{os.name}', using the default install scheme '{venv_scheme}'. "
102-+ "If this is incorrect, please ask your Python vendor to add a 'venv' sysconfig scheme "
103-+ "(see https://github.com/python/cpython/issues/89576, or check the code comment).",
104-+ stacklevel=2,
105-+ )
106-+ # Build the sysconfig config_vars dictionary for the virtual environment.
107-+ venv_vars = sysconfig.get_config_vars().copy()
108-+ venv_vars["base"] = venv_vars["platbase"] = prefix
109-+ # Get sysconfig paths for the virtual environment.
110-+ return sysconfig.get_paths(venv_scheme, vars=venv_vars)
111-+
112-+ def resolve_sysconfig_packages_path(self, sysconfig_path):
113-+ return self.paths[sysconfig_path]
114-115- def site_packages_dirs(self):
116- dirs = []
117- if sys.platform.startswith("win"):
118- dirs.append(os.path.normpath(os.path.normcase(self.prefix)))
119-
···156 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
157 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
158 logz = throw "The 'logz' extension for azure-cli was deprecated upstream"; # Added 2024-11-02, https://github.com/Azure/azure-cli-extensions/pull/8459
0159}
···156 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
157 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
158 logz = throw "The 'logz' extension for azure-cli was deprecated upstream"; # Added 2024-11-02, https://github.com/Azure/azure-cli-extensions/pull/8459
159+ spring = throw "The 'spring' extension for azure-cli was deprecated upstream"; # Added 2025-05-07, https://github.com/Azure/azure-cli-extensions/pull/8652
160}
+3-3
pkgs/by-name/az/azure-cli/package.nix
···26}:
2728let
29- version = "2.71.0";
3031 src = fetchFromGitHub {
32 name = "azure-cli-${version}-src";
33 owner = "Azure";
34 repo = "azure-cli";
35- rev = "azure-cli-${version}";
36- hash = "sha256-vtuDgj3UJCmKxYg0OgG59ezQh7HlscNywz61BHDzJF8=";
37 };
3839 # put packages that needs to be overridden in the py package scope
···26}:
2728let
29+ version = "2.72.0";
3031 src = fetchFromGitHub {
32 name = "azure-cli-${version}-src";
33 owner = "Azure";
34 repo = "azure-cli";
35+ tag = "azure-cli-${version}";
36+ hash = "sha256-LuQhGrAYVgv+OH214A4xz4LV+xwIshNAH8nAlQL4mDc=";
37 };
3839 # put packages that needs to be overridden in the py package scope
-5
pkgs/by-name/az/azure-cli/python-packages.nix
···154 };
155 });
156157- # ModuleNotFoundError: No module named 'azure.mgmt.compute.v2024_07_01'
158- azure-mgmt-compute =
159- overrideAzureMgmtPackage super.azure-mgmt-compute "33.0.0" "tar.gz"
160- "sha256-o8wP5PCcjh01I8G/uSYg3+JjoKiTsKwToz1wV+nd3dI=";
161-162 # ImportError: cannot import name 'ResourceSku' from 'azure.mgmt.eventgrid.models'
163 azure-mgmt-eventgrid =
164 overrideAzureMgmtPackage super.azure-mgmt-eventgrid "10.2.0b2" "zip"
···2 lib,
3 stdenv,
4 fetchFromGitLab,
5+ fetchpatch,
6 meson,
7 ninja,
8 pkg-config,
···150 wlroots_0_17 = generic {
151 version = "0.17.4";
152 hash = "sha256-AzmXf+HMX/6VAr0LpfHwfmDB9dRrrLQHt7l35K98MVo=";
153+ patches = [
154+ (fetchpatch {
155+ # SIGCHLD here isn't fatal: we have other means of notifying that things were
156+ # successful or failure, and it causes many compositors to have to do a bunch
157+ # of extra work: https://github.com/qtile/qtile/issues/5101
158+ url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/631e5be0d7a7e4c7086b9778bc8fac809f96d336.patch";
159+ hash = "sha256-3Jnx4ZeKc3+NxraK2T7nZ2ibtWJuTEFmxa976fjAqsM=";
160+ })
161+ ];
162 };
163164 wlroots_0_18 = generic {