Skip to content

Windows: native TLS for tsk update and the update check; accept BOM-prefixed JSON plans - #161

Merged
smarzban merged 2 commits into
mainfrom
tsk/t195-windows-https-tsk-update-and
Oct 8, 2026
Merged

smarzban merged 2 commits into
mainfrom
tsk/t195-windows-https-tsk-update-and

Conversation

@smarzban

@smarzban smarzban commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Hotfix for T195. No version bump or release files.

Changes

  • download_https (src/cli/update.rs): set TlsProvider::NativeTls explicitly. ureq 3 defaults to Rustls, which our feature set does not compile in, so the first HTTPS request panicked (tsk update exit 101; the board's update check panicked on every start and printed over the TUI).
  • Update check (src/update.rs): runs on a named tsk-update-check thread; a once-installed panic hook swallows panics on that thread only and forwards every other panic to the previous hook. Check still fails silently.
  • parse_plan (src/cli/mod.rs): strip a leading UTF-8 BOM (Windows PowerShell 5.1 default for Set-Content -Encoding UTF8 / Out-File).
  • CHANGELOG (Unreleased > Fixed) and cli.md note on BOM.

Tests

  • cli::update::tests::windows_download_https_fails_without_panicking_when_the_peer_drops (Windows only, offline: local listener that drops the connection; asserts Err, not a panic). Runs in the default suite on the windows CI jobs.
  • cli::update::tests::windows_download_https_fetches_the_installer_live (Windows only, #[ignore], real fetch of https://www.gettsk.sh/install.ps1; run with -- --ignored).
  • update::tests::quiet_panic_hook_silences_only_the_named_thread.
  • cli_add::plan_with_utf8_byte_order_mark_parses_from_file_and_stdin (file + stdin).

Verification

  • Green bar on macOS: cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test passes. cargo clippy --all-targets --target x86_64-pc-windows-gnu -- -D warnings clean.
  • BOM test fails without the fix (invalid JSON plan: expected value at line 1 column 1).
  • devboxwin (Windows 11 ARM64, MSVC): offline test passes and the ignored live fetch passes on this branch; with .tls_config(tls) removed the offline test fails with the ureq panic at transport/mod.rs:485. Release build tsk update downloads, verifies checksum, and completes (exit 0) instead of panicking. Note: with current == latest it reinstalls v0.11.6 rather than printing "up to date" (existing behaviour, unchanged here).
  • Not run: opening the board on Windows.

ureq 3 defaults to Rustls, which this build does not enable, so tsk update
and the board's update check panicked on Windows. Set NativeTls explicitly,
run the check on a named thread whose panics never print over the TUI, and
strip a leading UTF-8 BOM from JSON plans (Windows PowerShell 5.1 default).
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
herdr-tsk Ignored Ignored Preview Oct 8, 2026 8:32pm UTC

@smarzban

smarzban commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

Pass 1 addressed in 88991ef: the default Windows regression is now offline (127.0.0.1 listener that drops the connection, asserts Err); the live gettsk.sh fetch is #[ignore]. On Windows ARM64 the offline test passes, and with the TLS line removed it still fails with the ureq panic. The ignored live test also passes. Green bar and Windows clippy are clean.

@smarzban
smarzban merged commit 7efb89f into main Oct 8, 2026
8 checks passed
@smarzban
smarzban deleted the tsk/t195-windows-https-tsk-update-and branch October 8, 2026 20:47
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