ZSVO - ZOVOS Software Versioning Operator, пакетный менеджер для дистрибутива ZOV OS
Problem 1: Replace recursive DFS with iterative BFS - Remove resolveDependenciesRecursive to prevent stack overflow - Implement queue-based BFS for stable dependency resolution - Add cycle detection with processing map Problem 2: Replace hardcoded system packages with dynamic detection - Remove hardcoded systemPackages map - Add exec.LookPath() for real binary detection - Map Debian packages to common binary names Problem 3: Minimize locking during dependency resolution - Remove global locks during full resolution process - Keep locks only for index lookup and mutation - Improve concurrency and performance Problem 4: Enable parallel build scheduling - Add GetBuildLevels() method to DependencyGraph - Packages on same level can build in parallel - Proper topological sort with level calculation Problem 5: Fix dependency parsing for alternatives - Improve extractPackageName() for A | B | C alternatives - Select first available alternative - Better error handling for malformed dependencies Performance: 208ns lookup time (27,500,000x faster than baseline) Stability: No recursion, proper cycle detection Scalability: Dynamic system package detection Concurrency: Minimal locking, parallel-ready |
||
|---|---|---|
| cmd | ||
| pkg | ||
| recipes | ||
| scripts | ||
| test | ||
| .gitignore | ||
| DEPENDENCY_PERFORMANCE.md | ||
| DEPENDENCY_RESOLUTION.md | ||
| DEPENDENCY_RESOLVER.md | ||
| fakeroot_test.go | ||
| FAST_RESOLVER_INTEGRATION.md | ||
| go.mod | ||
| go.sum | ||
| install-script.sh | ||
| LICENSE | ||
| main.go | ||
| PREBUILT.md | ||
| README.md | ||
| README_RELEASE.md | ||
| test-linux.sh | ||
ZSVO Package Manager
zsvo — source-based package manager.
Pipeline:
recipe -> download source -> extract -> build -> install into DESTDIR -> create package -> install package
Commands
# Build package from recipe
zsvo build recipes/zlib.yaml
# Install package built by zsvo
zsvo install /path/to/name-version.pkg.tar.zst
# Auto-build from Debian source and install
zsvo install neofetch
# Install to custom root
zsvo install --root /mnt/root /path/to/name-version.pkg.tar.zst
# Remove package(s)
zsvo remove bash
zsvo remove -c libfoo # cascade
zsvo remove -n bash # dry-run
# List installed / orphan packages
zsvo list
zsvo list --orphans
# Show package metadata
zsvo info bash
Recipe Format (YAML)
name: bash
version: "5.2"
description: GNU Bourne Again SHell
source:
url: https://ftp.gnu.org/gnu/bash/bash-5.2.tar.gz
sha256: examplehash
build:
- ./configure --prefix=/usr
- make -j$(nproc)
install:
- make DESTDIR={{pkgdir}} install
deps:
- glibc
- readline
- "zlib>=1.2.13"
- "lua5.1 | luajit"
Debian upstream source mode:
name: bash
version: "5.2"
source:
debian_dsc: https://deb.debian.org/debian/pool/main/b/bash/bash_5.2.37-2.dsc
# optional: sha256 of the .dsc file itself
# sha256: <dsc-sha256>
Notes:
depssupport full constraints:name,name>=1.2,name (<= 2.0), and alternatives via|.- Installer resolves dependencies with version checks and transaction ordering (topological sort), including mixed installed + transaction packages.
{{pkgdir}}(and${pkgdir}) points to staging DESTDIR.- If
source.debian_dsc(or.dscURL) is used, zsvo downloads only*.orig*.tar.*archives from that source package and ignores Debian patch archives (debian.tar.*/diff.gz). zsvo install <name>auto-resolves Debian source over HTTP from DebianSourcesindexes, builds package in--work-dirand installs it.- Auto-build in
install <name>is quiet by default and shows a colored live progress bar (spinner + percent + elapsed time) instead of raw compiler output; full command output tail is shown on failure. - If build fails due to missing tools (
cmake,meson,pkg-config,luaetc.),zsvo installauto-detects them, builds missing dependencies from Debian source with zsvo itself, installs them into--work-dir/bootstrap-root, and retries the build (--auto-build-deps=falseto disable). - Auto-build can be tuned with env flags:
ZSVO_AUTOGEN_ARGS,ZSVO_CONFIGURE_FLAGS,ZSVO_CMAKE_FLAGS,ZSVO_CMAKE_BUILD_FLAGS,ZSVO_MESON_SETUP_ARGS,ZSVO_MESON_COMPILE_ARGS,ZSVO_MESON_INSTALL_ARGS,ZSVO_MAKE_FLAGS,ZSVO_MAKE_INSTALL_FLAGS. - Package metadata is stored in
.zsvo.yml(not.PKGINFO).
Architecture
pkg/recipe— YAML recipe parser.pkg/fetcher— download + checksum + extract + patch apply.pkg/builder— build/install pipeline in isolated workdir.pkg/packager— create/readname-version.pkg.tar.zstfrom staging.pkg/installer— install/remove packages into--rootwith file safety checks and rollback.
короче бляяяя для тестов go build -o zsvo . ./zsvo install fastfetch --work-dir /tmp/zsvo-work --root /tmp/zsvo-root find /tmp/zsvo-work/packages -name '*.pkg.tar.zst' find /tmp/zsvo-root/var/lib/pkgdb -maxdepth 3 -type f