From 0989563afc0858ea71bffed8aafcb813a7f8b96f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Thu, 3 Dec 2026 17:31:31 -0500 Subject: [PATCH] fix(release): pin OpenCV's build to scikit-build 0.19.1 so the desktop builds run again (2.24.0) All four 2.24.0 desktop builds stopped in prepare_cv.py with "module 'skbuild.cmaker' has no attribute 'CMaker'" while pip got OpenCV's build requirements. opencv-python 4.12.0.88 asks for scikit-build>=0.14.0 with no upper bound and calls skbuild.cmaker.CMaker; scikit-build 1.0.0, out on 2 Dec 2026, removed it. Nothing in formcut changed. prepare_cv.py writes a constraints file pinning scikit-build==0.19.1, the last 0.x and what every earlier build used, and names it in PIP_BUILD_CONSTRAINT and PIP_CONSTRAINT for the pip that builds OpenCV, on every platform. With pip 26.2.1 the same step fails without the pin and gets past OpenCV's build requirements with it. tests/test_prepare_cv.py passes. The reasoning is in backend/HASHOUT_LOG.md. --- backend/HASHOUT_LOG.md | 6 ++++++ backend/prepare_cv.py | 27 +++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 9046d9d3..6acc0ea6 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -550,3 +550,9 @@ Reasoning behind engine changes, newest first. - **Fail at once with no window.** The contract asks a CLI that cannot reach a window to fail at once. `agent_next` records when a window last polled; `ask_window` refuses straight away when none has in 35 s (one 25 s long-poll plus slack), so `app.cli` and an engine with its window closed answer "the formcut window is not open" immediately instead of after the 15 s claim wait. - **Prefixed tool names.** The MCP tools are `formcut_extensions_list` and `formcut_extension_command`: every formcut tool carries the `formcut_` prefix, and the contract (07:47 resolution) names them `_extensions_list` and `_extension_command` on such servers. The README count is 34. `_rpc` gained a `timeout` argument so the command tool can wait 180 s (the window allows 150 s for a command plus the consent dialog). - **Save without a dialog.** `/api/extensions/save` with `downloads: true` writes into `~/Downloads` (created when missing) as `name (2).ext` when the name is taken, the contract's fallback for a host with no save dialog. Only the base name is used, leading dots stripped, so the window's confirm dialog cannot aim it elsewhere. The window sends it only after the person confirms the name in formcut's own dialog. + +## prepare_cv.py: OpenCV's build pinned to scikit-build 0.19.1 (2.24.0) + +All four 2.24.0 desktop builds (Linux, macOS arm64, macOS Intel, Windows) stopped in `prepare_cv.py` with `AttributeError: module 'skbuild.cmaker' has no attribute 'CMaker'`, while pip was getting OpenCV's build requirements. opencv-python 4.12.0.88 asks for `scikit-build>=0.14.0` with no upper bound and its `setup.py` calls `skbuild.cmaker.CMaker`; scikit-build 1.0.0, published 2 Dec 2026 22:12 UTC, removed it, so every source build after that picked 1.0.0 and failed. Nothing in formcut changed. + +`BUILD_CONSTRAINTS` pins `scikit-build==0.19.1`, the last 0.x release and the one every earlier build resolved to. `constrain_build` writes it to a file in the build's temporary folder and names it in both `PIP_BUILD_CONSTRAINT` (pip's `--build-constraint`, which the runners' pip 26.2.1 has) and `PIP_CONSTRAINT` (how older pips constrained build environments). The pin only reaches the isolated build environment; the engine's own requirements are unchanged. Checked here with pip 26.2.1: the same `pip` step without the pin fails with the CMaker error, and with it pip gets past OpenCV's build requirements (`pip download --no-binary` of 4.12.0.88 runs that same hook). The full compile was not run here; the release runners are the check. Lift the pin when OpenCV publishes a release whose build supports scikit-build 1.x. diff --git a/backend/prepare_cv.py b/backend/prepare_cv.py index c2c5a10b..ced4c76b 100644 --- a/backend/prepare_cv.py +++ b/backend/prepare_cv.py @@ -34,6 +34,13 @@ PACKAGE = "opencv-python-headless" VERSION = "4.12.0.88" +# opencv-python 4.12.0.88's build asks for scikit-build>=0.14.0 with no upper bound, +# and its setup.py calls skbuild.cmaker.CMaker, which scikit-build 1.0.0 (2 Dec 2026) +# removed: every build stopped with "module 'skbuild.cmaker' has no attribute 'CMaker'". +# The build environment is pinned to 0.19.1, the last 0.x release and the one every +# build before 2 Dec 2026 resolved to. +BUILD_CONSTRAINTS = "scikit-build==0.19.1\n" + # opencv-python's setup.py requires the videoio FFmpeg DLL on Windows even when # FFmpeg is not built, and stops with "Not found: 'bin/opencv_videoio_ffmpeg...'" # after a successful compile (seen on the Windows release runner). Its check exempts @@ -95,6 +102,17 @@ def build_environment(platform: str = sys.platform) -> dict: return environment +def constrain_build(environment: dict, folder: Path) -> Path: + """Pin OpenCV's build requirements: PIP_BUILD_CONSTRAINT for the pips that have + --build-constraint (the runners' pip 26.2.1 does), PIP_CONSTRAINT for older pips, + which applied it to build environments.""" + constraints = folder / "build-constraints.txt" + constraints.write_text(BUILD_CONSTRAINTS, encoding="utf-8") + environment["PIP_BUILD_CONSTRAINT"] = str(constraints) + environment["PIP_CONSTRAINT"] = str(constraints) + return constraints + + def enabled(info: str, name: str) -> bool: return any(line.strip().startswith(name + ":") and "YES" in line for line in info.splitlines()) @@ -111,11 +129,12 @@ def main() -> int: if target: print(f"It will run on macOS {target} and later.", flush=True) pip = [sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-deps"] - if sys.platform == "win32": - with tempfile.TemporaryDirectory() as folder: + with tempfile.TemporaryDirectory() as folder: + constrain_build(environment, Path(folder)) + if sys.platform == "win32": subprocess.run([*pip, str(windows_source(Path(folder)))], env=environment, check=True) - else: - subprocess.run([*pip, "--no-binary", PACKAGE, f"{PACKAGE}=={VERSION}"], env=environment, check=True) + else: + subprocess.run([*pip, "--no-binary", PACKAGE, f"{PACKAGE}=={VERSION}"], env=environment, check=True) print("Image-processing runtime installed. The freeze step will verify the new build in a fresh process.") return 0