Skip to content

feat(providers): add tokei provider + close stale issues#773

Merged
loonghao merged 5 commits intomainfrom
chore/triage-issues
Apr 7, 2026
Merged

feat(providers): add tokei provider + close stale issues#773
loonghao merged 5 commits intomainfrom
chore/triage-issues

Conversation

@loonghao
Copy link
Copy Markdown
Owner

@loonghao loonghao commented Apr 7, 2026

Summary

tokei Provider

tokei has an unusual asset naming convention — the filename contains the Rust target triple but no version number (tokei-{triple}.tar.gz), and Windows ships a direct .exe binary instead of a zip archive. This required a custom download_url with an explicit platform→triple mapping table.

Platform support:

Platform Triple Format
windows/x64 x86_64-pc-windows-msvc .exe
windows/x86 i686-pc-windows-msvc .exe
macos/x64 x86_64-apple-darwin .tar.gz
macos/arm64 aarch64-apple-darwin .tar.gz
linux/x64 x86_64-unknown-linux-musl .tar.gz
linux/arm64 aarch64-unknown-linux-gnu .tar.gz

Tests: 10 starlark logic tests + 7 runtime tests (all passing).

Closed Issues

Issue Reason
#14 Homebrew provider fully implemented in crates/vx-providers/brew/
#275 Lifecycle hooks (post_extract_*, pre_run_*) implemented in vx-starlark/stdlib/layout.star
#279 Docs auto-generation configured via .github/workflows/docs.yml + VitePress
#284 Telemetry implemented in crates/vx-metrics/ with full OpenTelemetry stack
#285 Container deployment configured with multi-stage Dockerfile + docker-publish.yml
#286 Release strategy configured with release-please + cargo-dist (v0.8.21)

Test plan

  • cargo test -p vx-provider-tokei — all 17 tests pass
  • cargo build -p vx-provider-tokei — compiles cleanly

loonghao added 3 commits April 8, 2026 00:54
Implements tokei provider (#663) with full platform support:
- Windows x64/x86: direct .exe binary download
- macOS x64/arm64: .tar.gz archive
- Linux x64/arm64: .tar.gz archive (musl/gnu triples)

Asset format uses Rust target triple without version number in filename,
which differs from most providers and requires a custom download_url.
Includes starlark logic tests (10) and runtime tests (7).
tokei has never released a native aarch64-apple-darwin binary.
Remove macos/arm64 from the platform map so download_url returns None
on Apple Silicon, letting vx report the platform as unsupported rather
than attempting a 404 download.

Update the starlark test to assert None is returned for macos/arm64.
- Rewrite install_layout using explicit __type dicts (like dust/rcedit)
  instead of binary_layout/archive_layout helpers, ensuring vx correctly
  handles both the Windows .exe binary_install and Unix .tar.gz archive
- Restore macos/arm64 with x86_64-apple-darwin fallback (Rosetta 2),
  matching the pattern used by the dust provider
- Windows: binary_install into bin/, get_execute_path → install_dir/bin/tokei.exe
- Unix: archive at root, get_execute_path → install_dir/tokei
- Update tests: 13 passing, including arm64 Rosetta 2 and layout type checks
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.59%. Comparing base (f2d4349) to head (7f73dcd).
⚠️ Report is 303 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #773      +/-   ##
==========================================
- Coverage   55.36%   53.59%   -1.78%     
==========================================
  Files         528      373     -155     
  Lines       63045    65578    +2533     
==========================================
+ Hits        34907    35144     +237     
- Misses      28138    30434    +2296     
Flag Coverage Δ
unittests 53.59% <ø> (-1.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 438 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

loonghao added 2 commits April 8, 2026 02:49
tokei v12.1.2 x86_64 binary fails to run via Rosetta 2 on macOS arm64
due to TLS (thread-local storage) compatibility issues in the old binary.

Replace the Rosetta 2 fallback with Homebrew as the system_install strategy
for macOS. This provides a native arm64 binary on Apple Silicon via brew,
while macOS x64 still uses the direct GitHub release download.

On macOS arm64: download_url returns None, vx falls back to brew install.
On macOS x64: direct download of x86_64-apple-darwin.tar.gz.
vx parses system_install as a static variable (dict), not a function.
Change from `def system_install(ctx, version):` to the correct
`system_install = system_install_strategies([...])` variable form,
matching the pattern used by cmake, bash, and other providers.
@loonghao loonghao merged commit f1077a1 into main Apr 7, 2026
84 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.

[Provider] Add tokei - code statistics / line counter

1 participant