feat(providers): add tokei provider + close stale issues#773
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/vx-providers/tokei/) — closes [Provider] Add tokei - code statistics / line counter #663tokei 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.exebinary instead of a zip archive. This required a customdownload_urlwith an explicit platform→triple mapping table.Platform support:
x86_64-pc-windows-msvc.exei686-pc-windows-msvc.exex86_64-apple-darwin.tar.gzaarch64-apple-darwin.tar.gzx86_64-unknown-linux-musl.tar.gzaarch64-unknown-linux-gnu.tar.gzTests: 10 starlark logic tests + 7 runtime tests (all passing).
Closed Issues
crates/vx-providers/brew/post_extract_*,pre_run_*) implemented invx-starlark/stdlib/layout.star.github/workflows/docs.yml+ VitePresscrates/vx-metrics/with full OpenTelemetry stackdocker-publish.ymlTest plan
cargo test -p vx-provider-tokei— all 17 tests passcargo build -p vx-provider-tokei— compiles cleanly