Skip to content

feat(jac-client): configurable PyInstaller sidecar build timeout via [desktop.bundle]#5576

Open
MusabMahmoodh wants to merge 7 commits intojaseci-labs:mainfrom
MusabMahmoodh:fix/sidecar-build-timeout
Open

feat(jac-client): configurable PyInstaller sidecar build timeout via [desktop.bundle]#5576
MusabMahmoodh wants to merge 7 commits intojaseci-labs:mainfrom
MusabMahmoodh:fix/sidecar-build-timeout

Conversation

@MusabMahmoodh
Copy link
Copy Markdown
Contributor

@MusabMahmoodh MusabMahmoodh commented Apr 16, 2026

Summary

Replace the hard-coded 2-hour timeout bump with a 40-minute default that users can override per project via [desktop.bundle] pyinstaller_timeout in jac.toml.

Rationale

The original bug was a 10-minute timeout firing on first-run Windows builds (PyInstaller + cold Rust + ~20 jaclang modules compiling on first probe). The first cut bumped it to 2 hours, which fixes the immediate symptom but is a bad default:

  • If a build is genuinely stuck (broken import, runaway compilation, hung subprocess), you wait 2 hours before the timeout bites.
  • The practical population of "legitimate builds exceeding 2h" is near zero; the population of "stuck builds silently burning CI time" is not.

40 minutes covers realistic cold Windows + PyInstaller first runs (typically 15–30 min) while failing fast on stalls. Users with unusually large plugin sets or slow hardware set their own limit in jac.toml.

Changes

  • SUBPROCESS_TIMEOUT_BUILD: 7200 → 2400 seconds (40 min default).
  • New [desktop.bundle] pyinstaller_timeout key in jac.toml, read via DesktopConfig.get_pyinstaller_timeout().
  • _bundle_sidecar / _bundle_sidecar_pyinstaller accept a pyinstaller_timeout: int = SUBPROCESS_TIMEOUT_BUILD parameter. The build call site reads the configured value from DesktopConfig and plumbs it through.
  • Timeout warning now renders the actual configured value and points users at the jac.toml key so raising it is discoverable:
    PyInstaller timed out after 40 minutes. Raise [desktop.bundle]
    pyinstaller_timeout in jac.toml if your build legitimately needs longer.
    
  • jaclang --version probe kept on SUBPROCESS_TIMEOUT_MEDIUM (60s) — unchanged from previous revision.

Configuration

[desktop.bundle]
pyinstaller_timeout = 2400   # seconds; default

Test plan

test_desktop_build_config.jac covers:

  • SUBPROCESS_TIMEOUT_BUILD default is 2400.
  • DesktopConfig declares and implements get_pyinstaller_timeout().
  • Default config surfaces the bundle section with pyinstaller_timeout: 2400.
  • _bundle_sidecar_pyinstaller accepts the parameter and uses it in the subprocess call.
  • Caller reads desktop_config.get_pyinstaller_timeout() and passes it through.
  • Timeout warning renders the dynamic value and points at the jac.toml key.
  • jaclang --version probe still uses MEDIUM timeout.
  • Reviewer: verify jac build --client desktop on a slow Windows host still completes within 40 min on a cold cache; if not, this is a signal that 40m is still too low and we should revisit.

The PyInstaller sidecar build timeout was 10 minutes, which was too short
for slow machines and first-run Windows builds where jaclang compiles ~20
modules on initial invocation.

- SUBPROCESS_TIMEOUT_BUILD: 600 -> 7200 seconds (2 hours)
- Update timeout warning message from '10 minutes' to '2 hours'
- jaclang --version probe now uses SUBPROCESS_TIMEOUT_MEDIUM (60s) instead
  of SUBPROCESS_TIMEOUT_SHORT (5s); the probe can exceed 5s on first run
  when jaclang compiles its internal modules.

Adds test_desktop_build_config.jac with two focused assertions and a
release note under jac-client 0.3.13 (Unreleased).
Run 'jac format --lintfix' to satisfy the CI formatter. Cosmetic
line-wrapping only; no behavioural changes.
Move the 0.3.13 unreleased bullet for the PyInstaller sidecar timeout raise into docs/docs/community/release_notes/unreleased/jac-client/5576.bugfix.md, per the new fragment-based release-notes process. The shared jac-client.md is restored to its pre-PR state; fragments are promoted into it at release time.
… via jac.toml

Replace the hard-coded 2-hour bump with a 40-minute default that users can override per project. 2h was too long for genuinely stuck builds (you'd wait 2h before failing); 40m covers realistic cold-cache Windows + PyInstaller first runs while failing fast on stalls.

- SUBPROCESS_TIMEOUT_BUILD: 7200 -> 2400 seconds (40 min default)
- New [desktop.bundle] pyinstaller_timeout key in jac.toml, read via DesktopConfig.get_pyinstaller_timeout()
- _bundle_sidecar / _bundle_sidecar_pyinstaller accept pyinstaller_timeout; the build call site reads it from DesktopConfig and plumbs it through
- Timeout warning renders the actual configured value and points users to the jac.toml key so bumping it is discoverable
- Tests cover: default value, config plumbing (class decl + impl + caller), and the warning text contract
@MusabMahmoodh MusabMahmoodh changed the title fix(jac-client): raise PyInstaller sidecar build timeout to 2h feat(jac-client): configurable PyInstaller sidecar build timeout via [desktop.bundle] Apr 20, 2026
Pre-commit hook 'ban-em-dashes' rejected the fragment and test on this branch. Both replaced with '--' to match the repo convention used in existing release notes and docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants