From 0a0d087b2125b6c7b6461d58f57265bc56b3b22b Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 14 May 2026 11:43:18 +0100 Subject: fix(remote-dev): expose python3.11 (versioned-only) for Mason pip installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ubuntu 20.04's stock python3 is 3.8.10, which fails Mason's pep440 checks for autotools-language-server, codespell, mdformat, nginx-language-server, systemdlint, yamllint (all want >=3.9 or >=3.10). Mason's pypi installer (verified against upstream lua/mason-core/installer/managers/pypi.lua) probes python3.6 through python3.14 in PATH in addition to plain python3, so providing python3.11 alone (without python3) is enough. Add a thin runCommand derivation that symlinks ONLY pkgs.python311/bin/python3.11 into the profile — not python3 or python — so we don't shadow Ubuntu's /usr/bin/python3 and keep the leaf-tools policy intact. --- remote-dev/home.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/remote-dev/home.nix b/remote-dev/home.nix index d178eca..c5dfcc7 100644 --- a/remote-dev/home.nix +++ b/remote-dev/home.nix @@ -84,7 +84,18 @@ in # Editor/AI agent runtimes — NOT for project builds (see policy above) nodejs_24 # Mason npm LSPs + copilot-language-server (needs Node 24, see ai.lua) uv # Mason python LSPs in isolated venvs; brings `uv`/`uvx` only - jre # for Mason's groovy-language-server (headless Java runtime) + jre # for Mason's groovy-language-server (headless Java runtime) + + # Mason's pip-installer probes `python3.13`, `python3.12`, ..., `python3.10` + # in PATH (in addition to `python3`) when picking an interpreter for the + # per-pkg venvs it creates. Ubuntu 20.04 ships only `python3` = 3.8 which + # is too old for codespell/mdformat/yamllint/etc. We expose ONLY the + # versioned `python3.11` binary so we don't shadow the system `python3` + # (preserving the leaf-tools policy: system builds keep using /usr/bin/python3). + (pkgs.runCommand "python311-versioned-only" { } '' + mkdir -p $out/bin + ln -s ${pkgs.python311}/bin/python3.11 $out/bin/python3.11 + '') # Mason fallbacks: Mason's pip/cargo installers can't run on this VM # under our leaf-tools policy, so we provide these binaries on PATH and -- cgit v1.3.1