Skip to content

Feat/windows support - #49

Open
jonathansampson wants to merge 8 commits into
brave-experiments:mainfrom
jonathansampson:feat/windows-support
Open

jonathansampson wants to merge 8 commits into
brave-experiments:mainfrom
jonathansampson:feat/windows-support

Conversation

@jonathansampson

Copy link
Copy Markdown

Summary

Adds Windows 10 and 11 support. The app now builds, runs and packages on Windows, and the file helper applies the same safety rules there.

  • File helper: The OS-specific code now lives in unix.rs (unchanged behavior) and a new windows.rs. On Windows, each file is opened one folder at a time, starting from a folder that is already open, using NtCreateFile. A project can be on a drive or a network share.
    • It refuses symlinks, junctions, mount points, device paths, and names containing :, which would open a separate data stream.
    • Other special files, such as cloud placeholders, are allowed only if a second open reaches the same file.
    • New private files get an access list that names only the current account. On a network share they get the share's usual permissions instead, because the server may not know the account.
  • App state: Node ignores mode: 0o600 on Windows, so drafts and memory history are written through the helper there.
  • Paths: Projects open by drive path (C:\...) or share path (\\server\share\...). Relative paths use / across IPC, and on Windows a \ or : in them is refused.
  • Build: build-bridge.sh is replaced by build-bridge.mjs, so building no longer needs a Unix shell. On Windows the app looks for its helper binaries with .exe. npm run package makes dist\Brave Bot-win32-<arch>\ (unsigned, no installer). Both crates embed an asInvoker manifest in MSVC builds, so Windows doesn't block binaries whose names contain words like setup or patch.
  • CI: A new Windows job runs Clippy and cargo test --all.
  • Docs: The setup, development, testing and file-access docs now cover Windows.

Known limitations

Projects on a network share only. These don't affect projects on a local drive. They apply when a project is stored on a network share, whether it's opened through a mapped drive letter or a \\server\share path.

  • Batch files start in C:\Windows (upstream). The agent turns a network project's path into a UNC path, and cmd.exe can't use a UNC path as its working folder. So cmd and batch files the agent runs, such as npm.cmd, start in C:\Windows. Programs it runs directly, like node or git, start in the project folder as expected. The fix belongs in the agent.
  • Link checks are weaker over SMB. The server looks up each name again, so a folder swapped for a junction in the middle of an operation is followed. Links that are already in place are still refused. SMB mounts on macOS and Linux behave the same way.

Tests. The helper's tests make symlinks, which needs Developer Mode or an admin shell. Without either, they fail instead of skipping. The network-share test runs only when asked: cargo test -p bravebot-ui-files -- --ignored.

A separate change will move absolute-path parsing out of shared and renderer code.

Test plan

  • Windows: cargo test -p bravebot-ui-files -- --include-ignored, plus Clippy for that crate
  • Node tests (scripts/*.test.mjs) and tsc --noEmit
  • CI passes (typecheck, Linux, Windows)
  • Windows: cargo test --all
  • Windows: npm run dev, then open a C:\ project, preview and attach a file, and save a draft
  • Windows: npm run package, then npm run drive:smoke -- "dist\Brave Bot-win32-x64\Brave Bot.exe"
  • No regressions on macOS or Linux

@jonathansampson

Copy link
Copy Markdown
Author

Tested end to end with a task: create a simple Tetris game.

image

Windows renders the built-in Administrator's SID as the alias LA, and the
GitHub Windows runner runs as that account, so comparing a file's rendered
access list against the raw SID failed only in CI. Render the expected list
through the same conversion so both sides use the same aliases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant