Skip to content

feat(resolver): deterministic cross-distro library resolution, batch prompts, and elevated extraction limits - #9

Merged
brasga-a merged 1 commit into
mainfrom
feat/host-library-mapping-and-extraction-limits
Sep 19, 2026
Merged

brasga-a merged 1 commit into
mainfrom
feat/host-library-mapping-and-extraction-limits

Conversation

@brasga-a

Copy link
Copy Markdown
Owner

Summary

This PR implements Option A for deterministic, fast, offline, and native resolution of cross-distribution package dependencies and handling of large desktop packages (e.g. Electron apps like ChatGPT):

  1. Canonical Cross-Distro Library, Tool, and SONAME Resolution:
    • In crates/pkg-core/src/resolver/evidence.rs: added canonical_sonames_for_package, canonical_commands_for_package, and canonical_package_equivalents.
    • In crates/pkg-core/src/resolver/mod.rs: resolve_package now recognizes when a package requirement maps to verified host capabilities (shared library SONAMEs on host linker paths, tool commands in /usr/bin, or equivalent packages installed in the native host package manager such as Arch ALPM glibc, alsa-lib, gtk3, gcc-libs, etc.).
    • Strictly preserves invariant INV-007 (nominal match across distros rejected without capability evidence).
  2. Elevated Extraction Limits:
    • In crates/pkg-core/src/format/mod.rs: elevated default ExtractionLimits (max_single_file_bytes: 2 GiB, max_total_bytes: 8 GiB, max_entries: 100,000) so large binaries (like usr/lib/chatgpt/ChatGPT at 315 MiB) extract cleanly without exceeding safety caps.
    • In crates/pkg-core/src/host/elf.rs: auxiliary foreign-architecture ELF prebuilds (e.g. vendored ARM/ARM64 .node prebuilds bundled in multiarch npm modules inside x86_64 packages) are safely skipped during host dynamic library inspection instead of aborting the install.
  3. Consolidated Batch Confirmation UX in CLI:
    • In crates/pkg-cli/src/main.rs: aggregated direct dependency frontier candidates to display a single, clear batch prompt listing required packages/versions/formats (Install these N dependencies automatically? [Y/n]: ) instead of prompting one by one, respecting --yes / -y.

Verification

  • cargo test --workspace passed all unit and integration tests (including INV-007 checks and newly added cross-distro resolver unit tests).
  • cargo fmt --all --check and cargo clippy --workspace --all-targets passed with 0 errors/warnings.
  • Real-world package verification: Successfully extracted and installed chatgpt_amd64.deb (397 MiB deb, 315 MiB binary, 1.33 GiB payload) into store.

@brasga-a
brasga-a merged commit df24786 into main Sep 19, 2026
1 check passed
@brasga-a
brasga-a deleted the feat/host-library-mapping-and-extraction-limits branch September 19, 2026 04:09
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