Skip to content

build(install): support Cargo source installation on all platforms - #16

Merged
mizorewww merged 23 commits into
mainfrom
feat/cargo-install
Sep 20, 2026
Merged

mizorewww merged 23 commits into
mainfrom
feat/cargo-install

Conversation

@mizorewww

@mizorewww mizorewww commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Source installation previously required a manual checkout/build workflow, and CI only packaged build outputs. This change documents one native Cargo Git install command for Linux, macOS and Windows and makes each of the six CI platforms install and package the result through Cargo.

  • Use the pinned Rust toolchain, --locked, explicit package/binary selection, and Cargo's normal release profile and installation tracking. Vendored Lua is now an explicit root dependency feature.
  • Exercise a clean Git checkout at the exact CI revision, including repository-local dependency patches. Reuse a dedicated Cargo installation target directory, separated from workspace build-script artifacts, and package the installed binary, preserving the current release matrix and version checks.
  • Derive Git source display versions from commit height, with CI overrides and the archive fallback retained. Ignore Cargo checkout markers so unmodified Git installs have a clean source identity. Document source update/uninstall, branch/revision selection, native prerequisites, install roots and application credentials in English and Simplified Chinese; keep the README entry concise.
  • Preserve subprocess output and exit status in the existing session concurrency check so native platform failures report an actionable cause.
  • Backport libSQL's upstream close-ownership fix (PR tursodatabase/libsql#2282, revision 0070ff3331cd6d09425b812e1cd3ebe32e1d4206) to the published 0.9.30 Rust crate. Native Windows ARM64 testing exposed a 0xc0000005 process exit, matching upstream issue #2251's repeated sqlite3_close_v2 call on freed memory. Keep the database engine/version unchanged, preserve licenses and provenance, and run the upstream focused regression in CI. Remove the backport when a stable release includes the fix.

Validation: 181 application tests, the upstream close-once regression, strict application Clippy, rustfmt, actionlint, Wiki language parity/local links, and application diff whitespace checks passed. Original vendored formatting is retained. A real Cargo install from the pushed Git branch and an update to its next revision both passed on Apple-silicon macOS. Verified the installed executable, clean version/commit identity, --help, and Cargo source tracking. With the upstream backport, native Cargo installation and packaging passed on Linux x86_64/ARM64, macOS Intel/ARM64 and Windows x64/ARM64 in CI.

Stacked on #15 (feat/nerd-font). Uses Cargo's installer; the existing libSQL dependency has a bounded source patch until the upstream fix is released.

Run dialog, history, send, link, button and read requests in a bounded JoinSet while one coordinator owns worker state. Preserve the in-flight update future across command and completion branches, and abort child tasks when their owner exits.

Protect history and dialog snapshots against newer live changes. Start the update stream before the initial dialog request and stop truncating catch-up payloads.

Validation: cargo fmt --all -- --check; cargo clippy --locked --all-targets --all-features -- -D warnings; cargo test --locked --all-targets --all-features (151 tests). Live Telegram latency has not been measured.
Follow Telegram startup recovery guidance: begin with the common difference and let channel gap notifications request targeted recovery. Preserve a known local channel PTS when updateChannelTooLong carries a newer remote PTS.

Patch grammers-session 0.10.0 at upstream 5c6d44ff30e02d6c9295bcf1fcb51403ad77c981. Keep the original recovery engine and upstream tests; adjust the connection-flow assertion.

Validation: fmt, strict all-targets clippy, and all-feature tests (153 tests), including a 500-channel startup and local-cursor gap regression.
Keep account-local messages, dialogs, attachment locations and complete update checkpoints in SQLite. Serve cached histories while the network worker connects and reconcile history snapshots without undoing newer edits or deletions. Clear cache content when the authenticated account changes or Telegram invalidates an old message range.

Use libSQL already present in the dependency graph and retain rollback journaling. Vendor grammers-client 0.10.0 at 5c6d44ff30e02d6c9295bcf1fcb51403ad77c981 to expose whole update batches, restore application-owned cursors and report too-long differences. Preserve original licenses and record adaptations in vendor/README.md.

Validation: formatting, strict Clippy and all-target/all-feature tests (156 tests), including restart, rollback, account isolation, complete-batch delivery and offline application navigation.
Keep startup commands bounded until authentication completes, clear stale account state and queued operations on identity changes, and consistently settle failed requests. Persist the initial update checkpoint even when a session receives no live messages.

Drive active group recovery through a watch channel and the existing Grammers message-box engine. Respect the server timeout, stop short polling on focus changes, and never advance a known cursor when activating a group.

Validation: strict Clippy, formatting, 157 application/integration tests and all 20 upstream grammers-session library tests. No logged-in latency benchmark was performed.
Reuse Yazi key parsing with declarative mlua configuration, message counts,
chords, stable chat aliases and effective-binding help. Fetch older history
pages on demand and cache only explicitly complete page boundaries.

Derive configurable composer ghost text from the active bindings and remove
repeated composer labels. Include bilingual configuration documentation.

Validation: formatting, strict all-target/all-feature Clippy, 157 tests.

BREAKING CHANGE: j/k navigate messages; use arrows for rendered rows.
Use gg/Home for the oldest loaded message and G/End for the latest page.
Cache folder rules and order per account, retain pinned ordering, and navigate folders without losing conversation drafts. Refresh metadata after remote changes and apply incoming unread counts. Reuse Grammers raw API methods and follow Telegram Desktop membership precedence.

Validation: formatting, strict Clippy, and 159 tests.
Add scoped local search, cancellable bounded background scans, result pagination, cache coverage and validated cached context. Preserve queries, drafts and unread state during historical navigation. Document the controls in English and Simplified Chinese.

Validation: formatting, strict Clippy, and 161 tests.
Add a named ANSI color picker, terminal-default chat foreground and stable folder colors. Keep Lua defaults and managed per-account overrides separate, and reuse the atomic settings writer. Preserve preferences across cache resets and document precedence in both languages.

Validation: formatting, strict Clippy, and 163 tests.
Bind O to reveal originals, reusing full previews or downloading before reveal. Track media IDs and request generations so edits and deletes reject stale transfers. Reuse tempfile for partial-file cleanup and preserve account cache ownership through background tasks.

Bound completed media and cache metadata retention. Document platform behavior, cache paths and the O to g o binding migration in English and Simplified Chinese.

Validation: formatting, strict Clippy, and 167 tests.
Track the actual last-message ID instead of deriving previews from a bounded history window. Clear deleted previews, refresh authoritative dialog state, and preserve intervening changes across slower snapshots. Seed startup watermarks and count cached incoming messages only once.

Validation: formatting, strict Clippy, and 169 tests.
Support fixed Lua navigation counts and restore QR login key routing. Derive controls from effective bindings, preserve composer state when toggling overlays, and keep primary search controls visible on narrow terminals.

Validation: formatting, strict all-target Clippy, and all-target/all-feature tests (172 passed).
Move detailed setup, configuration, keybindings, workflows, terminal behavior, releases, and architecture into matching English and Simplified Chinese Wiki sources. Add a small flat-page exporter and CI link/parity validation.

Validation: 27 source pages, 28 exported pages, internal links and all 48 actions checked in both languages. No runtime code changes.
Keep main, archive, and custom-folder pin orders independent, persist server pins, and add native pin/reorder and archive/restore actions. Preserve chat selection and resolve aliases through the correct folder.

Apply custom-filter edits to fresh server objects and preserve explicit membership when unpinning, following Telegram Desktop 4d4da471fbee771c10e173a83c003ba1728989f1 data/data_chat_filters.cpp. Archived chats live in Archive and are excluded from All chats.

Validation: 174 tests pass, strict Clippy, cargo fmt, Wiki language/link validation and git diff --check. Live Telegram mutations were not exercised.
Add cached pinned-message pages, a compact conversation banner, and navigation to pinned context without marking unseen history read. Keep private-chat and group pin options explicit, support unpin/all, and coalesce background refreshes alongside live updates.

Preserve live unpins, edits and deletions across stale requests, keep account/cache retention boundaries, and document contextual Lua actions in English and Simplified Chinese. Follow Telegram Desktop 4d4da471fbee771c10e173a83c003ba1728989f1 pin-message dialog behavior.

Validation: 178 tests, strict Clippy, formatting and 29-page bilingual Wiki validation passed; cache regressions passed again after retention integration. Live account mutations were not exercised.
Discard pin-page and context revisions when Telegram invalidates cached
history. Clear stale previews and confirmations, reload open pin lists,
and invalidate worker metadata refreshes before recovery starts.

Keep drafts, unrelated chats and in-flight mutations intact. Validate with
180 tests, including channel/global invalidation and stale read results,
strict Clippy, formatting and bilingual Wiki checks.
Add an opt-in glyph adapter for chats, folders, pins and attachments.
Keep semantic labels and default plain-font output, and reuse existing
Unicode cell layout. Document terminal font selection in both languages.

Validate with 181 tests, strict Clippy, formatting and Wiki parity/link
checks. No font assets or additional dependencies are included.
Document one Cargo Git command for Linux, macOS and Windows, including
pinned toolchains, native build prerequisites, install roots and updates.
Make vendored Lua explicit and report commit-height versions for Git builds.

Install and package each CI release through Cargo from a clean Git revision,
exercising repository patches, locked dependencies and installation tracking
on all six native platforms. Retain release version and credential overrides.

Validate with 181 tests, strict Clippy, formatting and bilingual Wiki checks.
A Git install using the workspace target directory reused an older release build-script executable. Keep installation artifacts in target/cargo-install so cached workspace metadata cannot enter the Git installation pipeline. Validate workflow syntax and bilingual documentation.
Cargo creates an untracked .cargo-ok marker in fetched Git checkouts. Ignore that generated marker so an unmodified source installation is not labeled dirty, and document that the checkout branch can differ from the requested Git branch.
Windows ARM64 fails the multi-process session check before native Cargo installation, but the existing assertion discards subprocess output and exit status. Capture both output streams and report every failed writer after reaping all children so platform failures are actionable.

Validation: the session concurrency integration test, targeted strict Clippy, formatting and diff whitespace checks pass on macOS arm64.
Native Windows ARM64 installation validation exposed a session writer access violation (0xc0000005). libSQL 0.9.30 closes its local SQLite handle twice through nested destructors, matching upstream issue #2251.

Vendor the published Rust crate and backport upstream PR #2282 at 0070ff3331cd6d09425b812e1cd3ebe32e1d4206, including its focused ownership regression. Preserve licenses, source formatting and dependency versions. The PR Git revision would otherwise require the unrelated 0.10.0-pre.4 database engine upgrade. Document removal once a stable release contains the fix.

Validation: 181 application tests and the upstream close-once regression pass on macOS arm64; strict application Clippy, formatting, actionlint and Wiki checks pass. CI now runs the upstream regression in addition to native multi-process session checks. Original vendored whitespace is retained.
@mizorewww
mizorewww changed the base branch from feat/nerd-font to main September 20, 2026 12:43
@mizorewww
mizorewww merged commit 5f58505 into main Sep 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant