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.

feat(release): package Windows arm64

RoversX515e230d1241
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 54bd4759..e2ec6c6a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -49,6 +49,11 @@ on:
description: Windows x86_64
type: boolean
default: true
+ # Same terms as linux_arm64 below: free on public repos only.
+ windows_arm64:
+ description: Windows arm64
+ type: boolean
+ default: false
linux_x86_64:
description: Linux x86_64 (deb + rpm + AppImage + tarballs)
type: boolean
@@ -84,7 +89,7 @@ jobs:
version: ${{ steps.plan.outputs.version }}
release_tag: ${{ steps.plan.outputs.release_tag }}
publish: ${{ steps.plan.outputs.publish }}
- windows: ${{ steps.plan.outputs.windows }}
+ windows_matrix: ${{ steps.plan.outputs.windows_matrix }}
macos_matrix: ${{ steps.plan.outputs.macos_matrix }}
linux_matrix: ${{ steps.plan.outputs.linux_matrix }}
@@ -127,7 +132,8 @@ jobs:
publish='${{ inputs.publish }}'
macos_arm64='${{ inputs.macos_arm64 }}'
macos_x86_64='${{ inputs.macos_x86_64 }}'
- windows='${{ inputs.windows_x86_64 }}'
+ windows_x86_64='${{ inputs.windows_x86_64 }}'
+ windows_arm64='${{ inputs.windows_arm64 }}'
linux_x86_64='${{ inputs.linux_x86_64 }}'
linux_arm64='${{ inputs.linux_arm64 }}'
@@ -136,6 +142,11 @@ jobs:
[ if $a then {arch: "arm64", target: "aarch64-apple-darwin"} else empty end,
if $x then {arch: "x86_64", target: "x86_64-apple-darwin"} else empty end ]')"
+ windows_matrix="$(jq -nc \
+ --argjson x "$windows_x86_64" --argjson a "$windows_arm64" '
+ [ if $x then {arch: "x86_64", runs_on: "windows-2022", target: "x86_64-pc-windows-msvc"} else empty end,
+ if $a then {arch: "arm64", runs_on: "windows-11-arm", target: "aarch64-pc-windows-msvc"} else empty end ]')"
+
linux_matrix="$(jq -nc \
--argjson x "$linux_x86_64" --argjson a "$linux_arm64" '
# Only two package formats are needed. glibc is forward compatible
@@ -153,7 +164,7 @@ jobs:
echo "version=$version"
echo "release_tag=$release_tag"
echo "publish=$publish"
- echo "windows=$windows"
+ echo "windows_matrix=$windows_matrix"
echo "macos_matrix=$macos_matrix"
echo "linux_matrix=$linux_matrix"
} >> "$GITHUB_OUTPUT"
@@ -167,7 +178,7 @@ jobs:
echo "| release tag | \`$release_tag\` |"
echo "| publish | \`$publish\` |"
echo "| macOS | \`$(jq -r 'if length == 0 then "none" else [.[].arch] | join(", ") end' <<<"$macos_matrix")\` |"
- echo "| Windows | \`$windows\` |"
+ echo "| Windows | \`$(jq -r 'if length == 0 then "none" else [.[].arch] | join(", ") end' <<<"$windows_matrix")\` |"
echo "| Linux | \`$(jq -r 'if length == 0 then "none" else [.[] | "\(.name)/\(.arch)"] | join(", ") end' <<<"$linux_matrix")\` |"
} >> "$GITHUB_STEP_SUMMARY"
@@ -394,15 +405,20 @@ jobs:
retention-days: 3
windows:
- name: windows x86_64
+ name: windows ${{ matrix.arch }}
needs: [prepare, web]
- if: needs.prepare.outputs.windows == 'true'
- runs-on: windows-2022
+ if: needs.prepare.outputs.windows_matrix != '[]'
+ strategy:
+ fail-fast: false
+ matrix:
+ include: ${{ fromJSON(needs.prepare.outputs.windows_matrix) }}
+ runs-on: ${{ matrix.runs_on }}
timeout-minutes: 90
env:
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'
TAG_NAME: ${{ needs.prepare.outputs.version }}
+ WINDOWS_ARCH: ${{ matrix.arch }}
# Build, packaging, cache selection and symbol upload share this value.
CARGO_PROFILE: ${{ inputs.profile || 'release' }}
@@ -429,12 +445,20 @@ jobs:
uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable branch, pinned
with:
toolchain: stable
- targets: x86_64-pc-windows-msvc
+ targets: ${{ matrix.target }}
+
+ # The build below targets the host, so an x86_64 toolchain on the arm
+ # runner would quietly package the emulated build instead.
+ - name: Check host
+ shell: bash
+ run: |
+ rustc -vV
+ [ "$(rustc -vV | sed -n 's/^host: //p')" = '${{ matrix.target }}' ]
- name: Cache cargo
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
- key: windows-x86_64-${{ env.CARGO_PROFILE }}
+ key: windows-${{ matrix.arch }}-${{ env.CARGO_PROFILE }}
cache-on-failure: true
save-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
@@ -451,6 +475,13 @@ jobs:
Add-Content -Path $env:GITHUB_PATH -Value $inno
}
+ # Before the build: wezterm-gui's build script stages these next to the
+ # executables, and the installer takes them from there.
+ - name: Fetch the arm64 DLLs
+ if: matrix.arch == 'arm64'
+ shell: bash
+ run: bash ci/windows-arm64-assets.sh
+
# openssl-src needs perl; Strawberry Perl ships on the runner but is not
# on PATH by default.
- name: Build
@@ -472,7 +503,7 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v7
with:
- name: windows-x86_64
+ name: windows-${{ matrix.arch }}
path: |
ThinkTerm-*.zip
!ThinkTerm-*-pdb.zip
@@ -485,7 +516,7 @@ jobs:
if: env.CARGO_PROFILE == 'dist'
uses: actions/upload-artifact@v7
with:
- name: windows-x86_64-symbols
+ name: windows-${{ matrix.arch }}-symbols
path: ThinkTerm-*-pdb.zip
if-no-files-found: error
retention-days: 3
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 4763cd1f..4ef78f5d 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -279,13 +279,41 @@ case $OSTYPE in
# a bare `msys)` silently fell through to the catch-all on GitHub's runner,
# producing no package at all while still exiting 0.
msys* | cygwin* | mingw* | win32*)
- zipdir=ThinkTerm-windows-$TAG_NAME
+ # x86_64 keeps the names it has always had: the update check of every
+ # copy already installed looks for its installer by that name. arm64
+ # takes its files from ci/windows-arm64-assets.sh and has no ANGLE.
+ # Unset, WINDOWS_ARCH is whatever this machine built, as the build is
+ # native: an arm64 package must never go out under the x86_64 names.
+ windows_arch=${WINDOWS_ARCH:-}
+ if [[ -z "$windows_arch" ]] ; then
+ case "$(rustc -vV | sed -n 's/^host: //p')" in
+ aarch64-*) windows_arch=arm64 ;;
+ *) windows_arch=x86_64 ;;
+ esac
+ fi
+ case "$windows_arch" in
+ arm64)
+ win_arch=-arm64
+ win_assets=assets/windows/arm64
+ iss_arch=arm64
+ ;;
+ x86_64)
+ win_arch=
+ win_assets=assets/windows
+ iss_arch=x64
+ ;;
+ *)
+ echo "WINDOWS_ARCH is '$windows_arch'; expected x86_64 or arm64" >&2
+ exit 1
+ ;;
+ esac
+ zipdir=ThinkTerm-windows$win_arch-$TAG_NAME
if [[ "$BUILD_REASON" == "Schedule" ]] ; then
- zipname=ThinkTerm-windows-nightly.zip
- instname=ThinkTerm-nightly-setup
+ zipname=ThinkTerm-windows$win_arch-nightly.zip
+ instname=ThinkTerm-nightly$win_arch-setup
else
zipname=$zipdir.zip
- instname=ThinkTerm-${TAG_NAME}-setup
+ instname=ThinkTerm-${TAG_NAME}$win_arch-setup
fi
rm -rf $zipdir $zipname
mkdir $zipdir
@@ -296,14 +324,15 @@ case $OSTYPE in
"$artifact_dir/thinkterm-gui.exe" \
"$artifact_dir/thinkterm-plugin-server.exe" \
"$artifact_dir/strip-ansi-escapes.exe" \
- assets/windows/conhost/conpty.dll \
- assets/windows/conhost/OpenConsole.exe \
- assets/windows/angle/libEGL.dll \
- assets/windows/angle/libGLESv2.dll \
+ $win_assets/conhost/conpty.dll \
+ $win_assets/conhost/OpenConsole.exe \
LICENSE.md \
LICENSE-MIT \
NOTICE \
$zipdir
+ if [[ -z "$win_arch" ]] ; then
+ cp assets/windows/angle/libEGL.dll assets/windows/angle/libGLESv2.dll $zipdir
+ fi
# The dist profile writes a PDB per binary; `release` writes none. They
# go into a zip of their own next to the package, not into it: they are
@@ -316,10 +345,10 @@ case $OSTYPE in
rm -rf $zipdir-pdb
fi
- # Same source as the four DLLs above -- wezterm-gui's build script only
+ # Same source as the DLLs above -- wezterm-gui's build script only
# stages a copy of it next to the exe, so take it from assets directly.
mkdir $zipdir/mesa
- cp assets/windows/mesa/opengl32.dll $zipdir/mesa
+ cp $win_assets/mesa/opengl32.dll $zipdir/mesa
# The browser client, beside the executables: the server looks for
# <exe>/web on a flat layout like this one. -p keeps the modification
# times the .gz freshness check reads.
@@ -333,7 +362,8 @@ case $OSTYPE in
fi
7z a -tzip $zipname $zipdir
installer_source_dir=$(cygpath -w "$artifact_dir")
- iscc.exe "-DMyAppVersion=${TAG_NAME#nightly}" "-DMyAppSourceDir=$installer_source_dir" "-F${instname}" ci/windows-installer.iss
+ iscc.exe "-DMyAppVersion=${TAG_NAME#nightly}" "-DMyAppSourceDir=$installer_source_dir" \
+ "-DMyAppArch=$iss_arch" "-F${instname}" ci/windows-installer.iss
;;
linux-gnu|linux)
distro=$(lsb_release -is 2>/dev/null || sh -c "source /etc/os-release && echo \$NAME")
diff --git a/ci/release-notes.sh b/ci/release-notes.sh
index 263e0346..1be1df1f 100755
--- a/ci/release-notes.sh
+++ b/ci/release-notes.sh
@@ -19,18 +19,20 @@ version="${tag#v}"
base="https://github.com/RoversX/thinkterm/releases/download/$tag"
-# Every Linux package we build is one of these two. Anything unrecognized is
-# labelled 64-bit rather than dropped, so a new architecture shows up wrong
-# rather than silently going missing.
+# Every Linux and Windows package we build is one of these two. Anything
+# unrecognized gets the x86_64 label rather than being dropped, so a new
+# architecture shows up wrong rather than silently going missing. Windows
+# passes "x64": ARM64 there is 64-bit too, and is what that word means.
arch_label() {
case "$1" in
*arm64* | *aarch64*) echo "ARM64" ;;
- *) echo "64-bit" ;;
+ *) echo "${2:-64-bit}" ;;
esac
}
-# "[64-bit](url) · [ARM64](url)" for every file matching a glob. Returns 1 when
-# the release contains none of them, so the caller can drop the whole row.
+# "[64-bit](url) · [ARM64](url)" for every file matching a glob; a second
+# argument replaces "64-bit". Returns 1 when the release contains none of
+# them, so the caller can drop the whole row.
#
# Two passes so that 64-bit leads, whatever the filenames sort as: it is what
# most people want, and a row reads as a recommendation followed by the
@@ -46,25 +48,13 @@ links_by_arch() {
*) [ "$want" = x86 ] || continue ;;
esac
[ -z "$out" ] || out="$out · "
- out="$out[$(arch_label "$f")]($base/$f)"
+ out="$out[$(arch_label "$f" "${2:-}")]($base/$f)"
done
done
[ -n "$out" ] || return 1
printf '%s\n' "$out"
}
-# One named file. Used where the architecture is not what distinguishes the
-# download -- the Windows installer against the portable zip, say.
-link_to() {
- local f
- for f in "$dist"/$2; do
- [ -f "$f" ] || continue
- printf '[%s](%s/%s)' "$1" "$base" "$(basename "$f")"
- return 0
- done
- return 1
-}
-
# The same header on every release, from main: the tag does not exist until
# the draft is published, so a link through it would show broken in the draft.
echo "## $version"
@@ -90,17 +80,13 @@ echo
echo "[Apple silicon]($base/ThinkTerm-macos-arm64-$version.zip) · [Intel]($base/ThinkTerm-macos-x86_64-$version.zip) — or \`curl -fsSL https://raw.githubusercontent.com/RoversX/thinkterm/main/install.sh | sh\`, which picks the right one, verifies it and puts the command-line tools on PATH"
echo
-win_setup=$(link_to "Installer" 'ThinkTerm-*-setup.exe') || win_setup=''
-win_zip=$(link_to "Portable zip" 'ThinkTerm-windows-*.zip') || win_zip=''
+win_setup=$(links_by_arch 'ThinkTerm-*-setup.exe' x64) || win_setup=''
+win_zip=$(links_by_arch 'ThinkTerm-windows-*.zip' x64) || win_zip=''
if [ -n "$win_setup$win_zip" ]; then
echo "### Windows"
echo
- if [ -n "$win_setup" ] && [ -n "$win_zip" ]; then
- echo "$win_setup · $win_zip"
- else
- echo "$win_setup$win_zip"
- fi
- echo
+ [ -z "$win_setup" ] || { echo "Installer: $win_setup"; echo; }
+ [ -z "$win_zip" ] || { echo "Portable zip: $win_zip"; echo; }
fi
linux=''
diff --git a/ci/subst-release-info.py b/ci/subst-release-info.py
index fd8f471e..ae99ab51 100755
--- a/ci/subst-release-info.py
+++ b/ci/subst-release-info.py
@@ -19,8 +19,8 @@ CATEGORIZE = {
r"^wezterm-\d+-\d+-[a-f0-9]+.tar.xz$": "linux_raw_bin",
r"src.tar.gz$": "src",
r"^ThinkTerm-macos-.*.zip$": "macos_zip",
- r"^ThinkTerm-windows-.*.zip$": "windows_zip",
- r"^ThinkTerm-.*.setup.exe$": "windows_exe",
+ r"^ThinkTerm-windows-(?!arm64-).*.zip$": "windows_zip",
+ r"^ThinkTerm-(?!.*-arm64-setup).*.setup.exe$": "windows_exe",
r"alpine(\d+)\.(\d+)(:?-\S+)?.apk": "alpine\\1_\\2_apk",
}
diff --git a/ci/windows-installer.iss b/ci/windows-installer.iss
index 6e921247..db8e458a 100644
--- a/ci/windows-installer.iss
+++ b/ci/windows-installer.iss
@@ -10,11 +10,20 @@
#ifndef MyAppSourceDir
#error MyAppSourceDir must name the directory containing the built executables
#endif
+; x64 or arm64: the architecture of the executables in MyAppSourceDir
+#ifndef MyAppArch
+ #define MyAppArch "x64"
+#endif
[Setup]
AppId={{56CBA99B-8F65-4EC0-8CE4-F13BFCB70274}
+#if MyAppArch == "arm64"
+ArchitecturesAllowed=arm64
+ArchitecturesInstallIn64BitMode=arm64
+#else
ArchitecturesAllowed=x64 arm64
ArchitecturesInstallIn64BitMode=x64 arm64
+#endif
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
@@ -52,8 +61,11 @@ Source: "{#MyAppSourceDir}\thinkterm-gui.exe"; DestDir: "{app}"; Flags: ignoreve
Source: "{#MyAppSourceDir}\thinkterm-mux-server.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\thinkterm-plugin-server.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\mesa\opengl32.dll"; DestDir: "{app}\mesa"; Flags: ignoreversion
+; ANGLE has no arm64 build here
+#if MyAppArch != "arm64"
Source: "{#MyAppSourceDir}\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
+#endif
Source: "{#MyAppSourceDir}\conpty.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppSourceDir}\OpenConsole.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\thinkterm-web\www\*"; DestDir: "{app}\web"; Flags: ignoreversion recursesubdirs skipifsourcedoesntexist
@@ -63,6 +75,13 @@ Source: "..\LICENSE-MIT"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\NOTICE"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+#if MyAppArch == "arm64"
+[InstallDelete]
+; Left behind by an x64 install in the same place; an arm64 process cannot load them
+Type: files; Name: "{app}\libEGL.dll"
+Type: files; Name: "{app}\libGLESv2.dll"
+
+#endif
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; AppUserModelID: "com.roversx.thinkterm"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; AppUserModelID: "com.roversx.thinkterm"
@@ -85,6 +104,10 @@ Root: HKA; Subkey: "Software\Classes\Directory\shell\Open ThinkTerm here\command
{ https://stackoverflow.com/a/46609047/149111 }
const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
+// The x64 package also installs on arm64, where it runs under emulation;
+// these check that the machine can emulate x64. The arm64 package runs
+// natively and needs none of it.
+#if MyAppArch != "arm64"
const IMAGE_FILE_MACHINE_AMD64 = $8664;
function GetMachineTypeAttributes(
@@ -132,6 +155,7 @@ function InitializeSetupCheckArchitecture(): Boolean;
begin
Result := IsSupportedArch();
end;
+#endif
procedure EnvAddPath(instlPath: string);
var