Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

build(windows): build for arm64

RoversX99727f29deb7
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 7e6294b8..23326d31 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -11,5 +11,5 @@ ar = "x86_64-w64-mingw32-gcc-ar"
# We need openssl to be statically linked on windows to avoid madness,
# and openssl-src does that based on the crt-static feature being
# enabled for the target, so let's turn that on here.
-[target.x86_64-pc-windows-msvc]
+[target.'cfg(all(windows, target_env = "msvc"))']
rustflags = ["-C", "target-feature=+crt-static"]
diff --git a/.gitignore b/.gitignore
index 504ef9f9..7e4831ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,8 @@ dhat-heap.json
/wezterm*.tar.xz
/pkg
/target/
+# Fetched by ci/windows-arm64-assets.sh
+/assets/windows/arm64/
/wezterm-char-props/codegen/target
/wezterm-char-props/codegen/Cargo.lock
/termwiz/codegen/target
diff --git a/ci/windows-arm64-assets.sh b/ci/windows-arm64-assets.sh
new file mode 100755
index 00000000..70bce70b
--- /dev/null
+++ b/ci/windows-arm64-assets.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+# Fetches the arm64 builds of the files the Windows package carries beside
+# the executables, into assets/windows/arm64 (not tracked). The x86_64 copies
+# are checked in under assets/windows; these come from upstream releases
+# instead, pinned by version and checksum:
+#
+# conhost/ conpty.dll and OpenConsole.exe, from Microsoft's ConPTY package
+# mesa/ opengl32.dll, Mesa's llvmpipe software renderer
+#
+# There is no arm64 ANGLE. EGL is off by default on Windows, so the arm64
+# package goes without libEGL.dll and libGLESv2.dll.
+#
+# Run from the repository root, on Windows: it needs curl, sha256sum and 7z,
+# which the GitHub runner has on PATH.
+set -euo pipefail
+
+conpty_version=1.25.260930003
+conpty_sha256=02b07b349af66d801159bdf9e440d4a1ce78bb951f37fc8609731665afdae7ee
+mesa_version=26.2.5
+mesa_sha256=e7df75398d50e07a68bbffa5cff2ece4c85e5f8ef8bda497f560dd04fe60cbbd
+
+dest=assets/windows/arm64
+# Relative, so the paths handed to 7z need no translating from Git Bash's
+# /tmp to a Windows path.
+mkdir -p target
+work=$(mktemp -d target/windows-arm64-assets.XXXXXX)
+trap 'rm -rf "$work"' EXIT
+
+# url file sha256
+fetch() {
+ bash ci/retry.sh curl -sSfL -o "$work/$2" "$1"
+ echo "$3 $work/$2" | sha256sum -c -
+}
+
+fetch "https://api.nuget.org/v3-flatcontainer/microsoft.windows.console.conpty/$conpty_version/microsoft.windows.console.conpty.$conpty_version.nupkg" \
+ conpty.nupkg "$conpty_sha256"
+fetch "https://github.com/mmozeiko/build-mesa/releases/download/$mesa_version/mesa-llvmpipe-arm64-$mesa_version.7z" \
+ mesa.7z "$mesa_sha256"
+
+7z x -y -o"$work/conpty" "$work/conpty.nupkg" >/dev/null
+7z x -y -o"$work/mesa" "$work/mesa.7z" opengl32.dll >/dev/null
+
+rm -rf "$dest"
+mkdir -p "$dest/conhost" "$dest/mesa"
+cp "$work/conpty/runtimes/win-arm64/native/conpty.dll" \
+ "$work/conpty/build/native/runtimes/arm64/OpenConsole.exe" \
+ "$dest/conhost/"
+cp "$work/mesa/opengl32.dll" "$dest/mesa/"
+ls -l "$dest"/*
diff --git a/deps/freetype/build.rs b/deps/freetype/build.rs
index a95915d5..be7b4a27 100644
--- a/deps/freetype/build.rs
+++ b/deps/freetype/build.rs
@@ -76,9 +76,10 @@ fn libpng() {
if let Ok(arch) = env::var("CARGO_CFG_TARGET_ARCH") {
match arch.as_str() {
+ // arm/filter_neon.S is left out: libpng ships it as an empty
+ // stub, and MSVC hands a .S file to cl.exe, which skips it.
"aarch64" | "arm" => {
cfg.file("libpng/arm/arm_init.c")
- .file("libpng/arm/filter_neon.S")
.file("libpng/arm/filter_neon_intrinsics.c")
.file("libpng/arm/palette_neon_intrinsics.c");
}
diff --git a/wezterm-gui/build.rs b/wezterm-gui/build.rs
index 85b24ccb..4154727c 100644
--- a/wezterm-gui/build.rs
+++ b/wezterm-gui/build.rs
@@ -45,12 +45,31 @@ fn main() {
let exe_output_dir = exe_output_dir(&repo_dir);
let windows_dir = repo_dir.join("assets").join("windows");
- let conhost_dir = windows_dir.join("conhost");
+ // The checked-in copies are x86_64. The arm64 ones are fetched by
+ // ci/windows-arm64-assets.sh, and there is no arm64 ANGLE. Without
+ // them an arm64 build still runs: it falls back to the system ConPTY.
+ // Watching the parent notices the directory once it appears.
+ let arm64 = std::env::var("CARGO_CFG_TARGET_ARCH").as_deref() == Ok("aarch64");
+ let dll_dir = if arm64 {
+ println!("cargo:rerun-if-changed={}", windows_dir.display());
+ let dir = windows_dir.join("arm64");
+ if !dir.exists() {
+ println!(
+ "cargo:warning={} is missing; run ci/windows-arm64-assets.sh",
+ dir.display()
+ );
+ }
+ dir
+ } else {
+ windows_dir.clone()
+ };
+
+ let conhost_dir = dll_dir.join("conhost");
for name in &["conpty.dll", "OpenConsole.exe"] {
let dest_name = exe_output_dir.join(name);
let src_name = conhost_dir.join(name);
- if !dest_name.exists() {
+ if !dest_name.exists() && (!arm64 || src_name.exists()) {
std::fs::copy(&src_name, &dest_name)
.context(format!(
"copy {} -> {}",
@@ -61,12 +80,12 @@ fn main() {
}
}
- let angle_dir = windows_dir.join("angle");
+ let angle_dir = dll_dir.join("angle");
for name in &["libEGL.dll", "libGLESv2.dll"] {
let dest_name = exe_output_dir.join(name);
let src_name = angle_dir.join(name);
- if !dest_name.exists() {
+ if !arm64 && !dest_name.exists() {
std::fs::copy(&src_name, &dest_name)
.context(format!(
"copy {} -> {}",
@@ -81,8 +100,8 @@ fn main() {
let dest_mesa = exe_output_dir.join("mesa");
let _ = std::fs::create_dir(&dest_mesa);
let dest_name = dest_mesa.join("opengl32.dll");
- let src_name = windows_dir.join("mesa").join("opengl32.dll");
- if !dest_name.exists() {
+ let src_name = dll_dir.join("mesa").join("opengl32.dll");
+ if !dest_name.exists() && (!arm64 || src_name.exists()) {
std::fs::copy(&src_name, &dest_name)
.context(format!(
"copy {} -> {}",