Visual Studio Code, rebuilt in Rust
Rust
docs(ledger): plan milestone 24, the Windows build
rokartur9fbca634fa13
diff --git a/port/ledger.md b/port/ledger.mdindex 266b27e6447..4a2022686c0 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -39,7 +39,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| Milestones | M21 uplift to VS Code 1.148.0 | later | Postponed by Artur. Starts after milestones 11 to 20 close on 1.147.0 and after milestone 22; until then every reference, baseline and ui-pair stays on 1.147.0. Plan: `port/plans/uplift-1.147.0-to-1.148.0.md`, short form in `port/notes.md` "VS Code 1.148.0" (`bun port/tools/uplift-diff.ts 1.148.0`, every change triaged; refreshed against the ledger with 17 rows still open). Of about 209,000 changed upstream lines, 6,548 are ported: about 3,500 Rust work, 1,977 lines of grammar data and colorize fixtures, about 770 that arrive with upstream or the reference's extensions, and 308 of the floating comment style, a gap older than the uplift. 100,284 lines are skipped: AI, chat, sessions, agent host, remote, GitHub sign-in, experiments, telemetry and the integrated browser. Every setup step and work item is an `M21 uplift` row below, with its check. Steps: 1) session 1 does the setup rows and milestones 7 to 11. 2) Session 2 does milestones 12 and 14: files, workspace, the remove-folder vetoes and SCM. 3) Session 3 does milestones 13 and 15 to 19. Sessions 2 and 3 can run in parallel after session 1. | The ledger names 1.148.0. Every row the diff touches is `verified`, `removed` or `n/a` again, or keeps its 1.147.0 status where the gap is older than the uplift (the floating comment style). The full check passes against the 1.148.0 reference. || Milestones | M22 split the port from the VS Code tree | done | Artur: `main` holds the Rust port only (`native/`, `port/`, the port's skills, README and licenses) and upstream VS Code is `upstream/` (ignored), checked out detached at the followed tag, never edited; an uplift moves it with `git -C upstream checkout <tag>`. Every build step and tool reads upstream from `upstream/` or the path in `VSCODE_SRC`. Decision (Artur): `main` kept its history: a fast-forward by the port's branch plus one commit that removes the VS Code tree; no orphan commit, no `git filter-repo`, no force-push. Port version: the followed VS Code version is `package.json`'s `version` in `VSCODE_SRC`, which `uplift-diff.ts` reads as its default `from` and package-app as its default `VERSION`; `VERSION` in main.rs (the API version extensions see) repeats it. | Steps 1 and 2 (branch `port-m22-split`): `VSCODE_SRC` resolved by `native/vscode_src.rs` (build scripts of app, diff, files; `env!("VSCODE_SRC")`), `port/tools/vscode-src.sh` and `port/tools/vscode-src.ts`; the dev app root is `VSCODE_SRC` (runtime env over the build's value), the host bundle stays in the checkout's `out-exthost/`; the upstream edits are `port/patches/src-*.patch` (build-exthost, on a copy in `out-exthost/build`) and `extensions-*.patch` (package-app), `port/product.json` is the overlay. Step 3 (branch `port-release`): one commit `git rm`s the VS Code tree (21458 files); `ThirdPartyNotices.txt` ships from `VSCODE_SRC`, `LICENSE.txt` from the repo root; `exthost`'s `proposed_api.rs`, `run-app-check`'s extensions default and the dev host's AMD modules (`build-exthost` links `node_modules` beside `out-exthost` to `VSCODE_SRC`'s) read `VSCODE_SRC`; a Studio mirror of a tree without `src/` links `upstream` to `~/Developer/vscode-ref` (`port/tools/studio`). Step 4: a clean clone builds, tests, packages and passes the full check (the README's Build section at 96b0e476067). `git ls-tree main` holds no upstream file. || Milestones | M23 Linux build | in progress | Branch `port-linux` (a Linux build container on the Studio). The app is macOS-only today: 24 files of `native/crates` call AppKit, Foundation, WebKit, Security or Core Foundation directly (objc2, core-foundation, security-framework); GPUI (`native/vendor/wu`) already has its Linux platform (Wayland and X11). Every macOS call goes behind `cfg(target_os = "macos")` with the Linux counterpart VS Code uses there, in the same function where the two are a few lines, in a `platform/linux.rs` beside a `platform/macos.rs` where they are not: webview (WebKitGTK through wry), file dialogs (xdg-desktop-portal, rfd), the application menu (drawn in the window: `window.titleBarStyle`, `window.menuBarVisibility`), clipboard and the find pasteboard (GPUI's), proxy (`http.proxy` and the system proxy via reqwest instead of NSURLSession), secrets (Secret Service, keyring), `code` CLI install (`~/.local/bin`), file watching (inotify, notify), the updater (a download link, as `update.mode` on a tar.gz), and the settings import paths (`~/.config/Code`, `~/.config/Cursor`, `~/.config/VSCodium`). Packaging: `port/tools/package-linux` writes `VSRustium-<version>-linux-<arch>.tar.gz` and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (port/notes.md milestone 23); deb and AppImage after it. Builds in a Linux container on the Studio (`docker`, linux/arm64) for the build and the unit tests; linux-x64 on a GitHub Actions `ubuntu` runner once arm64 is green. | `cargo build --release -p app` and the area tests pass on Linux arm64 and x64; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview under Xvfb or Wayland in the container; `v1.147.0-insider` carries `VSRustium-1.147.0-insider-linux-arm64.tar.gz` and `VSRustium-1.147.0-insider-linux-x64.tar.gz`; the macOS build is unchanged (its area tests and api-tests as before). |-| Milestones | M24 Windows build | later | After milestone 23, on the same seams: WebView2 (wry), the Win32 file dialogs, the in-window menu bar and custom title bar, Credential Manager (keyring), the user-setup install path and `code` on PATH, `%APPDATA%\Code` settings import, ConPTY for the terminal (alacritty_terminal has it), an x64 and arm64 zip and a user installer, no Authenticode signing (the Windows signing decision). Builds on a GitHub Actions `windows` runner. | As milestone 23, for win32-x64 and win32-arm64. |+| Milestones | M24 Windows build | in progress | Branch `worktree-m24-windows`, beside milestone 23 on the same seams: macOS and Linux code stays as it is, each Windows counterpart sits behind `cfg(target_os = "windows")` in the function where it is a few lines, in a `windows.rs` beside `macos.rs` and `linux.rs` where it is not. Scope: WebView2, the Win32 file dialogs and message boxes, the in-window menu bar and custom title bar, Credential Manager (keyring), named pipes for the extension host and single instance, ConPTY for the terminal (alacritty_terminal 0.25 has it), drive-letter paths and file URIs, the user-setup install path with `bin` on the user PATH (code.iss `addtopath`), `%APPDATA%\Code` settings import, an x64 and arm64 zip and a user installer, no Authenticode signing (the Windows signing decision). Cross build on the Studio (cargo-xwin, `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc`) for compile checks and host-run unit tests; real runs on GitHub Actions `windows` runners (`.github/workflows/windows.yml`, by hand). Seams: the "M24 Windows" rows. | `cargo build --release -p app` and the area tests pass on win32-x64 and win32-arm64 runners; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview on the runner; `v1.147.0-insider` carries `VSRustium-win32-x64-1.147.0-insider.zip`, `VSRustium-win32-arm64-1.147.0-insider.zip` and both user setups; the macOS and Linux builds are unchanged (their area tests as before). || Milestones | M25 virtual workspaces | later | Artur: its own milestone after M20, not part of the gap audits. A folder of a non-file scheme (`.code-workspace` `uri` folders, `--folder-uri`, `vscode.openFolder` with an extension file system provider scheme) kept as a URI; every reader of workspace folders (173 `.folders` uses in 70 files: explorer, search, quick open, terminal cwd, tasks, git, watcher, settings layers, trust) goes through the file system providers; the workspace marked virtual, `virtualWorkspaces: false` extensions disabled with the `notSupportedInWorkspace` message (config/workspace.rs:101, port/notes.md provider entries deferred until virtual workspaces). | not started || M23 Linux | app/src/webview/linux.rs:66 | done | [linux L] webviews through WebKitGTK: webview panels and views, editor insets, notebook outputs, extension details, release notes. | `FIXTURE=webview-tests port/tools/linux/smoke` on X11 (Xvfb): 10/10 ok; `cargo gc test -p app webview` on Linux: 19 passed || M23 Linux | app/src/webview/linux.rs:47 | open | [linux L] webviews in a Wayland session. Linux shows now: no webview under Wayland: GPUI has no X window there to hold the GTK window, so `supported()` is false and each webview surface stays empty. Needs a route that does not embed: GTK opens its own Wayland connection, and a `wl_subsurface` cannot take a surface of another client, so the reparenting X11 uses has no Wayland form; WPE WebKit rendering offscreen into a GPUI texture, with input forwarded, is the route left (not started). | |@@ -63,6 +63,39 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| M23 Linux | app/src/workbench/menubar.rs:173 | open | [linux M] menu bar in the custom title bar. Linux shows now: no menu bar; gpui_linux `set_menus` keeps the menus and draws none. | || M23 Linux | .github/workflows/linux.yml:1 | done | [linux S] move actions/checkout, actions/setup-node and actions/upload-artifact from v4 to their Node 24 majors (pinned by SHA). | checkout v7.0.1, setup-node v7.1.0, upload-artifact v7.0.2 by SHA; the workflow not run yet || M23 Linux | port/tools/package-linux:1 | done | [linux M] Linux builds of the host's native modules (@vscode/spdlog, kerberos): package-linux rebuilds them with node-gyp; a dev run in the Studio container still loads the reference's macOS builds (its pnpm install ran on macOS), a Linux install of upstream builds them for Linux. | the extracted `VSRustium-1.147.0-linux-arm64.tar.gz` writes `logs/<session>/window1/exthost/exthost.log` (spdlog) and passes `port/tools/linux/smoke` |+| M24 Windows | port/tools/windows-build:1 | open | [windows M] cross build on the Studio: `cargo gc xwin` with Homebrew llvm and lld on PATH, for `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc`; the Unix-only std and libc calls (files/src/disk.rs:58, exthost/src/lib.rs:31, app/src/cli.rs:7, app/src/launch.rs:5, app/src/shell_env.rs:5, app/src/update/install.rs:39) behind `cfg(unix)` with a Windows counterpart or an M24 row naming what Windows shows meanwhile. | `port/tools/windows-build 'cargo gc xwin build -p app --target x86_64-pc-windows-msvc'` and the same for `aarch64-pc-windows-msvc` exit 0 |+| M24 Windows | app/src/terminal/pty.rs:1 | open | [windows L] terminal through ConPTY, as node-pty's conpty.cc and windowsPtyAgent.ts: spawn with the command line `argsToCommandLine` builds, resize, kill (signals ignored, as node-pty on Windows), `hasChildProcesses` and the foreground process (windowsShellHelper.ts, a process snapshot), cwd as the initial cwd (terminalProcess.ts `getCwd` on Windows). alacritty_terminal 0.25 `tty::windows` holds the ConPTY calls. | `cargo gc test -p app pty` on the windows runner; `args_to_command_line` with windowsPtyAgent.test.ts's cases on the host |+| M24 Windows | app/src/terminal/profiles.rs:133 | open | [windows M] Windows terminal profiles (terminalProfiles.ts `detectAvailableWindowsProfiles`): PowerShell (pwsh, then Windows PowerShell), Command Prompt, Git Bash, WSL distributions; `terminal.integrated.defaultProfile.windows`; shell integration for pwsh (shellIntegration.ps1). | `cargo gc test -p app terminal::profiles` on the windows runner |+| M24 Windows | app/src/file_dialog.rs:9 | open | [windows M] Win32 open and save dialogs (IFileOpenDialog, IFileSaveDialog) with title, filters, default path, folder pick and multi-select, as Chromium's select_file_dialog_win.cc gets them from Electron's file_dialog_win.cc (filter specs `*.ts;*.js`, `All Files (*.*)`). | `cargo gc test -p app file_dialog` on the host for the filter specs; the dialog not run on a desktop |+| M24 Windows | app/src/dialog.rs:5 | open | [windows M] native message box through TaskDialogIndirect, as Electron's message_box_win.cc: buttons in the order dialogs.ts `massageMessageBoxOptions` gives Windows, the checkbox as the verification text, owner window modal. | `cargo gc test -p app dialog` on the host for the button order; the dialog on the windows runner |+| M24 Windows | app/src/webview.rs:11 | open | [windows L] webviews through WebView2 as child windows of GPUI's HWND, with the host page, resource scheme and message bridge `webview.rs` shares with macOS and Linux: panels and views, editor insets, notebook outputs, extension details, release notes. The WebView2 runtime ships with Windows 10 and 11. | `FIXTURE=webview-tests` smoke on the windows runner; `cargo gc test -p app webview` there |+| M24 Windows | exthost/src/lib.rs:31 | open | [windows L] extension host connection over a named pipe (`\\.\pipe\vscode-ipc-<uuid>-sock`, ipc.net.ts `createRandomIPCHandle` on Windows) instead of a Unix socket; Bun's `net.connect` takes the pipe path. | `cargo gc test -p exthost` on the windows runner: the handshake test |+| M24 Windows | app/src/launch.rs:5 | open | [windows M] single instance and second-instance arguments over a named pipe (main.ts `mainIPCHandle` on Windows). | `cargo gc test -p app launch` on the windows runner |+| M24 Windows | app/src/cli.rs:7 | open | [windows M] the command line on Windows: `bin\<applicationName>.cmd` from resources/win32/bin/code.cmd, stdin read and terminal width through the console API. | `cargo gc test -p app cli` on the windows runner |+| M24 Windows | exthost/src/main_thread_secret_state.rs:19 | open | [windows S] secrets in Credential Manager (keyring), with keytar's target name `<service>/<account>` so VS Code's stored secrets keep their keys. | `cargo gc test -p exthost secret` on the windows runner |+| M24 Windows | exthost/src/request.rs:9 | open | [windows M] extension and gallery HTTP with the system proxy (WinHTTP's IE proxy settings, Chromium's ProxyConfigServiceWin), `http.proxy` and the `<local>` bypass. | `cargo gc test -p exthost request` on the windows runner |+| M24 Windows | app/src/workbench/menubar.rs:173 | open | [windows L] menu bar in the custom title bar (menubarControl.ts `CustomMenubarControl`, `window.titleBarStyle: custom`, `window.menuBarVisibility`) and the window controls (minimize, maximize, close) titlebarPart.ts draws on Windows. Shared with the M23 Linux menubar row. Windows shows now: no menu bar. | `cargo gc test -p app menubar` on the host; a ui-pair against the reference not possible (macOS reference) |+| M24 Windows | app/src/keybindings.rs:86 | open | [windows L] Windows keybindings: `default-win` table, the `win` key of extension and user rules, Windows labels (keybindingLabels.ts for `OperatingSystem.Windows`: `Ctrl+Shift+P`, `Windows`, `win`), and windowsKeyboardMapper.ts for layouts. Shared mechanism with the M23 Linux keybindings row. Windows shows now: the macOS table on GPUI's platform modifier (Ctrl). | `cargo gc test -p app keybindings` on the host with the Windows table |+| M24 Windows | app/src/keyboard_layout.rs:7 | open | [windows M] keyboard layout info and raw mapping (native-keymap's Windows `GetKeyboardLayout`, `MapVirtualKeyEx`, `ToUnicodeEx`). | `cargo gc test -p app keyboard` on the windows runner |+| M24 Windows | app/src/clipboard.rs:91 | open | [windows M] clipboard file lists, HTML and custom formats (Chromium's registered clipboard formats); GPUI's Windows clipboard has text and images. Windows shows now: text only. | `cargo gc test -p app clipboard` on the windows runner |+| M24 Windows | files/src/disk.rs:58 | open | [windows M] file system on NTFS: read-only through `FILE_ATTRIBUTE_READONLY`, file and directory symlinks, case-insensitive path compare, Recycle Bin (trash crate), ReadDirectoryChangesW (notify). | `cargo gc test -p files` on the windows runner |+| M24 Windows | app/src/editor_history.rs:59 | open | [windows L] drive-letter paths and file URIs (`file:///c%3A/...`, uri.ts `fsPath` on Windows, backslash separators in labels): the per-file `file_uri` helpers go through one conversion. | `cargo gc test -p app uri` on the host for the conversion; api-tests on the windows runner |+| M24 Windows | app/src/settings_import.rs:28 | open | [windows S] settings import from `%APPDATA%\Code`, `%APPDATA%\Cursor`, `%APPDATA%\VSCodium`, extensions from `%USERPROFILE%\.vscode\extensions` and the others. | `cargo gc test -p app settings_import` on the windows runner |+| M24 Windows | app/src/workbench/shell_command.rs:70 | open | [windows S] no Shell Command on Windows (upstream has it on macOS only): the user setup puts `{app}\bin` on the user PATH (code.iss `addtopath`), the zip leaves PATH alone. | the commands absent from the palette on the windows runner; the installer row's check |+| M24 Windows | app/src/update/install.rs:21 | open | [windows M] updates as a download link, as on Linux, until the user setup can update in place (updateService.win32.ts runs the setup with `/verysilent /update`). | `cargo gc test -p app update::` on the host |+| M24 Windows | app/src/shell_env.rs:5 | open | [windows S] no shell environment resolution on Windows (shellEnv.ts returns the process environment on win32). | `cargo gc test -p app shell_env` on the windows runner |+| M24 Windows | app/src/system_wide_keybindings.rs:13 | open | [windows S] system-wide keybindings through `RegisterHotKey` (Chromium's GlobalAcceleratorListenerWin). | `cargo gc test -p app system_wide` on the windows runner |+| M24 Windows | app/src/power.rs:9 | open | [windows M] powerMonitor: idle time (`GetLastInputInfo`), battery (`GetSystemPowerStatus`), lock, sleep and resume, power save blockers (`SetThreadExecutionState`). | `cargo gc test -p app power::` on the windows runner |+| M24 Windows | app/src/accessibility_signals.rs:107 | open | [windows S] accessibility signal sounds (mp3) through the Windows media player API. | not run with audio on the runner |+| M24 Windows | app/src/metered_connection.rs:57 | open | [windows S] metered connection (`INetworkCostManager`). | not run on a desktop |+| M24 Windows | app/src/workbench/accessibility.rs:531 | open | [windows S] screen reader, reduced motion and high contrast (`SystemParametersInfo` `SPI_GETSCREENREADER`, `SPI_GETCLIENTAREAANIMATION`, `SPI_GETHIGHCONTRAST`). | not run with a screen reader |+| M24 Windows | app/src/diagnostics.rs:308 | open | [windows S] machine info (CPU name, memory, OS release) and the network interfaces of the machine id. | `cargo gc test -p app diagnostics` on the windows runner |+| M24 Windows | app/src/workbench/process_explorer.rs:295 | open | [windows M] process explorer and kill (@vscode/windows-process-tree's snapshot, `TerminateProcess`). | `cargo gc test -p app process_explorer` on the windows runner |+| M24 Windows | app/src/policy.rs:9 | open | [windows M] policies from the registry (`HKLM` and `HKCU` `Software\Policies\<win32RegValueName>`, @vscode/policy-watcher). | `cargo gc test -p app policy` on the windows runner |+| M24 Windows | app/src/app_icon.rs:27 | open | [windows S] the executable icon and version resource (resources/win32/code.ico, build.rs). | the icon in Explorer on the runner's screenshot |+| M24 Windows | port/tools/package-windows:1 | open | [windows M] `VSRustium-win32-<arch>-<version>.zip` as VS Code's Windows archive lays it out (`<applicationName>.exe`, `bin\<applicationName>.cmd`, `resources\app`, bun.exe), the host's native modules built for Windows, `win32-<arch>-archive.json` feed entries. | the extracted zip passes the smoke on the windows runner |+| M24 Windows | port/tools/windows/code.iss:1 | open | [windows M] user setup (`{userpf}\<dirName>`, `addtopath`, Start menu entry, file associations as code.iss) built with Inno Setup on the runner; unsigned (the Windows signing decision). | the setup installs silently, `<applicationName> --version` runs from a new shell's PATH, uninstall removes it |+| M24 Windows | .github/workflows/windows.yml:1 | open | [windows S] x64 on `windows-latest`, arm64 on `windows-11-arm`, by hand (`workflow_dispatch`), uploading the zips, setups and feed entries. | one dispatched run green for both architectures || M21 uplift | setup: reference | later | On the Studio: check out `1.148.0` in `~/Developer/vscode-ref`, run `npm ci`, compile it and its extensions (port/notes.md "Reference"), then run `port/tools/fetch-builtin-extensions` again. | `~/Developer/vscode-ref/package.json` names 1.148.0 and `port/tools/ref-screenshot` draws it || M21 uplift | setup: upstream checkout | later | `git -C upstream fetch origin tag 1.148.0 --no-tags`, then `git -C upstream checkout 1.148.0` (1.148.0 is not a descendant of 1.147.0: each release is its own branch). 1.148.0 does not change the files that the 9 `port/patches/*.patch` and the `product.json` overlay touch. Rebuild the extension host. | `git -C upstream apply --check port/patches/*.patch`; `port/tools/build-exthost` || M21 uplift | setup: proxy ids | later | 1.148.0 appends `MainThreadRemoteAgentHosts` to `MainContext`, so every `ExtHostContext` id after it moves by one: rerun `bun port/tools/gen-proxy-ids.ts`. The port answers the new proxy as inert, the same as the other removed agent proxies. | `cargo test -p exthost`; exthost-probe 30/30 on Bun and Node |diff --git a/port/notes.md b/port/notes.mdindex 96e1989363b..ed31af09d2b 100644--- a/port/notes.md+++ b/port/notes.md@@ -1007,6 +1007,11 @@ What to do (milestone 21, in order):- System-wide keybindings (`system_wide_keybindings/linux.rs`) follow Chromium 150's listeners, Electron 43's: in GPUI's X11 session X11 key grabs (Ctrl+Alt+F<n> stays with XKB's VT switch), in its Wayland session the xdg-desktop-portal GlobalShortcuts session `GlobalAcceleratorListenerLinux` keeps. A registration there always succeeds; each changed set closes the session, lists the stored shortcuts and binds them with the set when one is missing, with Electron's description (`<nameShort> shortcut: <accelerator>`) and the `preferred_trigger` Electron's `GlobalShortcutsPortalPreferredTrigger` turns on. Differences: the shortcut id is the accelerator (Chromium hashes a per-profile UUID into it), no parent window is passed (Electron passes none either), and an Activated signal is matched by id, not by session path (ashpd keeps the path private). Tested against a fake portal on a private bus (`portal_binds_the_accelerators_and_reports_activations`); not run against GNOME's or KDE's portal.- Message boxes (`dialog/linux.rs`) follow Electron 43's message_box_gtk.cc in GPUI's X11 session: a GTK message dialog with GTK's stock Cancel, No, Ok and Yes labels and a check button for `checkboxLabel`, transient for the GPUI window and modal, its buttons in the order dialogs.ts `massageMessageBoxOptions` gives Linux (cancel second, then reversed, the primary last and default). Difference: Electron also disables the parent window (`SetEnabled(false)`); GPUI has no such switch, so the GPUI window still takes input behind the dialog. In a Wayland session, where `webview::supported` has no GTK, the custom workbench dialog shows instead. Tests: `cargo gc test -p app dialog::linux` under Xvfb.+## Milestone 24: Windows build (branch worktree-m24-windows)++- Layout: as milestone 23, with `cfg(target_os = "windows")` beside the macOS and Linux code and a `windows.rs` beside `macos.rs` and `linux.rs` where the split is large; Windows gaps are the "M24 Windows" rows of the Work table in port/ledger.md, sized `[windows S|M|L]`.+- Cross build: the Studio has the `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc` Rust targets, cargo-xwin (it downloads the MSVC CRT and Windows SDK headers on first use) and Homebrew `llvm` and `lld` (clang-cl, lld-link). It checks that the Windows build compiles; tests that need Windows run on the `windows.yml` runners.+## Accepted platform differencesGPUI or Rust std limits Artur accepted as differences from 1.147.0; one line each.