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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ description: Verifying a change to formencoder before it ships. Use after any en
| Separate tools | `./formencoder install-tools --keep-going` then `execute tools.list` | each tool reports its path; a package or software encode reads back through `verify` |
| Interface types and bundle | `cd frontend && npm run build` | no errors |
| Text hygiene | `python3 setup/lint_text.py .` | 0 findings |
| Windows freeze command | `backend/venv/bin/python setup/check_freeze_bat.py` (PyInstaller from `backend/requirements_desktop.txt`) | 0 findings |
| Agent references | `./formencoder agents sync --check` | in step |
| Skills | the god-tier `validate_skill.py` on `.claude/skills/formencoder-harness` and `formencoder-skillset` | 0 FAIL |
| Toolchain | `./formencoder doctor` | ready |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ jobs:
run: python3 setup/lint_text.py .
- name: Python syntax of the setup scripts
run: python3 -m py_compile setup/*.py
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: The Windows freeze command parses as PyInstaller reads it
run: |
python -m pip install -r backend/requirements_desktop.txt
python setup/check_freeze_bat.py

desktop-shell:
runs-on: ubuntu-22.04
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v0.13.1 · 2026-11-20

The Windows release builds again.

- Fixed: the Windows build of 0.13.0 stopped while packaging the engine, because one space was missing from the packaging command. The command is whole again, and every check now reads that command the way the packager does, so a slip of this kind fails the checks before a release.
- Fixed, on 64-bit Windows: the LAME MP3 encoder and the C2PA tool were left out of the Windows app because they did not build there. Both are now built for the right processor, and the C2PA tool uses a full Perl when the computer has one.
- The engine's 105 tests that need its native core were run again with it built: the whole engine suite passes, 282 tests.
- Not run for this release: Windows itself (the first proof is the windows_x64 release build), macOS and the desktop app.

## v0.13.0 · 2026-11-20

The family's design names, and a released status.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ backend/venv/bin/pip install -r backend/requirements-test.txt
backend/venv/bin/python -m pytest frontend/tests/window -q -p no:cacheprovider
python3 setup/lint_text.py .
python3 -m py_compile setup/*.py
backend/venv/bin/pip install -r backend/requirements_desktop.txt
backend/venv/bin/python setup/check_freeze_bat.py
```

The engine tests need FFmpeg on your path, and the window smoke needs Playwright and its
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>

<p align="center">
<img alt="version 0.13.0" src="https://img.shields.io/badge/version-0.13.0-eef0f4?style=flat-square">
<img alt="version 0.13.1" src="https://img.shields.io/badge/version-0.13.1-eef0f4?style=flat-square">
<img alt="Rust" src="https://img.shields.io/badge/Rust-engine-b7410e?style=flat-square&logo=rust&logoColor=white">
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-interface-3178c6?style=flat-square">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
Expand Down Expand Up @@ -102,7 +102,7 @@ FormEncoder loads extensions made to the Form Extension Contract (API 1): FormPo

## Under the hood

Version 0.13.0 · Apache-2.0 · Rust encoding engine, Python service, TypeScript interface, Tauri 2 shell
Version 0.13.1 · Apache-2.0 · Rust encoding engine, Python service, TypeScript interface, Tauri 2 shell

- **Engine:** seven `fencoder` Rust crates in `native/`, loaded by the Python service as the `fe_core` extension.
- **FFmpeg:** a pinned LGPL build, run as a separate program and never linked.
Expand Down
17 changes: 17 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,20 @@ Refers to `setup/freeze_backend`, `setup/freeze_backend.bat` · kind: change ·
- Why: the owner's decision for the family (D3): a Windows engine is built with no console window, as FormWeb's is. FormEncoder's freeze scripts had no switch, so the switch is added with its default turned round: on Windows PyInstaller gets `--noconsole` unless `FORMENCODER_ENGINE_WINDOWED=0`. The bash script adds it only where `fe_os` says windows; macOS and Linux builds are unchanged.
- The shell reads the engine's output through pipes, which a program with no console still gets. Where it has none at all, `formencoder_engine.py` already puts `os.devnull` in place of a missing stdin, stdout or stderr before anything else runs.
- Seen: `--selfcheck` run from the source with `sys.stdout`, `sys.stderr` and `sys.stdin` set to None exits 0. `bash -n setup/freeze_backend` clean; the `.bat` was read, not run. Not run: no Windows build has shown the windowed engine.

## The Windows freeze command is whole again, and a check parses it (0.13.1)

Refers to `setup/freeze_backend.bat`, `setup/check_freeze_bat.py`, `.github/workflows/ci.yml` (job `scripts`), `CONTRIBUTING.md` · kind: fix · logged: 0.13.1 · 2026-11-20

- Why: the entry above lost a space in the `.bat` (`--name formencoder-engine--distpath dist-engine`). PyInstaller took `formencoder-engine--distpath` as the name and `dist-engine` as the script, and refused the real script as an unrecognized argument, so the 0.13.0 release stopped for windows_x64. The space is back. Read token by token against `setup/freeze_backend`: every option and the five `--add-data` pairs match (`;` for `:`); the `.bat` adds `--collect-submodules winpty`, which only Windows installs (`pywinpty` in `requirements.txt` is for win32).
- `setup/check_freeze_bat.py` takes the one `pyinstaller` line out of the `.bat`, puts stand-ins for `%ROOT%` (`D:\a\formencoder\formencoder`) and `%CONSOLE%` (`--noconsole`), splits it as cmd.exe does (double quotes group, backslashes are plain) and parses it with `PyInstaller.__main__.generate_parser()` with `os.pathsep` set to `;` for the call. It parses the POSIX twin the same way (with `:`), and fails if either line is refused, if the `.bat`'s script names are not the engine entry file alone, or if any parsed option differs from the twin's apart from `winpty` in `collect_submodules`. CI's `scripts` job installs `requirements_desktop.txt` and runs it; CONTRIBUTING lists it.
- Seen: on the 0.13.0 line it exits 1 with PyInstaller's own `error: unrecognized arguments: D:\a\formencoder\formencoder\backend\formencoder_engine.py`; on the fixed line 0 findings; with one `--add-data` destination changed in a scratch copy it names the `datas` difference and exits 1. Not run: Windows itself; the first proof is the windows_x64 release build.

## LAME and c2patool build on 64-bit Windows (0.13.1)

Refers to `setup/install_tools.py` (`nmake_machine`, `full_perl`, `run`, `install`) · kind: fix · logged: 0.13.1 · 2026-11-20

- Why: the 0.13.0 Windows build log left both tools out. LAME's `nmake -f Makefile.MSVC` ended in `LNK1112: module machine type 'x64' conflicts with target machine type 'x86'`: the compiler from the x64 MSVC environment made x64 objects and the makefile's `lib` step asked for `/machine:I386`. c2patool's `cargo install` failed in vendored OpenSSL because the `perl` first on PATH is Git's, which lacks `Locale::Maketext::Simple`.
- LAME: nmake gets `MSVCVER=Win64 MACHINE=/machine:X64` (a command-line macro wins over the makefile's own), or `MACHINE=/machine:ARM64` on ARM64, chosen from `VSCMD_ARG_TGT_ARCH` (the MSVC environment's target, which is what the compiler makes) and else `platform.machine()`. A 32-bit target gets the command as before. LAME 3.100's `Makefile.MSVC` could not be read here (no copy on this machine, no web), so the two macros are the ones the build log points at, not read from the file.
- c2patool: on Windows the first of `OPENSSL_SRC_PERL`, `C:\Strawberry\perl\bin\perl.exe` and the `perl` on PATH that runs `-MLocale::Maketext::Simple -e 1` is passed as `OPENSSL_SRC_PERL` to that one `cargo install` only (the `openssl-src` crate reads it). With none, it says so and runs as before, so a failure is still the `--keep-going` warning.
- Seen on Linux: the probe picks `/usr/bin/perl`; the macros are `x64` and `arm64` as above and none for `x86`. Not run: Windows itself; the first proof is the windows_x64 release build.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.13.0"
__version__ = "0.13.1"
2 changes: 1 addition & 1 deletion demo/assets/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/broadcast/assets/broadcast.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/inspect/assets/inspect.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion form-functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"format": "form-functions",
"format_version": 1,
"app": "formencoder",
"app_version": "0.13.0",
"app_version": "0.13.1",
"functions": [
{
"id": "encode",
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formencoder",
"private": true,
"version": "0.13.0",
"version": "0.13.1",
"description": "formencoder · the media encoder of the form family",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.13.0';
export const VERSION = '0.13.1';
14 changes: 7 additions & 7 deletions native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
]

[workspace.package]
version = "0.13.0"
version = "0.13.1"
edition = "2024"
rust-version = "1.95"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion native/fencoder-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "fe-core"
version = "0.13.0"
version = "0.13.1"
description = "formencoder's own encoding engine for the formencoder engine service"
license = { text = "Apache-2.0" }
requires-python = ">=3.10"
Expand Down
115 changes: 115 additions & 0 deletions setup/check_freeze_bat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
"""Check the PyInstaller command line in setup/freeze_backend.bat without Windows.

The command is taken out of the .bat, given stand-in values for its %VARIABLES%,
split the way cmd.exe splits it and parsed with PyInstaller's own argument parser,
with the Windows path separator. It fails when the parser refuses the line, when the
script name is not the engine entry file, or when the parsed options differ from the
POSIX twin setup/freeze_backend (parsed the same way) by more than the Windows-only
extras listed below. Needs PyInstaller (backend/requirements_desktop.txt).
"""

import os
import re
import shlex
import sys

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BAT = os.path.join(ROOT_DIR, "setup", "freeze_backend.bat")
POSIX = os.path.join(ROOT_DIR, "setup", "freeze_backend")
WIN_ROOT = "D:\\a\\formencoder\\formencoder"
POSIX_ROOT = "/standin/formencoder"
ENTRY = "<root>/backend/formencoder_engine.py"
BAT_VARS = {"ROOT": WIN_ROOT, "CONSOLE": "--noconsole"}
WINDOWS_ONLY = {"collect_submodules": ["winpty"]}


def bat_command(text):
lines = [line for line in text.splitlines() if line.lstrip().lower().startswith("pyinstaller ")]
if len(lines) != 1:
raise SystemExit(f"check_freeze_bat: expected one pyinstaller line in {BAT}, found {len(lines)}")
line = re.sub(r"\s*\|\|\s*exit /b \d+\s*$", "", lines[0].strip(), flags=re.IGNORECASE)
line = re.sub(r"%(\w+)%", lambda m: BAT_VARS.get(m.group(1).upper(), "standin"), line)
tokens, current, quoted, started = [], [], False, False
for ch in line:
if ch == '"':
quoted, started = not quoted, True
elif ch in " \t" and not quoted:
if started:
tokens.append("".join(current))
current, started = [], False
else:
current.append(ch)
started = True
if quoted:
raise SystemExit("check_freeze_bat: unbalanced quote in the pyinstaller line")
if started:
tokens.append("".join(current))
return tokens


def posix_command(text):
lines = text.splitlines()
start = next(i for i, line in enumerate(lines) if line.lstrip().startswith("pyinstaller "))
parts = []
for line in lines[start:]:
parts.append(line.rstrip().rstrip("\\"))
if not line.rstrip().endswith("\\"):
break
line = " ".join(parts)
line = line.replace('"${console[@]}"', "--noconsole").replace("${sep}", ":")
line = line.replace("$FORMENCODER_ROOT", POSIX_ROOT)
return shlex.split(line)


def parse(tokens, pathsep):
from PyInstaller.__main__ import generate_parser

saved = os.pathsep
os.pathsep = pathsep
try:
return vars(generate_parser().parse_args(tokens[1:]))
except SystemExit:
return None
finally:
os.pathsep = saved


def normal(value, root):
if isinstance(value, str):
return value.replace(root, "<root>").replace("\\", "/")
if isinstance(value, (list, tuple)):
return [normal(v, root) for v in value]
return value


def main():
with open(BAT, encoding="utf-8") as fh:
bat = parse(bat_command(fh.read()), ";")
if bat is None:
print("check_freeze_bat: PyInstaller's parser refuses the command in setup/freeze_backend.bat")
return 1
with open(POSIX, encoding="utf-8") as fh:
posix = parse(posix_command(fh.read()), ":")
if posix is None:
print("check_freeze_bat: PyInstaller's parser refuses the command in setup/freeze_backend")
return 1
bat = {k: normal(v, WIN_ROOT) for k, v in bat.items()}
posix = {k: normal(v, POSIX_ROOT) for k, v in posix.items()}
findings = []
if bat["filenames"] != [ENTRY]:
findings.append(f"the .bat's script names are {bat['filenames']}, not [{ENTRY!r}]")
for key in sorted(set(bat) | set(posix)):
want = posix.get(key)
got = bat.get(key)
if key in WINDOWS_ONLY and isinstance(got, list):
got = [v for v in got if v not in WINDOWS_ONLY[key]]
if got != want:
findings.append(f"{key}: .bat gives {got!r}, setup/freeze_backend gives {want!r}")
for line in findings:
print(f"check_freeze_bat: {line}")
print(f"check_freeze_bat: {len(findings)} finding(s)")
return 1 if findings else 0


if __name__ == "__main__":
sys.exit(main())
2 changes: 1 addition & 1 deletion setup/freeze_backend.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if not "%FORMENCODER_ENGINE_WINDOWED%"=="0" set "CONSOLE=--noconsole"
cd backend
if exist build\pyinstaller rmdir /s /q build\pyinstaller
if exist dist-engine rmdir /s /q dist-engine
pyinstaller --noconfirm --clean --onefile %CONSOLE% --name formencoder-engine--distpath dist-engine --workpath build\pyinstaller --specpath build\pyinstaller --add-data "%ROOT%\frontend\dist;frontend_dist" --add-data "%ROOT%\backend\app\agent\templates;agent_templates" --add-data "%ROOT%\.claude\skills;skills" --add-data "%ROOT%\backend\app\resources;resources" --add-data "%ROOT%\src-tauri\binaries\ffmpeg-licence.json;." --collect-all fe_core --collect-submodules app --collect-submodules uvicorn --collect-submodules keyring --collect-submodules winpty "%ROOT%\backend\formencoder_engine.py" || exit /b 1
pyinstaller --noconfirm --clean --onefile %CONSOLE% --name formencoder-engine --distpath dist-engine --workpath build\pyinstaller --specpath build\pyinstaller --add-data "%ROOT%\frontend\dist;frontend_dist" --add-data "%ROOT%\backend\app\agent\templates;agent_templates" --add-data "%ROOT%\.claude\skills;skills" --add-data "%ROOT%\backend\app\resources;resources" --add-data "%ROOT%\src-tauri\binaries\ffmpeg-licence.json;." --collect-all fe_core --collect-submodules app --collect-submodules uvicorn --collect-submodules keyring --collect-submodules winpty "%ROOT%\backend\formencoder_engine.py" || exit /b 1
if not exist "%ROOT%\src-tauri\binaries" mkdir "%ROOT%\src-tauri\binaries"
copy /y dist-engine\formencoder-engine.exe "%ROOT%\src-tauri\binaries\formencoder-engine-%TRIPLE%.exe" >nul
"%ROOT%\src-tauri\binaries\formencoder-engine-%TRIPLE%.exe" --selfcheck
38 changes: 34 additions & 4 deletions setup/install_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def platform_data() -> Path:
return Path(os.environ.get("XDG_DATA_HOME", home / ".local" / "share")) / "formencoder"


def run(cmd: list[str], cwd: Path | None = None) -> None:
def run(cmd: list[str], cwd: Path | None = None, env: dict[str, str] | None = None) -> None:
print("[install-tools] " + " ".join(cmd), flush=True)
subprocess.run(cmd, cwd=cwd, check=True)
subprocess.run(cmd, cwd=cwd, check=True, env=env)


def fetch_tarball(name: str, spec: dict, work: Path) -> Path:
Expand Down Expand Up @@ -137,9 +137,31 @@ def build_triple() -> list[str]:
return [f"--build={cpu}-apple-darwin", f"--host={cpu}-apple-darwin"]


def nmake_machine() -> list[str]:
target = (os.environ.get("VSCMD_ARG_TGT_ARCH") or platform.machine()).lower()
if target in ("x64", "amd64"):
return ["MSVCVER=Win64", "MACHINE=/machine:X64"]
if target in ("arm64", "aarch64"):
return ["MSVCVER=Win64", "MACHINE=/machine:ARM64"]
return []


def full_perl() -> str | None:
for candidate in (os.environ.get("OPENSSL_SRC_PERL"), r"C:\Strawberry\perl\bin\perl.exe", shutil.which("perl")):
if not candidate or not Path(candidate).is_file():
continue
try:
probe = subprocess.run([candidate, "-MLocale::Maketext::Simple", "-e", "1"], capture_output=True, timeout=60)
except (OSError, subprocess.TimeoutExpired):
continue
if probe.returncode == 0:
return candidate
return None


def build_autotools(spec: dict, src: Path) -> Path:
if os.name == "nt":
run(["nmake", "-f", "Makefile.MSVC", "comp=msvc", "asm=no"], cwd=src)
run(["nmake", "-f", "Makefile.MSVC", "comp=msvc", "asm=no", *nmake_machine()], cwd=src)
return src / "output"
refresh_config_scripts(src)
run(["./configure", "--disable-shared", "--enable-static", "--disable-gtktest", "--disable-decoder", *build_triple()], cwd=src)
Expand Down Expand Up @@ -248,7 +270,15 @@ def install(name: str, spec: dict, dest: Path, notices: Path, work: Path, stage:
return
if "crate" in spec:
root = work / f"{spec['crate']}-{spec['tag']}"
run(["cargo", "install", "--locked", f"{spec['crate']}@{spec['tag']}", "--root", str(root)])
env = None
if os.name == "nt":
perl = full_perl()
if perl:
env = {**os.environ, "OPENSSL_SRC_PERL": perl}
print(f"[install-tools] OpenSSL for {spec['crate']} is built with {perl}", flush=True)
else:
print(f"[install-tools] no Perl with Locale::Maketext::Simple was found (Strawberry Perl has it); the OpenSSL that {spec['crate']} builds may fail", flush=True)
run(["cargo", "install", "--locked", f"{spec['crate']}@{spec['tag']}", "--root", str(root)], env=env)
exe = spec["crate"] + (".exe" if os.name == "nt" else "")
shutil.copy2(root / "bin" / exe, dest / exe)
(notices / f"{name}-{spec['licence']}.txt").write_text(f"{spec['crate']} {spec['tag']} from crates.io, built with cargo install --locked.\nLicensed under the MIT License or the Apache License 2.0, at your option: https://github.com/contentauth/c2pa-rs\n", encoding="utf-8")
Expand Down
Loading
Loading