Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<prefix>_extensions_list` and `<prefix>_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.
27 changes: 23 additions & 4 deletions backend/prepare_cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())

Expand All @@ -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

Expand Down
Loading