Skip to content

feat(build): create vx-runtime-core and vx-runtime-archive (RFC 0032 Phase 2)#604

Merged
loonghao merged 10 commits intomainfrom
rfc-0032-phase2
Feb 18, 2026
Merged

feat(build): create vx-runtime-core and vx-runtime-archive (RFC 0032 Phase 2)#604
loonghao merged 10 commits intomainfrom
rfc-0032-phase2

Conversation

@loonghao
Copy link
Owner

@loonghao loonghao commented Feb 17, 2026

Summary

This PR implements Phase 2 of RFC 0032 (Build Time Optimization) by creating two new crates and integrating them into vx-runtime.

New Crates

1. vx-runtime-core

Lightweight trait crate (~5-8s compile time) containing:

  • Runtime, Provider, ProviderRegistry traits
  • Core types: VersionInfo, InstallResult, ExecutionResult, RuntimeDependency
  • Platform detection: Os, Arch, Platform
  • Ecosystem definitions

2. vx-runtime-archive

Archive extraction utilities (~30-40s compile time) supporting:

  • .tar.gz / .tgz - Gzip compressed tar
  • .tar.xz / .txz - XZ compressed tar
  • .tar.zst / .tzst - Zstandard compressed tar
  • .zip - ZIP archives
  • .7z - 7-Zip archives

Integration

vx-runtime now:

  • Depends on both vx-runtime-core and vx-runtime-archive
  • Re-exports core types and archive utilities
  • Acts as a facade crate for backward compatibility

Expected Benefits

After completing the full migration (subsequent PRs):

  • ~46% faster builds: vx-runtime-core compiles in ~5-8s vs vx-runtime's ~88s
  • Parallel compilation: Providers can start compiling after vx-runtime-core (not vx-runtime)
  • Isolation: Archive handling is isolated and optional

Files Changed

  • New crates: vx-runtime-core, vx-runtime-archive
  • Updated: vx-runtime/Cargo.toml, vx-runtime/src/lib.rs
  • Updated: workspace Cargo.toml

Testing

  • cargo check -p vx-runtime-core -p vx-runtime-archive passes
  • cargo test -p vx-runtime-core -p vx-runtime-archive -p vx-runtime --lib passes (62 tests)
  • ✅ All pre-commit hooks pass (typos, fmt, clippy)

Next Steps (Future PRs)

  1. Update providers to optionally use vx-runtime-core directly
  2. Update vx-resolver to use vx-runtime-core
  3. Benchmark comparison

Related

workspace-hack (RFC 0032 Plan D):

- Add workspace-hack crate managed by cargo-hakari

- Configure .config/hakari.toml for 4 target platforms

- Auto-generate unified dependency declarations

- Add workspace-hack dep to all 80+ workspace crates

vx-runtime refactoring:

- Extract HTTP client to dedicated vx-runtime-http crate

- Remove old impls (context, http_client, installer)

vx-config improvements:

- Refactor types (container, dependencies, env, hooks, remote)

- Enhance remote config with additional fields
… status

- Plan D (workspace-hack): mark as implemented with full details

- Plan E (Wild linker): update to v0.8, still no Windows support

- Plan F (-Z threads): still nightly-only, stabilization delayed from 2024

- Add changelog entries for all changes
- Add hakari generate --diff and manage-deps --dry-run checks in code-quality job

- Add .config/hakari.toml to rust change detection paths

- Add hakari-verify and hakari-generate recipes to justfile
- Convert sevenz-rust to optional dependency with extended-formats feature
- Add conditional compilation for 7z support across all affected crates
- macOS builds now work without 7z support (no lld linker error)
- Windows/Linux can enable 7z support via --features extended-formats
- Update vx-installer, vx-runtime-archive, vx-runtime-http
- Add documentation in docs/fixes/macos-sevenz-build-fix.md
- Fix clippy warning: remove unused mut

Fixes: clang error 'invalid linker name in argument -fuse-ld=lld' on macOS
Ref: https://github.com/dyz1990/sevenz-rust/issues (lld not supported on macOS)
@loonghao loonghao merged commit 5042c58 into main Feb 18, 2026
61 of 62 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

Comments