mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-01 14:34:42 +01:00
* Fix spaced-out terminal text on Windows: put a Latin monospace before the CJK fallbacks On Windows none of the Mac/Linux monospace fonts in the stack are installed, so the first font that resolves is Malgun Gothic (the Windows Korean UI font). xterm.js sizes its character cell from that font's advance width, and Malgun Gothic advances Latin glyphs in a full-width CJK cell — doubling every cell and rendering the whole terminal (and the sidepanel mono UI) as spaced-out text. Insert Consolas (present on every Windows install) and the Cascadia faces ahead of the CJK fonts in both the xterm fontFamily and the --font-mono CSS var. The CJK fonts stay last for actual CJK coverage. No bundled font, no user install needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GKj8Nr8T4GvryTcWBJRMyC * fix(windows): every compiled binary answers --version before any side effect browse --version started a server and exited 1, pdf printed usage and exited 1, gstack-global-discover rejected the flag, and find-browse ran discovery. A launch probe for Smart App Control (#2595) needs one side-effect-free command that exits 0 on a healthy build, so browse, find-browse, make-pdf and gstack-global-discover now answer --version first (design already did). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(extension): pin Consolas ahead of the CJK fallbacks in both mono stacks (#2287) Regression test for @tomfluff's fix: the xterm fontFamily and --font-mono must list Consolas before Noto Sans Mono CJK KR and Malgun Gothic, or Windows renders the sidebar terminal double-width. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(cso): record each CSO build's outcome and stop arming the parent trap across the native publisher exec (#3071) scripts/build-cso.sh now writes bin/.gstack-cso-build-result: result, failed stage (build or publish), reason, this revision, the revision of the generation still installed, whether its launcher is usable, and the diagnostic log. An 'interrupted' entry is written before each stage so a killed run is visible. A failed publish that restores the old generation records it as still installed. Before exec'ing the native publisher, the parent re-checks the locker, clears its EXIT trap and enables execfail: the locked child's own trap owns the stage. On Git Bash an exec of a native program may not replace the shell, so the parent's trap could otherwise delete the stage under the running child (the vanishing files in #3071; root cause unproven). If the exec itself fails the parent cleans the stage and records it. The Windows build prefers PowerShell 7 (pwsh) over Windows PowerShell 5.1, which crashed outright on the reporter's machine. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(setup): an optional CSO build or publish failure no longer aborts setup (#3071) CSO was optional at probe time but fatal at build time: scripts/build.sh ran build-cso.sh under set -e before the browse server bundle and the completion stamp, and setup exited when the CSO artifact set was incomplete. A failed CSO step now prints 'CSO unavailable: the <stage> step failed' with its log (bin/.gstack-cso-build.log) and retry, and the build and setup finish. GSTACK_STRICT_BUILD=1 keeps it fatal; the free-tests, make-pdf-gate and windows-setup-e2e builds set it, so regressions still fail CI. setup's summary reads the build-result record instead of the pre-build availability flag: probe failures keep their prerequisite instruction; build and publish failures name the stage, the diagnostic and 'bun run build:cso && ./setup', and a restored earlier helper is reported as 'previous CSO kept: <revision>'. setup records probe failures in the same file. The Windows prerequisite probe prefers pwsh, and a probe that fails for any reason other than a missing toolchain or a compile error keeps its exit status and first output line (windows-toolchain-probe) instead of being labeled windows-msvc-toolchain. Reported and diagnosed by @dviolante. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(windows): detect Smart App Control-blocked binaries in setup and gstack-doctor (#2595, #2124) Smart App Control refuses the five unsigned binaries gstack compiles locally, and Git Bash reports it as 'Permission denied', so setup's [ -x ] gate passed and skills failed later. bin/gstack-launch-probe.sh runs each binary's side-effect-free --version and classifies it: native, blocked (spawn error, exit 126/127, or an application-control message), broken (launched, exited non-zero) or missing. It shows the raw first output line, since the exact Windows text is unverified. On Windows, setup names each blocked binary and the skills that need it, cites #2595, says which shell ran setup and whether WSL is installed, gives today's workarounds (WSL, or turning Smart App Control off), how to undo, and the new troubleshooting section. gstack-doctor's browse row now says 'blocked at launch' instead of passing, a binaries row covers the other four, and a cso row reads the build-result record. windows-setup-e2e builds with GSTACK_STRICT_BUILD=1, checks all five binaries answer --version, and adds two forced CSO failures: fatal under strict mode, and a completed setup that reports the failure and a doctor cso warning under GSTACK_STRICT_BUILD=0. No shim or launcher: it could not be called from PowerShell and would load the caller's project .env/bunfig. Signing is the follow-up in TODOS.md. Diagnosis credit: @knetics9000 (#2595, #2596), @smartjelic-sys (#2595), @pstilwell90 (#2124), @cko32002 (#2265), @salluexez (#2127). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: Windows Smart App Control known issue, optional CSO failures, doctor rows README's Windows section says /cso failures no longer stop setup (GSTACK_STRICT_BUILD=1 keeps them fatal), documents Smart App Control as a known issue with today's workarounds (WSL, or turning it off) and the Consolas fix. troubleshooting.md gains a Windows section for blocked binaries and an entry for CSO build/publish failures. TODOS.md replaces the Node CLI lane item with Windows code signing (needs a signing account), the #3071 root-cause follow-up and SAC text verification. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(setup): never write the CSO build record into a source checkout that needed no build Setup wrote bin/.gstack-cso-build-result for every probe-stage outcome, so a run that built nothing still changed the source checkout's bin/ (caught by setup-codex-scope's unchanged-source checks). A missing prerequisite now comes from the run's own probe, as before, and setup only removes a stale record alongside the removed helper. scripts/build-cso.sh remains the only writer. The doctor's cso row reports 'native helper not built' with no record. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(extension): move the Consolas font-stack check into sidebar-ux (#2287) The standalone file read extension sources without importing product code, which the test-of-test ratchet rejects; sidebar-ux already owns the sidepanel.css structural checks. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * v1.91.43.0 fix(windows): setup degrades instead of dying on a CSO failure, detects Smart App Control, Consolas terminal font Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: Yotam <yotsurfing@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
228 lines
11 KiB
YAML
228 lines
11 KiB
YAML
name: Windows Setup E2E
|
|
|
|
# End-to-end fresh-install gate for Windows. Builds a clean windows-latest
|
|
# checkout and asserts the build completes, binaries resolve via
|
|
# find-browse, and the gstack-paths state root resolves cleanly. Catches Bun
|
|
# shell-parser regressions in package.json's build chain (#1538, #1537,
|
|
# #1530, #1457, #1561) before they reach users. Then it runs `./setup` into
|
|
# an isolated HOME and drives the installed runtime root's browse from an
|
|
# unrelated directory: a piped two-command `chain` flow must print the page
|
|
# text (the runtime root has no node_modules, so this is the checkout-bundle
|
|
# path from #3026, and the piped-stdin path from #3039). Every compiled
|
|
# binary must answer the side-effect-free --version that setup's Smart App
|
|
# Control probe runs (#2595). Last, two forced CSO failures: fatal under
|
|
# GSTACK_STRICT_BUILD=1, and a completed setup with the failure reported
|
|
# under GSTACK_STRICT_BUILD=0 (#3071).
|
|
#
|
|
# Separate from windows-free-tests.yml because that one runs a curated
|
|
# unit-test subset; this one exercises the install path itself.
|
|
#
|
|
# Runner: GitHub-hosted free windows-latest. ~6-10 min total.
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'package.json'
|
|
- 'scripts/build.sh'
|
|
- 'scripts/build-cso.sh'
|
|
- 'scripts/build-cso-windows.ps1'
|
|
- 'scripts/write-version-files.sh'
|
|
- 'setup'
|
|
- 'browse/src/cli.ts'
|
|
- 'browse/src/find-browse.ts'
|
|
- 'browse/src/server.ts'
|
|
- 'browse/src/meta-commands.ts'
|
|
- 'browse/scripts/build-node-server.sh'
|
|
- 'design/src/cli.ts'
|
|
- 'make-pdf/src/cli.ts'
|
|
- 'bin/gstack-global-discover.ts'
|
|
- 'bin/gstack-paths'
|
|
- 'bin/gstack-doctor'
|
|
- 'bin/gstack-launch-probe.sh'
|
|
- '.github/workflows/windows-setup-e2e.yml'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
# PR-number keyed: head_ref carries no fork prefix, so same-name branches
|
|
# from two forks would share one group and cancel each other's runs.
|
|
group: windows-setup-e2e-${{ github.event.pull_request.number || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
# Install-path exercise only — no token writes.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
windows-setup:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 35
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
|
|
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
with:
|
|
bun-version: 1.4.2
|
|
|
|
# Same lockfile-keyed install cache as windows-free-tests.yml (install
|
|
# was 45s of a 64s job, all network).
|
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: windows-bun-${{ hashFiles('bun.lock') }}
|
|
# A lockfile bump starts from the previous cache instead of cold
|
|
# (restore alone costs ~43s; without this a bump pays it for nothing).
|
|
restore-keys: |
|
|
windows-bun-
|
|
|
|
- name: Configure git identity
|
|
run: |
|
|
git config --global user.email "windows-setup-e2e@gstack.test"
|
|
git config --global user.name "Windows Setup E2E"
|
|
git config --global init.defaultBranch main
|
|
shell: bash
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
shell: bash
|
|
|
|
- name: Run bun run build (the previously-broken path)
|
|
# This is the regression gate. Bun's Windows shell parser rejected
|
|
# multiple constructs the old inline build chain used; the wave
|
|
# moved the build to scripts/build.sh. If this step fails on
|
|
# Windows, the build chain regressed.
|
|
run: bun run build
|
|
shell: bash
|
|
env:
|
|
GSTACK_SKIP_PLAYWRIGHT: '1'
|
|
GSTACK_STRICT_BUILD: '1'
|
|
|
|
- name: Verify binaries exist (with .exe extension on Windows)
|
|
run: |
|
|
set -e
|
|
test -f browse/dist/browse.exe || test -f browse/dist/browse || (echo "MISSING: browse" && exit 1)
|
|
test -f browse/dist/find-browse.exe || test -f browse/dist/find-browse || (echo "MISSING: find-browse" && exit 1)
|
|
test -f design/dist/design.exe || test -f design/dist/design || (echo "MISSING: design" && exit 1)
|
|
test -f bin/gstack-global-discover.exe || test -f bin/gstack-global-discover || (echo "MISSING: gstack-global-discover" && exit 1)
|
|
echo "All binaries present"
|
|
shell: bash
|
|
|
|
- name: 'Every compiled binary launches with --version (Smart App Control probe, #2595)'
|
|
run: |
|
|
set -euo pipefail
|
|
. bin/gstack-launch-probe.sh
|
|
gstack_launch_probe_all "$PWD" .exe
|
|
printf 'blocked: %s\nbroken: %s\nmissing: %s\n' "$_glp_blocked" "$_glp_broken" "$_glp_missing"
|
|
test -z "$_glp_blocked$_glp_broken$_glp_missing" || (echo "a compiled binary did not answer --version" && exit 1)
|
|
shell: bash
|
|
|
|
- name: Verify find-browse resolves to the .exe variant
|
|
run: |
|
|
set -e
|
|
OUT=$(bun browse/src/find-browse.ts 2>&1) || true
|
|
echo "find-browse output: $OUT"
|
|
# On Windows, find-browse should successfully resolve to a binary,
|
|
# whether or not it has the .exe extension on disk. Empty output
|
|
# or "not found" means the .exe extension resolver regressed.
|
|
echo "$OUT" | grep -qE '(browse\.exe|browse)$' || (echo "find-browse failed to resolve binary on Windows" && exit 1)
|
|
shell: bash
|
|
|
|
- name: Verify gstack-paths state root resolves
|
|
run: |
|
|
set -e
|
|
eval "$(bash bin/gstack-paths)"
|
|
test -n "$GSTACK_STATE_ROOT" || (echo "GSTACK_STATE_ROOT empty" && exit 1)
|
|
test -n "$PLAN_ROOT" || (echo "PLAN_ROOT empty" && exit 1)
|
|
test -n "$TMP_ROOT" || (echo "TMP_ROOT empty" && exit 1)
|
|
echo "GSTACK_STATE_ROOT=$GSTACK_STATE_ROOT"
|
|
echo "PLAN_ROOT=$PLAN_ROOT"
|
|
echo "TMP_ROOT=$TMP_ROOT"
|
|
shell: bash
|
|
|
|
- name: Install with ./setup into an isolated HOME
|
|
# A real install: the codex host's runtime root is a copy of the
|
|
# runtime files with no node_modules beside it. setup installs
|
|
# Playwright's Chromium (best-effort) for the journey below.
|
|
run: |
|
|
set -euo pipefail
|
|
E2E_HOME="$RUNNER_TEMP/gstack-e2e-home"
|
|
mkdir -p "$E2E_HOME"
|
|
HOME="$E2E_HOME" USERPROFILE="$(cygpath -w "$E2E_HOME")" GSTACK_STRICT_BUILD=1 ./setup --host codex
|
|
ROOT="$E2E_HOME/.codex/skills/gstack"
|
|
test -f "$ROOT/.source-path" || (echo "MISSING: $ROOT/.source-path" && exit 1)
|
|
test ! -e "$ROOT/node_modules" || (echo "UNEXPECTED: $ROOT/node_modules (the journey must exercise the copy without it)" && exit 1)
|
|
echo "runtime root: $ROOT -> source $(cat "$ROOT/.source-path")"
|
|
shell: bash
|
|
|
|
- name: Installed browse runs a piped chain flow from an unrelated directory
|
|
run: |
|
|
set -euo pipefail
|
|
E2E_HOME="$RUNNER_TEMP/gstack-e2e-home"
|
|
USERPROFILE="$(cygpath -w "$E2E_HOME")"
|
|
export HOME="$E2E_HOME" USERPROFILE
|
|
BROWSE="$E2E_HOME/.codex/skills/gstack/browse/dist/browse.exe"
|
|
[ -f "$BROWSE" ] || BROWSE="$E2E_HOME/.codex/skills/gstack/browse/dist/browse"
|
|
test -f "$BROWSE" || (echo "MISSING: installed browse" && exit 1)
|
|
bun -e 'Bun.serve({ hostname: "127.0.0.1", port: 47123, fetch: () => new Response("<title>gstack e2e</title><h1>gstack-windows-chain-ok</h1>", { headers: { "content-type": "text/html" } }) }); setInterval(() => {}, 1 << 30);' &
|
|
PAGE_PID=$!
|
|
trap 'kill "$PAGE_PID" 2>/dev/null || true; "$BROWSE" stop >/dev/null 2>&1 || true' EXIT
|
|
UNRELATED="$RUNNER_TEMP/unrelated-dir"
|
|
mkdir -p "$UNRELATED" && cd "$UNRELATED"
|
|
set +e
|
|
OUT=$(printf '%s\n' '[["goto","http://127.0.0.1:47123/"],["text"]]' | "$BROWSE" chain 2>&1)
|
|
CODE=$?
|
|
set -e
|
|
echo "$OUT"
|
|
if [ "$CODE" -ne 0 ]; then
|
|
echo "browse chain exited $CODE; server logs:"
|
|
find "$UNRELATED" "$E2E_HOME" -maxdepth 4 \( -name 'browse-daemon.log' -o -name 'browse-startup-error.log' \) -print -exec tail -n 60 {} \; 2>/dev/null || true
|
|
cat "$E2E_HOME/.codex/skills/gstack/.source-path" 2>/dev/null || true
|
|
exit 1
|
|
fi
|
|
echo "$OUT" | grep -q 'gstack-windows-chain-ok' || (echo "chain output lacks the page text: the flow did not run" && exit 1)
|
|
# Empty piped input is a usage error, never a silent exit 0.
|
|
set +e
|
|
EMPTY_OUT=$(printf '' | "$BROWSE" chain 2>&1)
|
|
EMPTY_CODE=$?
|
|
set -e
|
|
echo "$EMPTY_OUT"
|
|
test "$EMPTY_CODE" -eq 1 || (echo "empty chain exited $EMPTY_CODE, expected 1" && exit 1)
|
|
echo "$EMPTY_OUT" | grep -q 'no flow to run' || (echo "empty chain lacks the usage error" && exit 1)
|
|
shell: bash
|
|
|
|
- name: A forced CSO failure is fatal under GSTACK_STRICT_BUILD=1 (#3071)
|
|
run: |
|
|
set -uo pipefail
|
|
rm -f browse/dist/.build-complete
|
|
set +e
|
|
GSTACK_SKIP_PLAYWRIGHT=1 GSTACK_STRICT_BUILD=1 GSTACK_CSO_BUILD_TESTING=1 GSTACK_CSO_BUILD_TEST_FAIL_AFTER=core bun run build > strict.log 2>&1
|
|
CODE=$?
|
|
set -e
|
|
tail -n 20 strict.log
|
|
test "$CODE" -ne 0 || (echo "strict build passed despite the injected CSO failure" && exit 1)
|
|
grep -q 'GSTACK_STRICT_BUILD=1 makes it fatal' strict.log || (echo "strict failure lacks its message" && exit 1)
|
|
shell: bash
|
|
|
|
- name: A forced CSO publish failure still completes setup (#3071)
|
|
run: |
|
|
set -euo pipefail
|
|
E2E_HOME="$RUNNER_TEMP/gstack-e2e-cso-fail"
|
|
mkdir -p "$E2E_HOME"
|
|
rm -f browse/dist/.build-complete
|
|
set +e
|
|
OUT=$(HOME="$E2E_HOME" USERPROFILE="$(cygpath -w "$E2E_HOME")" GSTACK_SKIP_PLAYWRIGHT=1 GSTACK_STRICT_BUILD=0 \
|
|
GSTACK_CSO_BUILD_TESTING=1 GSTACK_CSO_BUILD_TEST_FAIL_AFTER=publish-core ./setup --host codex 2>&1)
|
|
CODE=$?
|
|
set -e
|
|
echo "$OUT" | tail -n 40
|
|
test "$CODE" -eq 0 || (echo "setup exited $CODE after an optional CSO failure" && exit 1)
|
|
echo "$OUT" | grep -qE 'CSO publish step failed \(exit 86\).*previous CSO kept|CSO unavailable: the native helper.s publish step failed' || (echo "setup did not report the CSO publish failure" && exit 1)
|
|
grep -q '^result=failed' bin/.gstack-cso-build-result
|
|
grep -q '^stage=publish' bin/.gstack-cso-build-result
|
|
test -f browse/dist/.build-complete || (echo "the build stopped at CSO" && exit 1)
|
|
DOCTOR=$(HOME="$E2E_HOME" bash bin/gstack-doctor 2>&1 || true)
|
|
echo "$DOCTOR"
|
|
echo "$DOCTOR" | grep -qE '^warn +cso +' || (echo "doctor did not report the CSO failure" && exit 1)
|
|
shell: bash
|