Skip to content

fix: Windows build and ACL issues - #2452

Closed
chiragborse1 wants to merge 1 commit into
garrytan:mainfrom
chiragborse1:fix-windows-build-and-acl
Closed

chiragborse1 wants to merge 1 commit into
garrytan:mainfrom
chiragborse1:fix-windows-build-and-acl

Conversation

@chiragborse1

Copy link
Copy Markdown
Contributor

Fixes two Windows-specific issues that prevented gstack from working out-of-the-box:

  1. Build failure for browse/server-node.mjs

    • On Windows (MSYS/Git Bash), Bun cannot resolve MSYS-style /c/... absolute paths.
    • The build-node-server.sh script now converts the GSTACK_DIR to a Windows-style path via cygpath -m when running under MINGW/MSYS/CYGWIN.
  2. ACL lockout on .gstack directory

    • gstack's file-permissions.ts used bare username (chirag) for icacls grants.
    • When the hostname equals the username (e.g., host CHIRAG, user chirag), the bare name resolves to the machine SID instead of the user SID.
    • This left the real user without access to the .gstack directory, causing EPERM on reads/writes and the "Another instance is starting the server, waiting..." loop.
    • Changed to use the fully-qualified %USERDOMAIN%\%USERNAME% (with fallback to the SID via whoami /user) so the correct user gets access.

After applying these patches:

  • A fresh .gstack directory is created with the correct CHIRAG\chirag:(OI)(CI)(F) ACL.
  • The browse server starts successfully (tested with browse goto https://example.com → text extraction).
  • Both the Bun-compiled browse.exe and the Node.js compatibility bundle (server-node.mjs) are built and functional.

Tested on:

  • Windows 10 (MSYS2/Git Bash from git-bash)
  • Bun 1.3.14
  • Node 24.18.0

Fixes:

  • "FileNot able to build browse/server-node.mjs on Windows (FileNotFound opening root directory)"
  • Browse server fails with EPERM on .gstack directory due to mistaken ACL granting machine SID

Related to: #997 (the codesign note is unrelated, but same class of Windows-specific issues)

- browse/scripts/build-node-server.sh: convert MSYS paths to Windows-style via cygpath -m so Bun can compile server-node.mjs
- browse/src/file-permissions.ts: use %USERDOMAIN%\%USERNAME% (fallback to SID) instead of bare username to avoid granting machine SID when hostname equals username

Fixes:
  * 'FileNot able to build browse/server-node.mjs on Windows (FileNotFound opening root directory)
  Browse server fails with EPERM on .gstack directory due to mistaken ACL granting machine SID
@trunk-io

trunk-io Bot commented Aug 4, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@garrytan

Copy link
Copy Markdown
Owner

Thank you — this was absorbed on main (credited in the v1.6x CHANGELOG entries; roster in PR #2604). Closing.

@garrytan garrytan closed this Aug 17, 2026
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