Skip to content

Add robust crash logging and dual-exe Windows build support#17

Merged
test1card merged 1 commit into
mainfrom
claude/debug-exe-hanging-Zvqxh
Mar 1, 2026
Merged

Add robust crash logging and dual-exe Windows build support#17
test1card merged 1 commit into
mainfrom
claude/debug-exe-hanging-Zvqxh

Conversation

@test1card

Copy link
Copy Markdown
Owner

Summary

This PR adds early-stage crash logging to the bootstrap entry point and implements a dual-executable Windows build system (GUI and CLI), with automatic GUI launch for frozen builds with no arguments.

Key Changes

Bootstrap & Crash Logging (src/venting/__main__.py)

  • Replaced simple import fallback with comprehensive bootstrap logic
  • Added early crash logging to %LOCALAPPDATA%\venting\logs\boot.log (or platform equivalent)
  • Implemented automatic GUI launch for PyInstaller frozen builds with no CLI arguments (H1 fix)
  • Added Windows MessageBox display for fatal startup errors in windowed builds
  • Captures full tracebacks to crash.log for debugging silent failures
  • Logs Python version, venting version, and execution context on startup

Dual Windows Executables

  • venting.spec (GUI): console=False, launches GUI directly on double-click
    • Enhanced with PySide6 plugin/translation data collection
    • Improved UPX exclusion patterns for Qt/PySide6 binaries
    • Added dynamic library collection for PySide6
  • venting_cli.spec (new): console=True, CLI-only executable for terminal usage
    • Mirrors GUI spec but with console enabled
    • Allows both GUI and CLI workflows from Windows

Build System (build_windows.py)

  • Added argument parsing: --gui-only, --cli-only, --debug flags
  • Refactored into reusable build_spec() function
  • Debug mode disables UPX and adds --log-level=DEBUG
  • Builds both executables by default, reports sizes and status
  • Improved user messaging and error handling

CI/CD Updates (.github/workflows/build_windows.yml)

  • Added smoke tests: venting_cli.exe --help and venting_cli.exe gate --single
  • Updated release notes to document both executables
  • Added crash log location guidance for users
  • Publishes both venting.exe and venting_cli.exe as release assets

Documentation

  • Updated spec file headers with purpose descriptions
  • Enhanced build script docstring with usage examples
  • Added .gitignore entries for build/ and dist/ directories

Implementation Details

  • Crash logging uses platform-appropriate directories (XDG_STATE_HOME on Linux, LOCALAPPDATA on Windows)
  • Falls back to TEMP if primary log directory is unwritable
  • MessageBox display is Windows-only and best-effort (no new dependencies)
  • Frozen exe detection uses sys.frozen attribute set by PyInstaller
  • CLI path remains unchanged for non-frozen or argument-provided invocations

https://claude.ai/code/session_015sYv5NFMoDqEA1J6yV757i

Root cause: the exe was built with console=False (GUI subsystem) but
the entry point required an argparse subcommand. Double-clicking the
exe provided no args, causing argparse to call sys.exit(2) with the
error message going to invisible stderr. The process appeared in Task
Manager briefly and then vanished with no visible output.

Changes:
- __main__.py: add bootstrap crash logging to %LOCALAPPDATA%\venting\logs\
  and a Windows MessageBox on fatal errors; when running as a frozen exe
  with no args, launch the GUI directly instead of requiring a subcommand
- venting.spec: add PySide6 plugin/translation data collection and dynamic
  libs to prevent Qt platform plugin failures; widen UPX exclusions to
  cover all Qt/PySide6 binaries (*.pyd, Qt6*.dll, pyside6*.dll)
- venting_cli.spec: new spec for a console=True CLI executable
- build_windows.py: build both venting.exe (GUI) and venting_cli.exe (CLI);
  support --gui-only, --cli-only, and --debug flags
- build_windows.yml: add smoke tests (--help and gate --single) for the
  CLI exe; publish both artifacts in the release
- .gitignore: add build/ and dist/

https://claude.ai/code/session_015sYv5NFMoDqEA1J6yV757i
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@test1card
test1card merged commit 616ebbc into main Mar 1, 2026
6 checks passed
@test1card
test1card deleted the claude/debug-exe-hanging-Zvqxh branch March 1, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants