Skip to content

fix(windows): improve native build support and Git Bash integration#385

Closed
tobitege wants to merge 11 commits intortk-ai:developfrom
tobitege:fix/windows-native-git-bash-support
Closed

fix(windows): improve native build support and Git Bash integration#385
tobitege wants to merge 11 commits intortk-ai:developfrom
tobitege:fix/windows-native-git-bash-support

Conversation

@tobitege
Copy link
Copy Markdown

@tobitege tobitege commented Mar 6, 2026

Hey guys,

I hope this is of use for you, should make build+installation on Windows work better and provide some alternatives to linux tools. Most well explained in the new WINDOWS.md.

Summary

This PR improves the native Windows story for RTK and makes the documented Windows support match what actually works in practice.

The main functional fix is a Windows-specific build configuration change so the native rtk.exe no longer crashes with a stack overflow on startup. On top of that, this PR adds automated CLI coverage for the core tools, adds Git Bash integration coverage on Windows, and documents the difference between "the RTK binary works on Windows" and "some helper scripts and hook-based setup are still Unix-first."

What changed

  • Added a Windows-specific linker stack setting in .cargo/config.toml so native Windows builds start correctly
  • Added CLI smoke tests for:
    • rtk --version
    • rtk ls .
    • rtk read Cargo.toml
    • rtk rewrite "git status"
    • rtk init --show
  • Added Windows-only Git Bash integration tests that verify:
    • the built rtk.exe runs inside Git Bash
    • rtk works from Git Bash via PATH
    • scripts/check-installation.sh works in Git Bash against the built binary
  • Added PowerShell helper scripts for common Windows-local workflows:
    • scripts/install-local.ps1
    • scripts/check-installation.ps1
  • Reworked the Windows documentation in README.md, INSTALL.md, and WINDOWS.md
  • Added .history to .gitignore

Why this matters

Before this change, the repo claimed Windows support in some places, but the real user experience was unclear and incomplete. The core binary was intended to work on Windows, but the install and script story was heavily Unix-oriented, and the Windows binary itself could fail immediately at startup.

This PR makes native Windows support more real and more understandable:

  • the binary now works reliably
  • the main CLI tools are covered by tests
  • Git Bash usage is explicitly tested
  • the docs clearly explain what works natively on Windows and what still depends on Unix-style tooling

Verification

Verified locally on native Windows with:

  • cargo build
  • cargo build --release
  • cargo test --test cli_tools_smoke
  • cargo test --test git_bash_integration

Also verified:

  • .\target\debug\rtk.exe --version
  • .\target\debug\rtk.exe ls .
  • .\target\release\rtk.exe --version
  • .\target\release\rtk.exe ls .

Notes

This PR does not attempt to fully port every Bash script or the hook-first global setup to native Windows. It focuses on the core CLI, practical local Windows workflows, Git Bash compatibility, and documentation clarity.

tobitege and others added 6 commits March 6, 2026 16:10
Fix native Windows startup by setting the MSVC linker stack size in .cargo/config.toml.
Add CLI smoke tests and Git Bash integration tests for the built rtk binary.
Document the Windows install and usage story in README.md, INSTALL.md, and WINDOWS.md.
Add PowerShell helper scripts for local install and installation verification.
Ignore potential local .history directory in .gitignore.

Signed-off-by: tobitege <10787084+tobitege@users.noreply.github.com>
add security check cicd on dev branch PR

Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
fix(cicd): Add security check on dev branch PR
- Add install_method detection (homebrew/cargo/script/nix/other)
- Add tokens_saved_24h and tokens_saved_total to payload
- Add Tracker::total_tokens_saved() and Tracker::tokens_saved_24h() methods
- Point telemetry to new dedicated rtk-telemetry service

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@tobitege
Copy link
Copy Markdown
Author

tobitege commented Mar 9, 2026

Conflict resolved.

@pszymkowiak pszymkowiak force-pushed the develop branch 4 times, most recently from dc20fc4 to cc93afc Compare March 10, 2026 19:59
@tobitege
Copy link
Copy Markdown
Author

Thanks @pszymkowiak - I've fixed the interim 2 file conflicts

Keep the Windows-native branch buildable after refreshing from develop by restoring the missing truncate import in cargo_cmd.rs and relaxing the git command test to accept the absolute Git for Windows path returned on native Windows.

Make the Git Bash smoke suite reliable on Windows by copying the RTK binary out of target before self-hosting cargo commands, and by skipping learn/discover and hook version assertions when local Claude Code project state or hook installation is not present.

Also update the built-in filter fixtures so empty-input expectations match their configured on_empty output, which makes rtk verify pass again during local validation.

Signed-off-by: tobitege <10787084+tobitege@users.noreply.github.com>
@tobitege
Copy link
Copy Markdown
Author

Tests fixed in my branch and build is fine.

Signed-off-by: tobitege <10787084+tobitege@users.noreply.github.com>
@tobitege tobitege closed this Mar 15, 2026
@tobitege tobitege deleted the fix/windows-native-git-bash-support branch April 9, 2026 00: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.

3 participants