Skip to content

fix(desktop): allow builds from non-git checkouts with fallback commit - #50864

Open
allin2 wants to merge 2 commits into
NousResearch:mainfrom
allin2:fix/desktop-build-non-git
Open

fix(desktop): allow builds from non-git checkouts with fallback commit#50864
allin2 wants to merge 2 commits into
NousResearch:mainfrom
allin2:fix/desktop-build-non-git

Conversation

@allin2

@allin2 allin2 commented Jun 22, 2026

Copy link
Copy Markdown

Summary

The desktop build script threw a fatal error when the project source was not a git repository.

Motivation

Fixes #50823

Users who downloaded the source as a ZIP archive or deployed via bootstrap installer without a .git directory could not build the Windows desktop client.

Changes

  • fix: Added fromFallback() that provides a placeholder commit hash for non-git builds
  • The desktop app treats 0000000... as 'unknown' and skips commit-pinned first-launch bootstrap
  • Added warning message when fallback is used

Validation

  • Non-git builds now complete successfully with a placeholder commit
  • Warning message informs users about the limitation
  • Production builds from git checkouts still work as before

Checklist

  • Code follows the project's style guidelines
  • No unrelated changes included
  • Commit message follows Conventional Commits format

The desktop build script write-build-stamp.cjs threw a fatal error when
the project source was not a git repository (e.g. downloaded as ZIP,
deployed via bootstrap installer without .git).

Added fromFallback() that provides a placeholder commit hash
(0000000...) for non-git builds. The desktop app treats this as
'unknown' and skips commit-pinned first-launch bootstrap.

Fixes NousResearch#50823
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 22, 2026
@alt-glitch alt-glitch added comp/desktop Electron desktop app (apps/desktop/*) and removed comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 26, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing the non-git desktop-build failure. The premise remains valid on current main: apps/desktop/scripts/write-build-stamp.mjs:81-92 still exits when neither CI metadata nor a git checkout is available, and the linked #61657 reports the same Windows failure.

Problems

  • The submitted files are the pre-migration CJS paths. Current main renamed them in 39d09453f95e8aefc0c97e5d9b30ff341cae9ed8 to bootstrap-runner.ts, bootstrap-runner.test.ts, and write-build-stamp.mjs, so the patch needs a port to the current desktop implementation.
  • Current main's runner has newer fresh-install pin control at apps/desktop/electron/bootstrap-runner.ts:548-574. The port must keep an unknown fallback out of -Commit/--commit while retaining that existing-checkout behavior.
  • The PR adds runner tests but no regression test for the failing stamp-generator path (write-build-stamp.mjs:81-92) without git or GITHUB_SHA.

Suggested changes

  • Port the fallback stamp and branch-based bootstrap resolution to the TS/MJS files, preserving immutable pins for CI/git builds and an explicit unpinned warning for fallback builds.
  • Add an isolated no-git generator test plus fallback bootstrap/pin-argument coverage.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop build hard fails with "could not determine git commit" on non-git checkouts (Windows native)

3 participants