From 73f4813d40ce6f985837376e1ef017069f4b899a Mon Sep 17 00:00:00 2001 From: zackees Date: Wed, 13 May 2026 15:36:52 -0700 Subject: [PATCH 1/2] build: drop sccache fallback; zccache is the only compile cache Soldr (via zccache) is the project's compile cache. The sccache fallback in ci/env.py::_apply_rustc_wrapper was carried forward from the pre-soldr era; with PR #79 (closing #75) it no longer serves a purpose. Remove the fallback so RUSTC_WRAPPER points only at zccache when set. Co-Authored-By: Claude Opus 4.7 (1M context) --- ci/env.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ci/env.py b/ci/env.py index 6ec69d79..321bfae1 100644 --- a/ci/env.py +++ b/ci/env.py @@ -166,20 +166,18 @@ def activate() -> None: def _apply_rustc_wrapper(env: dict[str, str]) -> dict[str, str]: - """Set RUSTC_WRAPPER to zccache when available, falling back to sccache. + """Set RUSTC_WRAPPER to zccache when available. - The project uses zccache (via soldr) for compile caching. Prefer it; fall - back to sccache for environments where only that is installed. Bare cargo - invocations that consume this env still benefit from the cache even though - most callers in this repo now route through ``soldr cargo`` directly. + The project uses zccache (via soldr) for compile caching. Bare cargo + invocations that consume this env still benefit from the cache even + though most callers in this repo route through ``soldr cargo`` directly + (which manages the wrapper itself). """ if env.get("RUSTC_WRAPPER"): return env - for tool in ("zccache", "sccache"): - found = shutil.which(tool, path=env.get("PATH")) - if found: - env["RUSTC_WRAPPER"] = found - return env + found = shutil.which("zccache", path=env.get("PATH")) + if found: + env["RUSTC_WRAPPER"] = found return env From 6d3018e0b369af8c12a85d8e8878de7ace4931f5 Mon Sep 17 00:00:00 2001 From: zackees Date: Wed, 13 May 2026 15:52:30 -0700 Subject: [PATCH 2/2] ci(lint): install rustfmt/clippy via rustup; relax test_version assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes the two CI regressions that PR #80 surfaced on main: 1. **Lint job missing rustfmt and clippy.** zackees/setup-soldr@v0 reads only the channel from rust-toolchain.toml; the components array (["clippy", "rustfmt"]) is ignored. With the minimal profile, cargo fmt fails: error: 'cargo-fmt' is not installed for the toolchain Provision them explicitly via rustup component add after setup-soldr. Soldr itself does not yet expose component management — its CLI runs tools from the active toolchain but doesn't install missing components. 2. **test_version.py expects bare version string.** The Rust CLI (clap) emits 'fastled 2.0.7' for --version, matching the standard ' ' format. The Python-era argparse emitted just '2.0.7'. Switch from assertEqual to assertIn so the package version is verified to be present without prescribing the exact format. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/_lint.yml | 6 ++++++ tests/unit/test_version.py | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml index 3547dc9a..c5c7da7d 100644 --- a/.github/workflows/_lint.yml +++ b/.github/workflows/_lint.yml @@ -35,6 +35,12 @@ jobs: # collide on the same cache key and one job fails to save. cache-key-suffix: lint-${{ inputs.runs-on }}-${{ github.workflow }} + - name: Install rustfmt + clippy components + # setup-soldr reads `channel` from rust-toolchain.toml but does not + # honor the `components` array, so cargo fmt / cargo clippy fail with + # "component is not installed". Provision them explicitly here. + run: rustup component add rustfmt clippy + - name: Install system dependencies (Linux) if: runner.os == 'Linux' run: | diff --git a/tests/unit/test_version.py b/tests/unit/test_version.py index 68658e47..879b5dc0 100644 --- a/tests/unit/test_version.py +++ b/tests/unit/test_version.py @@ -15,13 +15,18 @@ class MainTester(unittest.TestCase): """Main tester class.""" def test_command(self) -> None: - """Test command line interface (CLI).""" + """Test command line interface (CLI). + + The Rust CLI emits clap's standard " " format + (e.g. "fastled 2.0.7"); assert the package __version__ is present + in that output rather than requiring an exact match. + """ stdout = subprocess.check_output(COMMAND, stdin=subprocess.DEVNULL) version_stdout = stdout.decode("utf-8").strip() - self.assertEqual( - version_stdout, + self.assertIn( __version__, - f"FastLED Version mismatch: {version_stdout} (tool output) != {__version__} (package version)", + version_stdout, + f"FastLED Version mismatch: {version_stdout} (tool output) does not contain {__version__} (package version)", )