Accelerated Package Installation via Async Exec Graphs #5
Notifications
Due Date
No due date set.
Depends on
#16 Installation Strategies Redesign
sortedcord/bootstrap
Reference: sortedcord/bootstrap#5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Traditional package managers (
apt,dnf,pacman) are highly synchronous. When bootstrapping a new machine or installing a large batch of tools, the user is forced to wait for sequential operations: resolving package A, downloading A, extracting A, installing A... before moving on to package B.This synchronous nature wastes significant time waiting on Network I/O.
Because the proposed
bootstraparchitecture separates tools intobinary,managed, andsystemstrategies, it naturally unlocks the ability to orchestrate an accelerated, asynchronous installation pipeline.By taking control of the installation pipeline, we can implement an asynchronous, non-blocking execution graph:
1. Concurrent Downloads (Network I/O)
The most time-consuming part of installing multiple CLI tools is waiting for sequential network requests. Since
binarystrategy tools are just raw file downloads from GitHub, these can be perfectly parallelized.curl -Z(parallel transfers) or spawning background processes(download_file ... &), we can rapidly download multiple.tar.gzand.debfiles concurrently into the temporary directory.2. Dependency Sequencing (Blocking vs. Non-Blocking)
We can analyze the installation intent to build an execution graph:
binarytool likelazygithas zero side-effects and depends on nothing. Ten binary tools can be extracted and copied into$BOOTSTRAP_DIR/bin/simultaneously in background subshells.systemstrategy tools (like Docker) require exclusive locks on the native package manager (dpkg/pacman) and must be executed synchronously.managedtools (like Node via NVM) might require their base manager to be installed first.3. Implementation Approach
When a user runs
b upor installs multiple tools at once (e.g.b install lazygit bat zoxide starship yazi), the CLI will execute the following pipeline:binary,system, ormanaged).binaryandmanagedassets in the background.systemstrategy packages to a single blockingpkg_installcommand (sudo apt install package-a package-b) so the OS package manager resolves them efficiently in one transaction.binarytools into$BOOTSTRAP_DIR/bin/.waitin bash to block until all background jobs finish. Finally, sequentially register all successful installations into theregistry.jsonusingflockto prevent race conditions.Outcome
This architecture will make bootstrapping a new machine or batch-installing tools feel incredibly fast, drastically outperforming standard synchronous package managers by saturating network bandwidth and CPU cores during extraction.
improved package batchingto Accelerated Package InstallationAccelerated Package Installationto Accelerated Package Installation via Async Exec Graphs