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.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
ci: build releases with a dist profile: LTO, stripped, symbols kept beside the package
RoversX639208f0d111
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 6514a505..63b78223 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -296,7 +296,7 @@ jobs:- name: Cache cargouses: Swatinem/rust-cache@v2with:- key: macos-${{ matrix.arch }}+ key: macos-${{ matrix.arch }}-distcache-on-failure: truesave-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}@@ -305,7 +305,7 @@ jobs:- name: Buildrun: |- cargo build --release --target ${{ matrix.target }} \+ cargo build --profile dist --target ${{ matrix.target }} \-p wezterm \-p wezterm-gui \-p wezterm-mux-server \@@ -327,13 +327,26 @@ jobs:MACOS_CERT: ${{ secrets.MACOS_CERT }}MACOS_CERT_PW: ${{ secrets.MACOS_CERT_PW }}MACOS_TEAM_ID: ${{ secrets.MACOS_TEAM_ID }}+ CARGO_PROFILE: distrun: bash ci/deploy.sh- name: Uploaduses: actions/upload-artifact@v7with:name: macos-${{ matrix.arch }}- path: ThinkTerm-macos-*.zip+ path: |+ ThinkTerm-macos-*.zip+ !ThinkTerm-macos-*-dSYM.zip+ if-no-files-found: error++ # The symbols stay a workflow artifact (kept 90 days), not a release+ # asset: nobody but us reads a crash report against them, and on the+ # release page they would only look like another download.+ - name: Upload symbols+ uses: actions/upload-artifact@v7+ with:+ name: macos-${{ matrix.arch }}-symbols+ path: ThinkTerm-macos-*-dSYM.zipif-no-files-found: errorwindows:@@ -374,7 +387,7 @@ jobs:- name: Cache cargouses: Swatinem/rust-cache@v2with:- key: windows-x86_64+ key: windows-x86_64-distcache-on-failure: truesave-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}@@ -397,7 +410,7 @@ jobs:shell: cmdrun: |PATH C:\Strawberry\perl\bin;%PATH%- cargo build --release -p wezterm -p wezterm-gui -p wezterm-mux-server -p strip-ansi-escapes+ cargo build --profile dist -p wezterm -p wezterm-gui -p wezterm-mux-server -p strip-ansi-escapes- name: Fetch the browser bundleuses: actions/download-artifact@v8@@ -407,6 +420,8 @@ jobs:- name: Packageshell: bash+ env:+ CARGO_PROFILE: distrun: bash ci/deploy.sh- name: Upload@@ -415,9 +430,17 @@ jobs:name: windows-x86_64path: |ThinkTerm-*.zip+ !ThinkTerm-*-pdb.zipThinkTerm-*.exeif-no-files-found: error+ - name: Upload symbols+ uses: actions/upload-artifact@v7+ with:+ name: windows-x86_64-symbols+ path: ThinkTerm-*-pdb.zip+ if-no-files-found: error+# Each distro builds inside its own container so the resulting deb/rpm links# against that distro's glibc, and the arch comes from the runner underneath.linux:@@ -490,7 +513,7 @@ jobs:- name: Cache cargouses: Swatinem/rust-cache@v2with:- key: ${{ matrix.name }}-${{ matrix.arch }}+ key: ${{ matrix.name }}-${{ matrix.arch }}-distcache-on-failure: truesave-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}@@ -499,7 +522,7 @@ jobs:- name: Buildrun: |- cargo build --release \+ cargo build --profile dist \-p wezterm \-p wezterm-gui \-p wezterm-mux-server \@@ -512,6 +535,8 @@ jobs:path: thinkterm-web/www- name: Package+ env:+ CARGO_PROFILE: distrun: bash ci/deploy.sh- name: Collect RPMs@@ -520,6 +545,8 @@ jobs:- name: Build AppImageif: matrix.appimage+ env:+ CARGO_PROFILE: distrun: |set -euapt-get install -y --no-install-recommends file zsync@@ -577,6 +604,9 @@ jobs:# A plan with every platform deselected reaches this job with nothing# downloaded. Stop here rather than let ci/create-release.sh mint an# empty draft on the default branch.+ # The symbol zips are workflow artifacts for reading crash+ # reports, not downloads: keep them off the release page.+ rm -f dist/*-dSYM.zip dist/*-pdb.zip[ -d dist ] && [ -n "$(ls -A dist)" ] \|| { echo "::error::no artifacts to publish"; exit 1; }ls -l distdiff --git a/Cargo.toml b/Cargo.tomlindex 8674fb36..85ed7a07 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -39,6 +39,19 @@ exclude = [opt-level = 3# debug = 2+# What a release ships: whole-program optimisation and no symbol table in+# the binaries, with the symbols written beside them (a .dSYM on macOS, a+# .dwp on Linux, a .pdb on Windows) for symbolicating crash reports. It+# builds into target/dist, so the everyday release profile and its cache+# stay untouched; only the final LTO link is repeated per build.+[profile.dist]+inherits = "release"+lto = "fat"+codegen-units = 1+debug = "line-tables-only"+split-debuginfo = "packed"+strip = "symbols"+[profile.dev]debug = 0# https://jakedeichert.com/blog/reducing-rust-incremental-compilation-times-on-macos-by-70-percent/diff --git a/ci/appimage.sh b/ci/appimage.shindex 727755b3..dd856cbf 100755--- a/ci/appimage.sh+++ b/ci/appimage.sh@@ -5,11 +5,13 @@ set -emkdir AppDir-install -Dsm755 -t AppDir/usr/bin target/release/thinkterm-mux-server-install -Dsm755 -t AppDir/usr/bin target/release/thinkterm-install -Dsm755 -t AppDir/usr/bin target/release/wezterm-install -Dsm755 -t AppDir/usr/bin target/release/thinkterm-gui-install -Dsm755 -t AppDir/usr/bin target/release/strip-ansi-escapes+# The cargo profile the binaries were built with, as ci/deploy.sh reads it.+PROFILE=${CARGO_PROFILE:-release}+install -Dsm755 -t AppDir/usr/bin target/$PROFILE/thinkterm-mux-server+install -Dsm755 -t AppDir/usr/bin target/$PROFILE/thinkterm+install -Dsm755 -t AppDir/usr/bin target/$PROFILE/wezterm+install -Dsm755 -t AppDir/usr/bin target/$PROFILE/thinkterm-gui+install -Dsm755 -t AppDir/usr/bin target/$PROFILE/strip-ansi-escapesinstall -Dm644 assets/icon/terminal.png AppDir/usr/share/icons/hicolor/128x128/apps/com.roversx.thinkterm.pnginstall -Dm644 assets/wezterm.desktop AppDir/usr/share/applications/com.roversx.thinkterm.desktopinstall -Dm644 assets/wezterm.appdata.xml AppDir/usr/share/metainfo/com.roversx.thinkterm.appdata.xmldiff --git a/ci/deploy.sh b/ci/deploy.shindex 4f2cb363..7f0605ac 100755--- a/ci/deploy.sh+++ b/ci/deploy.sh@@ -20,6 +20,10 @@ require_web_bundle() {set -eTARGET_DIR=${1:-target}+# The cargo profile the binaries were built with: `release` (target/release)+# unless the caller built with `--profile dist` (target/dist), which is what+# the release workflow and `ci/macos-package.sh --profile dist` do.+PROFILE=${CARGO_PROFILE:-release}TAG_NAME=${TAG_NAME:-$(git -c "core.abbrev=8" show -s "--format=%cd-%h" "--date=format:%Y%m%d-%H%M%S")}@@ -90,8 +94,8 @@ case $OSTYPE inmacos_bin_dir=${MACOS_BIN_DIR:-}if [[ -z "$macos_bin_dir" ]] ; thencase "${MACOS_ARCH:-}" in- arm64) macos_bin_dir=$TARGET_DIR/aarch64-apple-darwin/release ;;- x86_64) macos_bin_dir=$TARGET_DIR/x86_64-apple-darwin/release ;;+ arm64) macos_bin_dir=$TARGET_DIR/aarch64-apple-darwin/$PROFILE ;;+ x86_64) macos_bin_dir=$TARGET_DIR/x86_64-apple-darwin/$PROFILE ;;*) macos_bin_dir= ;;esacfi@@ -101,18 +105,35 @@ case $OSTYPE incp $macos_bin_dir/$bin $zipdir/ThinkTerm.app/Contents/MacOS/$bin# If the user ran a simple `cargo build --release`, then we want to allow# a single-arch package to be built- elif [[ -f $TARGET_DIR/release/$bin ]] ; then- cp $TARGET_DIR/release/$bin $zipdir/ThinkTerm.app/Contents/MacOS/$bin+ elif [[ -f $TARGET_DIR/$PROFILE/$bin ]] ; then+ cp $TARGET_DIR/$PROFILE/$bin $zipdir/ThinkTerm.app/Contents/MacOS/$binelse# The CI runs `cargo build --target XXX --release` which means that# the binaries will be deployed in `$TARGET_DIR/XXX/release` instead of# the plain path above.# In that situation, we have two architectures to assemble into a# Universal ("fat") binary, so we use the `lipo` tool for that.- lipo $TARGET_DIR/*/release/$bin -output $zipdir/ThinkTerm.app/Contents/MacOS/$bin -create+ lipo $TARGET_DIR/*/$PROFILE/$bin -output $zipdir/ThinkTerm.app/Contents/MacOS/$bin -createfidone+ # The symbols the dist profile writes beside each binary (split-debuginfo+ # = "packed"): zipped next to the app, never inside it, so a crash+ # report's addresses can be resolved against the matching build.+ symdir="$zipdir-dSYM"+ rm -rf "$symdir" "$symdir.zip"+ for bin in wezterm thinkterm thinkterm-mux-server thinkterm-gui strip-ansi-escapes ; do+ dsym="${macos_bin_dir:-$TARGET_DIR/$PROFILE}/$bin.dSYM"+ if [[ -d "$dsym" ]] ; then+ mkdir -p "$symdir"+ cp -R "$dsym" "$symdir/"+ fi+ done+ if [[ -d "$symdir" ]] ; then+ zip -qr "$symdir.zip" "$symdir"+ rm -rf "$symdir"+ fi+set +x# Only a Developer ID signature is eligible for notarization; the notary# service rejects adhoc and Apple Development identities outright.@@ -211,11 +232,11 @@ case $OSTYPE infirm -rf $zipdir $zipnamemkdir $zipdir- cp $TARGET_DIR/release/thinkterm.exe \- $TARGET_DIR/release/wezterm.exe \- $TARGET_DIR/release/thinkterm-mux-server.exe \- $TARGET_DIR/release/thinkterm-gui.exe \- $TARGET_DIR/release/strip-ansi-escapes.exe \+ cp $TARGET_DIR/$PROFILE/thinkterm.exe \+ $TARGET_DIR/$PROFILE/wezterm.exe \+ $TARGET_DIR/$PROFILE/thinkterm-mux-server.exe \+ $TARGET_DIR/$PROFILE/thinkterm-gui.exe \+ $TARGET_DIR/$PROFILE/strip-ansi-escapes.exe \assets/windows/conhost/conpty.dll \assets/windows/conhost/OpenConsole.exe \assets/windows/angle/libEGL.dll \@@ -225,11 +246,16 @@ case $OSTYPE inNOTICE \$zipdir- # `[profile.release]` leaves `debug` off, so no PDBs exist today and- # copying them unconditionally would abort the whole step under `set -e`.- # Glob rather than name them: turning debuginfo on should ship symbols for- # every binary, not just the two that happened to be listed here.- cp $TARGET_DIR/release/*.pdb $zipdir 2>/dev/null || true+ # 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+ # for resolving crash reports, and they would double the download.+ rm -rf $zipdir-pdb $zipdir-pdb.zip+ if ls $TARGET_DIR/$PROFILE/*.pdb >/dev/null 2>&1 ; then+ mkdir $zipdir-pdb+ cp $TARGET_DIR/$PROFILE/*.pdb $zipdir-pdb+ 7z a -tzip $zipdir-pdb.zip $zipdir-pdb >/dev/null+ rm -rf $zipdir-pdb+ fi# Same source as the four DLLs above -- wezterm-gui's build script only# stages a copy of it next to the exe, so take it from assets directly.@@ -267,7 +293,7 @@ case $OSTYPE inif test -n "${COPR_SRPM}" ; thenTAR_NAME=$(git -c "core.abbrev=8" show -s "--format=%cd_%h" "--date=format:%Y%m%d_%H%M%S")HERE="."- BUILD_SECTION=$(cat <<'BUILDEOFEOF'+ BUILD_SECTION=$(cat <<BUILDEOFEOF%prep%autosetup%build@@ -277,7 +303,7 @@ echo Here I amcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -ysource ~/.cargo/env-cargo build --release \+cargo build --profile ${PROFILE} \-p wezterm-gui -p wezterm -p wezterm-mux-server \-p strip-ansi-escapesBUILDEOFEOF@@ -357,11 +383,11 @@ set -xcd ${HERE}mkdir -p %{buildroot}/usr/bin %{buildroot}/etc/profile.d %{buildroot}/usr/share/icons/hicolor/128x128/apps %{buildroot}/usr/share/applications %{buildroot}/usr/share/metainfo %{buildroot}/usr/share/nautilus-python/extensionsinstall -Dm755 assets/open-thinkterm-here assets/open-wezterm-here -t %{buildroot}/usr/bin-install -Dsm755 $TARGET_DIR/release/thinkterm -t %{buildroot}/usr/bin-install -Dsm755 $TARGET_DIR/release/wezterm -t %{buildroot}/usr/bin-install -Dsm755 $TARGET_DIR/release/thinkterm-gui -t %{buildroot}/usr/bin-install -Dsm755 $TARGET_DIR/release/thinkterm-mux-server -t %{buildroot}/usr/bin-install -Dsm755 $TARGET_DIR/release/strip-ansi-escapes -t %{buildroot}/usr/bin+install -Dsm755 $TARGET_DIR/$PROFILE/thinkterm -t %{buildroot}/usr/bin+install -Dsm755 $TARGET_DIR/$PROFILE/wezterm -t %{buildroot}/usr/bin+install -Dsm755 $TARGET_DIR/$PROFILE/thinkterm-gui -t %{buildroot}/usr/bin+install -Dsm755 $TARGET_DIR/$PROFILE/thinkterm-mux-server -t %{buildroot}/usr/bin+install -Dsm755 $TARGET_DIR/$PROFILE/strip-ansi-escapes -t %{buildroot}/usr/bininstall -Dm644 assets/shell-integration/* -t %{buildroot}/etc/profile.dinstall -Dm644 assets/shell-completion/zsh %{buildroot}/usr/share/zsh/site-functions/_thinkterminstall -Dm644 assets/shell-completion/bash %{buildroot}/etc/bash_completion.d/thinkterm@@ -519,12 +545,12 @@ Description: ThinkTerm command line, TUI and multiplexer server, no GUI.EOFfi- install -Dsm755 -t $root/usr/bin $TARGET_DIR/release/thinkterm-mux-server- install -Dsm755 -t $root/usr/bin $TARGET_DIR/release/thinkterm- install -Dsm755 -t $root/usr/bin $TARGET_DIR/release/wezterm- install -Dsm755 -t $root/usr/bin $TARGET_DIR/release/strip-ansi-escapes+ install -Dsm755 -t $root/usr/bin $TARGET_DIR/$PROFILE/thinkterm-mux-server+ install -Dsm755 -t $root/usr/bin $TARGET_DIR/$PROFILE/thinkterm+ install -Dsm755 -t $root/usr/bin $TARGET_DIR/$PROFILE/wezterm+ install -Dsm755 -t $root/usr/bin $TARGET_DIR/$PROFILE/strip-ansi-escapesif [[ "$variant" == desktop ]] ; then- install -Dsm755 -t $root/usr/bin $TARGET_DIR/release/thinkterm-gui+ install -Dsm755 -t $root/usr/bin $TARGET_DIR/$PROFILE/thinkterm-guiinstall -Dm755 -t $root/usr/bin assets/open-thinkterm-here assets/open-wezterm-hereinstall -Dm644 assets/icon/terminal.png $root/usr/share/icons/hicolor/128x128/apps/com.roversx.thinkterm.pnginstall -Dm644 assets/wezterm.desktop $root/usr/share/applications/com.roversx.thinkterm.desktop@@ -624,16 +650,16 @@ EOFrm -rf "$tardir"}linux_tarball thinkterm \- $TARGET_DIR/release/thinkterm \- $TARGET_DIR/release/wezterm \- $TARGET_DIR/release/thinkterm-mux-server \- $TARGET_DIR/release/thinkterm-gui \- $TARGET_DIR/release/strip-ansi-escapes+ $TARGET_DIR/$PROFILE/thinkterm \+ $TARGET_DIR/$PROFILE/wezterm \+ $TARGET_DIR/$PROFILE/thinkterm-mux-server \+ $TARGET_DIR/$PROFILE/thinkterm-gui \+ $TARGET_DIR/$PROFILE/strip-ansi-escapeslinux_tarball thinkterm-server \- $TARGET_DIR/release/thinkterm \- $TARGET_DIR/release/wezterm \- $TARGET_DIR/release/thinkterm-mux-server \- $TARGET_DIR/release/strip-ansi-escapes+ $TARGET_DIR/$PROFILE/thinkterm \+ $TARGET_DIR/$PROFILE/wezterm \+ $TARGET_DIR/$PROFILE/thinkterm-mux-server \+ $TARGET_DIR/$PROFILE/strip-ansi-escapes;;esac;;@@ -656,10 +682,10 @@ options="!check"url="https://github.com/RoversX/thinkterm"makedepends="cmd:tic"source="- $TARGET_DIR/release/thinkterm- $TARGET_DIR/release/wezterm- $TARGET_DIR/release/thinkterm-gui- $TARGET_DIR/release/thinkterm-mux-server+ $TARGET_DIR/$PROFILE/thinkterm+ $TARGET_DIR/$PROFILE/wezterm+ $TARGET_DIR/$PROFILE/thinkterm-gui+ $TARGET_DIR/$PROFILE/thinkterm-mux-serverassets/open-thinkterm-hereassets/open-wezterm-hereassets/wezterm.desktopdiff --git a/ci/macos-package.sh b/ci/macos-package.shindex 2322aba0..e21c0354 100755--- a/ci/macos-package.sh+++ b/ci/macos-package.sh@@ -19,9 +19,16 @@ NOTARY_PROFILE=${MACOS_NOTARY_PROFILE:-thinkterm}usage() {cat <<EOTusage: ci/macos-package.sh [--build] [--arch arm64|x86_64|both]- [--upload] [adhoc|developerid] [tag]+ [--profile release|dist] [--upload]+ [adhoc|developerid] [tag]--build Compile the binaries before packaging.+ --profile Which cargo profile the binaries come from (and, with+ --build, are built with). Defaults to release, the everyday+ build in target/release. dist is what the release workflow+ ships: LTO, symbols stripped into a .dSYM zip beside the+ app; it builds into target/dist and takes several times+ longer to link.--arch Which Mac the package is for. Defaults to this one; theother is cross-compiled, which needs its standard library(\`rustup target add x86_64-apple-darwin\`). \`both\` runs@@ -46,12 +53,21 @@ EOTBUILD=noARCH=UPLOAD=no+PROFILE=releasewhile [[ $# -gt 0 ]]; docase "$1" in--build)BUILD=yesshift;;+ --profile)+ PROFILE=${2:-}+ shift 2 || { usage >&2; exit 2; }+ case "$PROFILE" in+ release | dist) ;;+ *) usage >&2; exit 2 ;;+ esac+ ;;--arch)ARCH=${2:-}shift 2 || { usage >&2; exit 2; }@@ -85,16 +101,23 @@ ThinkTerm macOS packagingSigns with your Developer ID certificate, submits to Apple, staplesthe ticket into the bundle. Uploads ~60MB and takes a few minutes.Opens on any Mac with no warning, and needs no network to verify.- Packages the binaries already in target/release, whatever their age.+ Packages the binaries already built, whatever their age (from+ target/release, or target/dist with --profile dist).3) Build, then Developer ID + notarizedEverything option 2 does, but compiles all five binaries first so the- bundle cannot carry a mix of commits. This is the one to use for a- release.+ bundle cannot carry a mix of commits. Uses the everyday release+ profile, so it shares target/release with your normal builds.++ 4) Build with the dist profile, then Developer ID + notarized+ Like option 3, but built the way the release workflow builds:+ whole-program optimised, symbols stripped into a .dSYM zip beside+ the app, about 55MB smaller. Builds into target/dist and takes ten+ minutes or so. This is the one to use for a release.EOTwhile [[ -z "$MODE" ]]; do- printf "Select [1/2/3]: "+ printf "Select [1/2/3/4]: "read -r reply || { echo; exit 1; }case "$reply" in1) MODE=adhoc ;;@@ -103,7 +126,12 @@ EOTMODE=developeridBUILD=yes;;- *) echo "Enter 1, 2 or 3." ;;+ 4)+ MODE=developerid+ BUILD=yes+ PROFILE=dist+ ;;+ *) echo "Enter 1, 2, 3 or 4." ;;esacdoneecho@@ -207,6 +235,7 @@ if [[ "$ARCH" == both ]]; thenextra=()if [[ "$BUILD" == yes ]]; then extra+=(--build); fiif [[ "$UPLOAD" == yes ]]; then extra+=(--upload); fi+ extra+=(--profile "$PROFILE")for one in arm64 x86_64; doechoecho "################ $one ################"@@ -228,7 +257,8 @@ esac# ci/deploy.sh reads this for both the archive name and which target directory# to take the binaries from.export MACOS_ARCH="$ARCH"-BIN_DIR="target/$RUST_TARGET/release"+export CARGO_PROFILE="$PROFILE"+BIN_DIR="target/$RUST_TARGET/$PROFILE"# `rustc` on PATH is often the one Homebrew installed, and a toolchain from a# package manager carries only its own host's standard library: a cross build@@ -283,11 +313,11 @@ if [[ "$BUILD" == yes ]]; thenecho " toolchain: $(cargo --version) at $(command -v cargo)"echo- echo "==> Building for $ARCH"+ echo "==> Building for $ARCH ($PROFILE profile)"# The same four packages the release workflow builds, which between them# produce all five binaries the bundle carries. Building the whole# workspace instead would compile crates no package ships.- cargo build --release --target "$RUST_TARGET" \+ cargo build --profile "$PROFILE" --target "$RUST_TARGET" \-p wezterm \-p wezterm-gui \-p wezterm-mux-server \@@ -315,8 +345,8 @@ fi# set of binaries. Keep accepting it, so packaging what is already built does# not force a second full build into a target-specific directory.if [[ ! -f "$BIN_DIR/thinkterm-gui" && "$ARCH" == "$HOST_ARCH" &&- -f target/release/thinkterm-gui ]]; then- BIN_DIR=target/release+ -f "target/$PROFILE/thinkterm-gui" ]]; then+ BIN_DIR="target/$PROFILE"fiexport MACOS_BIN_DIR="$BIN_DIR"@@ -328,13 +358,13 @@ for bin in $BINARIES; dodoneif [[ -n "$missing" ]]; thenecho "Missing $ARCH binaries in $BIN_DIR:$missing" >&2- echo "Build them first with 'cargo build --release --target $RUST_TARGET'," >&2+ echo "Build them first with 'cargo build --profile $PROFILE --target $RUST_TARGET'," >&2echo "or re-run with --build to have this script do it." >&2exit 1fiif [[ "$BUILD" == yes ]]; then- echo " release binaries: just built"+ echo " $PROFILE binaries: just built"else# deploy.sh copies each binary independently, so a bundle can quietly carry# binaries from different commits: a partial `cargo build -p wezterm-gui`@@ -351,12 +381,12 @@ elsedonefiif [[ -n "$stale" ]]; then- echo " release binaries: PRESENT BUT OLDER THAN HEAD --$stale"+ echo " $PROFILE binaries: PRESENT BUT OLDER THAN HEAD --$stale"echo " HEAD is $(git log -1 --format='%h %s')"echo " Re-run with --build, or with option 3, unless you know those"echo " binaries do not depend on anything that has changed since."else- echo " release binaries: present, none older than HEAD"+ echo " $PROFILE binaries: present, none older than HEAD"fifi@@ -407,3 +437,7 @@ elseecho "Attach to the release:"echo " $PWD/$zipname"fi+if [[ -f "$zipdir-dSYM.zip" ]]; then+ echo "Symbols for reading crash reports against this build (keep, do not publish):"+ echo " $PWD/$zipdir-dSYM.zip"+fidiff --git a/wezterm-gui/build.rs b/wezterm-gui/build.rsindex 88f8208e..efce8440 100644--- a/wezterm-gui/build.rs+++ b/wezterm-gui/build.rs@@ -1,3 +1,21 @@+/// Where cargo puts this package's executable: the directory three levels+/// above OUT_DIR (`<target>/[<triple>/]<profile dir>/build/<pkg>-<hash>/out`).+/// The `PROFILE` variable cannot name it: a custom profile such as `dist`+/// reports the profile it inherits from, and a `--target` build lands in a+/// per-triple directory that `PROFILE` knows nothing about.+#[cfg(any(windows, target_os = "macos"))]+fn exe_output_dir(repo_dir: &std::path::Path) -> std::path::PathBuf {+ if let Some(out_dir) = std::env::var_os("OUT_DIR") {+ if let Some(dir) = std::path::Path::new(&out_dir).ancestors().nth(3) {+ if dir.is_dir() {+ return dir.to_path_buf();+ }+ }+ }+ let profile = std::env::var("PROFILE").unwrap();+ repo_dir.join("target").join(profile)+}+fn main() {println!("cargo:rerun-if-changed=build.rs");generate_material_icons().expect("generate material file icon lookup tables");@@ -7,12 +25,11 @@ fn main() {use anyhow::Context as _;use std::io::Write;use std::path::Path;- let profile = std::env::var("PROFILE").unwrap();let repo_dir = std::env::current_dir().ok().and_then(|cwd| cwd.parent().map(|p| p.to_path_buf())).unwrap();- let exe_output_dir = repo_dir.join("target").join(profile);+ 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");@@ -154,7 +171,6 @@ END#[cfg(target_os = "macos")]{use anyhow::Context as _;- let profile = std::env::var("PROFILE").unwrap();let repo_dir = std::env::current_dir().ok().and_then(|cwd| cwd.parent().map(|p| p.to_path_buf()))@@ -168,9 +184,7 @@ END.join("ThinkTerm.app").join("Contents").join("Info.plist");- let build_target_dir = std::env::var("CARGO_TARGET_DIR")- .and_then(|s| Ok(std::path::PathBuf::from(s)))- .unwrap_or(repo_dir.join("target").join(profile));+ let build_target_dir = exe_output_dir(&repo_dir);let dest_plist = build_target_dir.join("Info.plist");let src_icon = repo_dir.join("assets").join("icon").join("ThinkTerm.icns");let dest_icon = build_target_dir.join("ThinkTerm.icns");