From 596cae0442fe9d6f04f1f544360bb740e3f0aab2 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Mon, 14 Sep 2026 15:27:31 -0700 Subject: [PATCH] chore: unpin soldr in .clud/settings.json so clud stops downgrading the global soldr `clud optimize` wrote `soldr_version: 0.7.11` into `.clud/settings.json` (31e28e24) from what was then its hardcoded default. Since zackees/clud 09b4fc0, clud reconciles an explicit pin on every launch with `uv tool install --force soldr==0.7.11`, which downgrades the global soldr every other project shares (0.9.15 -> 0.7.11 on 2026-09-14). Drop the key so clud floats: it reuses the installed soldr and installs the latest release only when soldr is missing. `install_soldr` and `use_soldr_shims` stay on. Add `ci/test_clud_settings_soldr.py` to keep the pin from coming back, and run it in the CI Workflow Drift job. Closes #1436 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Fg9EZEUZcM8uc6ibJc3WSX --- .clud/settings.json | 1 - .github/workflows/ci-workflow-drift.yml | 4 ++ ci/test_clud_settings_soldr.py | 55 +++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 ci/test_clud_settings_soldr.py diff --git a/.clud/settings.json b/.clud/settings.json index fe20ecf61..2bded3ca2 100644 --- a/.clud/settings.json +++ b/.clud/settings.json @@ -2,7 +2,6 @@ "optimize": { "rust": { "install_soldr": true, - "soldr_version": "0.7.11", "use_soldr_shims": true } } diff --git a/.github/workflows/ci-workflow-drift.yml b/.github/workflows/ci-workflow-drift.yml index b4907b016..e0668855e 100644 --- a/.github/workflows/ci-workflow-drift.yml +++ b/.github/workflows/ci-workflow-drift.yml @@ -50,3 +50,7 @@ jobs: run: uv run --no-project python ci/check_no_legacy_cross.py - name: Unit-test the cross-backend guard run: uv run --no-project python -m unittest ci.test_no_legacy_cross + # clud force-reinstalls a pinned soldr as the global uv tool on every + # launch, downgrading every other project's soldr. See FastLED/fbuild#1436. + - name: Verify .clud/settings.json does not pin soldr + run: uv run --no-project python -m unittest ci.test_clud_settings_soldr diff --git a/ci/test_clud_settings_soldr.py b/ci/test_clud_settings_soldr.py new file mode 100644 index 000000000..a4a79303b --- /dev/null +++ b/ci/test_clud_settings_soldr.py @@ -0,0 +1,55 @@ +"""Guard: .clud/settings.json must not pin a soldr version. + +clud reconciles an explicit ``soldr_version`` on every launch by running +``uv tool install --force soldr==``, which replaces the soldr shared by +every project on the machine. An unpinned config lets clud reuse whatever +soldr is installed and install the latest release only when it is missing. +See FastLED/fbuild#1436. +""" + +from __future__ import annotations + +import json +import unittest +from pathlib import Path +from typing import Any + +SETTINGS = Path(__file__).resolve().parent.parent / ".clud" / "settings.json" + + +def find_soldr_version_keys(node: Any, path: str = "") -> list[str]: + """Return the JSON path of every ``soldr_version`` key at any depth.""" + found: list[str] = [] + if isinstance(node, dict): + for key, value in node.items(): + child = f"{path}.{key}" if path else key + if key == "soldr_version": + found.append(child) + found.extend(find_soldr_version_keys(value, child)) + elif isinstance(node, list): + for index, value in enumerate(node): + found.extend(find_soldr_version_keys(value, f"{path}[{index}]")) + return found + + +class CludSettingsSoldrTests(unittest.TestCase): + def setUp(self) -> None: + self.settings = json.loads(SETTINGS.read_text(encoding="utf-8")) + + def test_soldr_version_is_not_pinned(self) -> None: + self.assertEqual(find_soldr_version_keys(self.settings), []) + + def test_soldr_install_and_shims_stay_enabled(self) -> None: + rust = self.settings["optimize"]["rust"] + self.assertIs(rust["install_soldr"], True) + self.assertIs(rust["use_soldr_shims"], True) + + def test_finder_sees_nested_pins(self) -> None: + sample = {"a": [{"soldr_version": "1"}], "b": {"c": {"soldr_version": "2"}}} + self.assertEqual( + find_soldr_version_keys(sample), ["a[0].soldr_version", "b.c.soldr_version"] + ) + + +if __name__ == "__main__": + unittest.main()