Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(linux): package an AppImage beside the archive (#13)

DeBondorc477ede49d9f
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index e3bad3ca4eb..a3c3154a51f 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -22,12 +22,13 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: System packages
- # port/tools/linux/Dockerfile's list, with libkrb5-dev and libxkbfile-dev for VS Code's native modules.
+ # port/tools/linux/Dockerfile's list, with libkrb5-dev and libxkbfile-dev for VS Code's native modules;
+ # squashfs-tools for the AppImage.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends pkg-config clang \
libasound2-dev libfontconfig-dev libfreetype-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev \
- libssl-dev libzstd-dev libdbus-1-dev libwebkit2gtk-4.1-dev libsecret-1-dev libkrb5-dev libxkbfile-dev file
+ libssl-dev libzstd-dev libdbus-1-dev libwebkit2gtk-4.1-dev libsecret-1-dev libkrb5-dev libxkbfile-dev file squashfs-tools
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
@@ -58,5 +59,6 @@ jobs:
name: linux-x64
path: |
native/target/VSRustium-*-linux-x64.tar.gz
+ native/target/VSRustium-*-linux-x64.AppImage
native/target/linux-x64*.json
if-no-files-found: error
diff --git a/README.md b/README.md
index adbbd349099..fe31fe9e234 100644
--- a/README.md
+++ b/README.md
@@ -97,7 +97,7 @@ Counted from the agent session logs, each call once; cost at OpenRouter list pri
[Releases](https://github.com/rokartur/vsrustium/releases):
- macOS: `darwin-arm64` for Apple silicon, `darwin-x64` for Intel. Signed, notarized, updates itself.
-- Linux: `linux-x64` and `linux-arm64` archives (`.tar.gz`, glibc 2.39 or newer: Ubuntu 24.04, Debian 13). A preview: webviews in X11 sessions only (WebKitGTK 4.1), no self-update, the rest in the "M23 Linux" rows of [port/ledger.md](port/ledger.md).
+- Linux: `linux-x64` and `linux-arm64` archives (`.tar.gz`) and AppImages (`.AppImage`), glibc 2.39 or newer: Ubuntu 24.04, Debian 13. A preview: webviews in X11 sessions only (WebKitGTK 4.1), no self-update, the rest in the "M23 Linux" rows of [port/ledger.md](port/ledger.md).
## Build
diff --git a/port/ledger.md b/port/ledger.md
index 3874c13adec..ac67f7381a7 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -41,7 +41,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,
| Milestones | M20 multi-instance code editor | done | Upstream every diff side, multi diff file side, notebook cell and walkthrough snippet is its own CodeEditorWidget. The port keeps one focused code editor per group bound to `text_area`, `editor_focus`, the input handler and `editors.active()`, as upstream's one focused widget takes the keys; every other code editor of the group keeps its own viewport, text area cells, minimap layout and find widget (code_editors.rs `parked`, `finds`) and draws through `text_area` as an inactive group's editor, with its own hover, color decorators, bracket guides and overview ruler; a press focuses it, a wheel scrolls it. Through it: the diff editor's original side (focus, selection, find), the multi diff file sides (the modified side takes typing and undo, its diff follows), notebook cells and playground snippets. | `cargo test -p app -- a_file_side_is_a_code_editor every_drawn_file_side the_original_side_takes_the_focus_selection_and_find each_group_keeps_its_own_find_widget the_focused_cell_is_the_code_editor unfocused_cell unfocused_snippet the_host_sees_the_code_editors_of_the_rendered_cells part_view::`: 17 passed; port/notes.md milestone 20, Multi-instance code editor |
| Milestones | M21 uplift to VS Code 1.148.0 | in progress | Postponed by Artur, started 2026-12-01 (session 1). 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 | 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`, the same folder as `VSRustium-<version>-linux-<arch>.AppImage` (`port/tools/linux/appimage`) and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (port/notes.md milestone 23); deb 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 | 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 |
diff --git a/port/notes.md b/port/notes.md
index dd912d97189..3f98fc9561c 100644
--- a/port/notes.md
+++ b/port/notes.md
@@ -808,7 +808,7 @@ Scope as in the M19 Work row of port/ledger.md.
- Update feed (`update.rs`): product.json `updateUrl` is the GitHub releases URL of rokartur/vsrustium. A release channel's feed is one static JSON file in upstream's `IUpdate` shape (the answer of update.code.visualstudio.com's `/api/update/<platform>/<quality>/<commit>`), one per platform the app is built for, VS Code's target platform names `darwin-arm64` and `darwin-x64` (`exthost::gallery::CURRENT_TARGET_PLATFORM`, from `cfg!(target_arch)`):
`{"version": "<commit>", "productVersion": "1.148.0", "timestamp": <ms since epoch>, "url": "<zip URL>", "sha256hash": "<hex SHA-256 of the zip>", "prerelease": false}`.
Channels (port addition: setting `update.releaseChannel`, `latest` or `pre-release`, default `latest`; upstream's channel is the build's `quality`): `latest` reads `<updateUrl>/latest/download/<platform>.json`, which GitHub serves from the newest release not marked pre-release; `pre-release` reads `<updateUrl>/download/pre-release/<platform>-prerelease.json` (the arm64 names are the ones the first published build, v1.147.0-insider, reads), from a release tagged `pre-release` whose asset each publish replaces (GitHub has no "latest including pre-releases" URL). The entry is an update when its `productVersion` is a higher semantic version than the running product.json `version`, or the same version with a later `timestamp` than product.json `date` (`version`, the commit, decides nothing: builds of one commit can differ in version); a lower version never is, so switching to `latest` on a pre-release newer than the latest stable keeps it until a newer stable comes. A build without `commit` and `date` (written by package-app) has updates disabled, as upstream's without `commit`. 204, 401, 403 and 404 are no update. `url` resolves against the feed's URL and must be https (http only on 127.0.0.1 or localhost).
- Publishing a release (Artur, by hand): `port/tools/package-app` (VERSION, TAG default `v<version>`, PRERELEASE=1 for a pre-release, which is a VS Code Insiders build: product.json `quality: insider` and version `<VERSION>-insider`, as gulpfile.vscode.ts writes them; builds of one Insiders version are told apart by `date`) writes next to the app, for ARCH (`arm64` or `x64`, default the host's) `VSRustium-<version>-darwin-<arch>.zip` (`ditto -c -k --keepParent` of the signed app; `<version>` as product.json, e.g. `1.147.0-insider`), `darwin-<arch>-prerelease.json` and, unless PRERELEASE=1, `darwin-<arch>.json`; the feed `url` names the versioned zip. Run it once per arch (the x64 one after `cargo build --release -p app --target x86_64-apple-darwin`). Upload both zips and both `darwin-<arch>.json` to the release TAG (marked pre-release for a pre-release), and both `darwin-<arch>-prerelease.json` to the `pre-release` release, replacing its assets (a stable release goes there too, so pre-release users get it). A Linux build names its archive `VSRustium-<version>-linux-<arch>.tar.gz` the same way. Extensions see the API version (`VERSION` in main.rs, 1.147.0, with `-<quality>` on a non-stable build), not product.json `version`: on an Insiders build `vscode.version` is `1.147.0-insider` and `env.appQuality` `insider`, what extensions test for VS Code Insiders (copilot's completions `vscode.version.endsWith('-insider')`, tunnel-forwarding's `appQuality`, a `resolvers` proposal). `env.appName` stays `VSRustium` (branding (1) below); the one `appName.includes('Insiders')` check upstream is the Copilot extension's, which the port does not ship. `engines.vscode` checks use the same string; as extensionValidator.ts, `-insider` in a range or version decides nothing, only the numbers (`cargo test -p exthost insider_engines`; update-check installs the Open VSX VSIX of `[email protected]`, engines `^1.89.0-insider`, in P and activates it, and installs the pre-release of `rust-lang.rust-analyzer` from the gallery (`installPreReleaseVersion`, publisher trust answered) and activates it as one).
+ Publishing a release (Artur, by hand): `port/tools/package-app` (VERSION, TAG default `v<version>`, PRERELEASE=1 for a pre-release, which is a VS Code Insiders build: product.json `quality: insider` and version `<VERSION>-insider`, as gulpfile.vscode.ts writes them; builds of one Insiders version are told apart by `date`) writes next to the app, for ARCH (`arm64` or `x64`, default the host's) `VSRustium-<version>-darwin-<arch>.zip` (`ditto -c -k --keepParent` of the signed app; `<version>` as product.json, e.g. `1.147.0-insider`), `darwin-<arch>-prerelease.json` and, unless PRERELEASE=1, `darwin-<arch>.json`; the feed `url` names the versioned zip. Run it once per arch (the x64 one after `cargo build --release -p app --target x86_64-apple-darwin`). Upload both zips and both `darwin-<arch>.json` to the release TAG (marked pre-release for a pre-release), and both `darwin-<arch>-prerelease.json` to the `pre-release` release, replacing its assets (a stable release goes there too, so pre-release users get it). A Linux build names its archive `VSRustium-<version>-linux-<arch>.tar.gz` the same way, and its `VSRustium-<version>-linux-<arch>.AppImage`, uploaded beside the archive (no feed names it). Extensions see the API version (`VERSION` in main.rs, 1.147.0, with `-<quality>` on a non-stable build), not product.json `version`: on an Insiders build `vscode.version` is `1.147.0-insider` and `env.appQuality` `insider`, what extensions test for VS Code Insiders (copilot's completions `vscode.version.endsWith('-insider')`, tunnel-forwarding's `appQuality`, a `resolvers` proposal). `env.appName` stays `VSRustium` (branding (1) below); the one `appName.includes('Insiders')` check upstream is the Copilot extension's, which the port does not ship. `engines.vscode` checks use the same string; as extensionValidator.ts, `-insider` in a range or version decides nothing, only the numbers (`cargo test -p exthost insider_engines`; update-check installs the Open VSX VSIX of `[email protected]`, engines `^1.89.0-insider`, in P and activates it, and installs the pre-release of `rust-lang.rust-analyzer` from the gallery (`installPreReleaseVersion`, publisher trust answered) and activates it as one).
- Update service (`update.rs`, `update/install.rs`, updateService.darwin.ts with Squirrel.Mac's part): one per app, created with the first window; `update.mode` as upstream (`none` disables and drops a pending download, `manual`, `start` 30 s after startup, `default` also hourly). A check first refuses a bundle it cannot replace (App Translocation, a read-only volume, no write access) with Squirrel's message, then reads the feed; a newer build downloads at once with curl into `~/Library/Caches/com.rokartur.vsrustium.ShipIt/update` (progress from the file size and Content-Length), then is verified: the zip's SHA-256 against the feed, `ditto -x -k`, exactly one `.app`, `codesign --verify --deep --strict` against the installed app's designated requirement (Squirrel's check: an Apple-issued certificate, the Team ID and the bundle id) and the same `Identifier` and `TeamIdentifier`; an ad-hoc signed installed app verifies nothing. States: Uninitialized, Disabled, Idle, CheckingForUpdates, AvailableForDownload, Downloading, Downloaded, Ready, Restarting; an error goes back to Idle, with its message only for an explicit check (upstream). On a metered connection (`network.meteredConnection` or the OS's) an automatic check is skipped, and an update an automatic check found waits as AvailableForDownload; both resume once the connection is not metered (abstractUpdateService.ts). Not reached: Updating (Windows), Overwriting, Cancelling.
ShipIt (`vsrustium --apply-update <pid> <staged> <installed> [--relaunch <args>]`, logging to `ShipIt_stderr.log` in the ShipIt folder): Restart to Update quits every window (a veto puts Ready back) and the helper starts on app quit; a plain Quit while Ready installs too, without relaunch (Squirrel installs a downloaded update on quit). The helper waits for the app's pid to exit, verifies the staged bundle again, renames the installed app to `.VSRustium.app.old`, moves the update in (a ditto copy across volumes) or on any failure puts the old one back, relaunches the executable with the app's arguments, then deletes the old copy.
Workbench (`workbench/update.rs`, update.ts): the Manage menu's `7_update` items by `updateState` (Check for Updates..., Checking for Updates..., Download Update (1), Downloading Update..., Install Update... (1), Restart to Update (1)), the palette's Check for Updates... and Restart to Update, the Manage item's badge (1 with "New VSRustium update available.", a progress badge while checking or downloading, the description in its hover title, the profile badge hidden meanwhile), "There are currently no updates available." in the focused window after an explicit check. The title bar's update entry and its sticky tooltip (`workbench/update_title_bar.rs`, updateTitleBarEntry.ts and updateTooltip.ts, `update.titleBar`) sit before the right-side items of the main window's custom title bar; an explicit check's error shows in the tooltip, not as a notification. After an update to a new major or minor version (`releaseNotes/lastVersion` in application storage, `update.showReleaseNotes`), the release notes editor (`workbench/release_notes.rs`) shows the body of the GitHub release `v<version>` under `releaseNotesUrl` (the API's `/tags/v<version>`); when it cannot be fetched, the prompt "Welcome to VSRustium v{0}! Would you like to read the Release Notes?" opens `releaseNotesUrl`. Tests: `cargo test -p app update::`; end to end `port/tools/update-check` (port/tools/update-feed serves the packages laid out like GitHub releases; `?cut` cuts a download midway).
@@ -1003,7 +1003,7 @@ What to do (milestone 21, in order):
- Run: `port/tools/linux-build port/tools/linux/smoke` starts the release build under Xvfb (mesa lavapipe for Vulkan) on a git copy of port/fixtures/workspace and runs `port/fixtures/extensions/linux-smoke-tests`: git opens the repository, emmet activates, an edit saves to disk. The startup "eager extensions activated" line can miss vscode.git on the 2-CPU container, so the test activates it itself.
- Tests that read the platform: readdir order (APFS sorts, ext4 and overlayfs do not), the default shell's profile icon (`terminal` for zsh, `terminal-bash` for bash), GPUI's `super` for the platform key, and the settings import fixture's `.config` link to its `Library/Application Support`.
- Local history date labels use chrono's `%B %-d, %Y at %-I:%M %p` on both systems, the text V8's `Intl.DateTimeFormat('en')` prints (NSDateFormatter needed U+202F and `/` fixes); `date_labels_read_as_the_english_intl_format` checks it.
-- Package (`port/tools/package-linux`, the app files from `port/tools/app-files.ts`): `VSRustium-linux-<arch>/` as VS Code's Linux archive lays it out, the release binary named `applicationName` (debug info stripped: `debug = "limited"` stays in the ELF on Linux, 571 MB with it) beside bun, `bin/vsrustium` from upstream's `resources/linux/bin/code.sh`, `com.rokartur.vsrustium.desktop` from upstream's `resources/linux/code.desktop` (Exec is `vsrustium` on PATH, as an archive does not know where it is unpacked; `StartupWMClass` is `product.linuxDesktopName`, which the windows set as their X11 WM_CLASS and Wayland app id) with `vsrustium.png` (`port/AppIcon.png`, ictool's 512 px render of `port/AppIcon.icon`), the app files in `resources/app` (`product::BUNDLED_APP`, which the binary takes as its root when it is there). Native modules built for another system or arch are rebuilt with node-gyp from their source; a binding.gyp that builds nothing on Linux (@vscode/fs-copyfile) leaves the module out, any other foreign binary fails the package. It writes `VSRustium-<version>-linux-<arch>.tar.gz` and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (`gallery::CURRENT_TARGET_PLATFORM` is `linux-<arch>` on Linux, for the gallery and the update feed). arm64 1.147.0: folder 412 MB, archive 131 MB; the extracted archive passes `port/tools/linux/smoke` with `APP=<folder>/vsrustium` in a container without the reference mounted. linux-x64 builds on GitHub Actions (`.github/workflows/linux.yml`, run by hand, the README's build steps with upstream's pnpm install building the native modules for Linux). The binary needs the glibc it links: GLIBC_2.39 for both (Debian 13's container, the ubuntu-24.04 runner; ubuntu-latest, 26.04, asked for 2.43 and the x64 package did not start on Debian 13).
+- Package (`port/tools/package-linux`, the app files from `port/tools/app-files.ts`): `VSRustium-linux-<arch>/` as VS Code's Linux archive lays it out, the release binary named `applicationName` (debug info stripped: `debug = "limited"` stays in the ELF on Linux, 571 MB with it) beside bun, `bin/vsrustium` from upstream's `resources/linux/bin/code.sh`, `com.rokartur.vsrustium.desktop` from upstream's `resources/linux/code.desktop` (Exec is `vsrustium` on PATH, as an archive does not know where it is unpacked; `StartupWMClass` is `product.linuxDesktopName`, which the windows set as their X11 WM_CLASS and Wayland app id) with `vsrustium.png` (`port/AppIcon.png`, ictool's 512 px render of `port/AppIcon.icon`), the app files in `resources/app` (`product::BUNDLED_APP`, which the binary takes as its root when it is there). Native modules built for another system or arch are rebuilt with node-gyp from their source; a binding.gyp that builds nothing on Linux (@vscode/fs-copyfile) leaves the module out, any other foreign binary fails the package. It writes `VSRustium-<version>-linux-<arch>.tar.gz` and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (`gallery::CURRENT_TARGET_PLATFORM` is `linux-<arch>` on Linux, for the gallery and the update feed). arm64 1.147.0: folder 412 MB, archive 131 MB; the extracted archive passes `port/tools/linux/smoke` with `APP=<folder>/vsrustium` in a container without the reference mounted. linux-x64 builds on GitHub Actions (`.github/workflows/linux.yml`, run by hand, the README's build steps with upstream's pnpm install building the native modules for Linux). The binary needs the glibc it links: GLIBC_2.39 for both (Debian 13's container, the ubuntu-24.04 runner; ubuntu-latest, 26.04, asked for 2.43 and the x64 package did not start on Debian 13). The same folder is also `VSRustium-<version>-linux-<arch>.AppImage` (`port/tools/linux/appimage`, run by package-linux): the folder is the AppDir as it is (the desktop file and its icon at the top), `AppRun` a link to the binary added in the image only, in a zstd squashfs behind AppImage's static type 2 runtime (type2-runtime release 20251108, pinned by SHA-256), which needs `fusermount` or `fusermount3` and no libfuse. It bundles no library: the system libraries are the archive's (WebKitGTK 4.1, GTK 3, OpenSSL 3), so on Fedora 45, which has OpenSSL 4 only, neither starts without `libssl.so.3` (`openssl3-libs`). From the AppImage the app runs in the mount and counts as installed (its executable sits beside `resources/app`) and Download opens what the archive's build opens (`downloadUrl`, else the feed's archive); Shell Command: Install links `~/.local/bin/<applicationName>` to the mount's `bin/<applicationName>`, which goes away when the app quits (open gap). x64 1.148.0-insider: AppImage 115 MB (archive 137 MB), made in 3 s on 24 cores; on Fedora 45 with `openssl3-libs` it prints `--version` and, in a Wayland session, opens a folder with the binary and the extension host's bun running from the mount (`handshake done`), and the mount goes away when the app quits.
- Desktop services over D-Bus (zbus 5, the one gpui_linux's ashpd and oo7 build; blocking proxies on their own threads, each service optional): power (`power/linux.rs`) takes idle time from Mutter's IdleMonitor, else the ScreenSaver service's `GetSessionIdleTime`; the lock state from logind's session `LockedHint`; the power source from UPower's `OnBattery`; `prevent-display-sleep` is a ScreenSaver `Inhibit` cookie and `prevent-app-suspension` a logind `sleep` inhibitor fd; the events are logind's `PrepareForSleep` and `PrepareForShutdown`, as Electron has no lock, battery, thermal or speed limit events on Linux. A blocker the bus refuses still counts as started, as Electron's map of ids. Metered is NetworkManager's `Metered` (`YES` or `GUESS_YES`), the screen reader AT-SPI's `org.a11y.Status` `ScreenReaderEnabled`, reduced motion the portal's `org.gnome.desktop.interface` `enable-animations` (Chromium follows GTK's `gtk-enable-animations`). None of these ran against a desktop session yet: the container has no session or system bus.
- Secrets (`exthost/src/main_thread_secret_state.rs`) are Secret Service items of the default collection through oo7 (gpui_linux's version and features), with keytar's `service` and `account` attributes; the test runs the flow on oo7's file keyring.
- Webviews (`app/src/webview/linux.rs`, the host page and its answers shared with macOS in `webview.rs`) are WebKitGTK 4.1 views, each in an undecorated GTK popup window whose X window is reparented into GPUI's; a notebook's back layer webview sits in a clip window whose X input shape passes presses through to GPUI outside the outputs. GTK runs on GPUI's main thread, iterated every 8 ms (`pump_gtk`). Keyboard focus moves with `XSetInputFocus` (a reparented window gets none from the window manager); Cut, Copy and Paste run WebKitGTK's editing commands. WebKitGTK refuses a URI scheme handler on `https`, so each view's ephemeral context sets a loopback proxy as its https proxy: `CONNECT` to `*.vscode-webview.vscode-cdn.net` and `*.vscode-resource.vscode-cdn.net` is answered over TLS with a process-local self-signed certificate the context trusts for those hosts only (the host page's files, and resources as the macOS scheme handler reads them), every other host is tunneled. OpenSSL serves that TLS: GnuTLS, glib-networking's backend, refuses a resource host's SNI (`file+.vscode-resource...`, the `+` is no DNS character). The proxy answers only connections /proc/net/tcp shows as the app user's. WebKit (WebKitGTK 2.54, WKWebView on macOS 27) blocks every http load in the https host page as mixed content, loopback included, where Chromium lets loopback through (the Simple Browser's `http://localhost` dev servers), and has no per-host setting: both platforms register `http` as a secure scheme and add content rules (`HTTP_LOOPBACK_ONLY_RULES`) that block http except `localhost`, `*.localhost`, `127.*` and `[::1]`. Unlike Chromium, a network http image is blocked rather than upgraded to https. Wayland sessions show no webview (GPUI has no X window there; the open M23 row).
diff --git a/port/tools/linux/Dockerfile b/port/tools/linux/Dockerfile
index b5a7548f6a9..30060d34e21 100644
--- a/port/tools/linux/Dockerfile
+++ b/port/tools/linux/Dockerfile
@@ -1,6 +1,7 @@
# Linux build and test image for VSRustium (port/tools/linux-build runs it on the Mac Studio, linux/arm64).
# Packages: GPUI's Linux platform (wu script/linux: xkbcommon, wayland, x11/xcb, fontconfig, freetype, vulkan, alsa),
-# WebKitGTK 4.1 and libsecret for the webview and secrets, Xvfb and Mesa's Vulkan driver to run the app headless.
+# WebKitGTK 4.1 and libsecret for the webview and secrets, Xvfb and Mesa's Vulkan driver to run the app headless,
+# squashfs-tools for port/tools/package-linux's AppImage.
FROM node:24-trixie-slim AS node
FROM oven/bun:1.4.5-debian AS bun
FROM rust:1-trixie
@@ -10,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libasound2-dev libfontconfig-dev libfreetype-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev \
libvulkan1 mesa-vulkan-drivers libssl-dev libzstd-dev libdbus-1-dev \
libwebkit2gtk-4.1-dev libsecret-1-dev \
- xvfb xauth git file \
+ xvfb xauth git file squashfs-tools \
&& rm -rf /var/lib/apt/lists/*
COPY --from=node /usr/local/bin/node /usr/local/bin/node
diff --git a/port/tools/linux/appimage b/port/tools/linux/appimage
new file mode 100755
index 00000000000..f47a8cfeea7
--- /dev/null
+++ b/port/tools/linux/appimage
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Makes an AppImage of a port/tools/package-linux folder, which is its AppDir as it is: the .desktop file and its icon
+# at the top, AppRun a link to the binary (added in the image only, the folder stays the archive's). The folder goes in
+# a squashfs behind AppImage's static type 2 runtime, which mounts it with FUSE and starts AppRun; it needs no libfuse
+# on the user's system, only fusermount or fusermount3. It bundles no library: the system libraries are the archive's
+# (port/notes.md milestone 23).
+# Usage: port/tools/linux/appimage <folder> <executable> <file.AppImage>, on the folder's arch (package-linux runs it).
+# Needs mksquashfs (squashfs-tools) and curl.
+set -euo pipefail
+dir=$1 executable=$2 out=$3
+# AppImage/type2-runtime release 20251108, pinned by its SHA-256.
+arch=$(uname -m)
+case $arch in
+ x86_64) sum=2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d ;;
+ aarch64) sum=00cbdfcf917cc6c0ff6d3347d59e0ca1f7f45a6df1a428a0d6d8a78664d87444 ;;
+ *) echo "appimage: no AppImage runtime for $arch" >&2; exit 1 ;;
+esac
+[[ -x $dir/$executable ]] || { echo "appimage: no executable $dir/$executable" >&2; exit 1; }
+runtime=$(mktemp)
+trap 'rm -f "$runtime" "$out.squashfs"' EXIT
+curl -fsSL -o "$runtime" "https://github.com/AppImage/type2-runtime/releases/download/20251108/runtime-$arch"
+echo "$sum $runtime" | sha256sum -c --quiet -
+mksquashfs "$dir" "$out.squashfs" -root-owned -noappend -comp zstd -quiet -no-progress -p "AppRun s 755 0 0 $executable"
+cat "$runtime" "$out.squashfs" >"$out"
+chmod 755 "$out"
diff --git a/port/tools/package-linux b/port/tools/package-linux
index dc9005cc9fd..484c1f4052b 100755
--- a/port/tools/package-linux
+++ b/port/tools/package-linux
@@ -3,7 +3,8 @@
// (named applicationName, as code.sh starts it) and bun, bin/<applicationName> from upstream's linux code.sh, and the
// app files in resources/app (port/tools/app-files.ts; product.rs BUNDLED_APP). The packages' native modules, built
// for macOS by the reference's pnpm install, are rebuilt for Linux with node-gyp. Then it writes
-// VSRustium-<version>-linux-<arch>.tar.gz next to the folder and the feed entries of port/notes.md "Update feed":
+// VSRustium-<version>-linux-<arch>.tar.gz and the folder as VSRustium-<version>-linux-<arch>.AppImage
+// (port/tools/linux/appimage) next to the folder, and the feed entries of port/notes.md "Update feed":
// linux-<arch>-prerelease.json and, unless PRERELEASE=1, linux-<arch>.json.
// Run on Linux after `cargo build --release -p app` and port/tools/build-exthost, for the host's arch:
// port/tools/linux-build 'port/tools/package-linux' env VSCODE_GPUI_EXTENSIONS (default the VS Code tree's
@@ -78,5 +79,8 @@ rmSync(archive, { force: true });
await Bun.$`tar -czf ${archive} -C ${dirname(out)} ${basename(out)}`;
await writeFeedEntries(archive, product, platform, arch);
const size = (await Bun.$`du -sh ${out}`.text()).split('\t')[0];
+const appImage = join(dirname(out), `VSRustium-${product.version}-${platform}-${arch}.AppImage`);
+await Bun.$`port/tools/linux/appimage ${out} ${name} ${appImage}`;
const archiveSize = (await Bun.$`du -sh ${archive}`.text()).split('\t')[0];
-console.log(`${out}: ${size}, ${basename(archive)}: ${archiveSize}`);
+const appImageSize = (await Bun.$`du -sh ${appImage}`.text()).split('\t')[0];
+console.log(`${out}: ${size}, ${basename(archive)}: ${archiveSize}, ${basename(appImage)}: ${appImageSize}`);