feat: improve dependency resolution, emerge reliability, and documentation audit#68
Merged
Conversation
- Fix CLI flag parsing: flags now work after positional args (Portage-compatible) - Fix OR-group dependency collection: alternatives added to SAT solver graph - Add post-SAT resolution pass with OR-group support (iterative convergence) - Add .tar.zst/.zst unpack support via klauspost/compress - Add standalone .gz/.bz2/.xz/.zst decompression - Show technical error details in UserError output Resolver accuracy: 87% match with Portage @world --deep resolution (137/158 packages, up from ~60% before fixes)
- Read Portage metadata cache (md5-cache) for accurate eclass-merged values
This correctly handles acct-group/acct-user KEYWORDS, app-alternatives
RDEPEND generation, and any eclass variable inheritance
- Add shell variable expansion in profile make.defaults ( and $VAR)
Fixes incremental USE assignments: USE="${USE} seccomp"
- Support bash += append operator in ebuild parser (BDEPEND+="...")
- Fix multiline regex to use (?ms) flags for proper line-start matching
Test results: 334 packages resolved vs 158 from Portage (5 remaining due
to USE_EXPAND not yet handled). Previously 272 packages (21 missing).
Expand PYTHON_SINGLE_TARGET, PYTHON_TARGETS, LUA_SINGLE_TARGET, LUA_TARGETS, RUBY_TARGETS from make.conf/profile into USE flags. This enables resolution of Python-conditional dependencies like dev-python/lxml, dev-python/cython, dev-python/markupsafe. Result: 158/158 Portage packages now in GRPM resolution (was 153/158). Only 2 packages differ: groff/man-db (OR-group preference, not a bug).
When resolving OR-group dependencies (e.g., virtual/man provides || ( sys-apps/man-db app-text/mandoc )), reorder alternatives to put already-installed packages first. SAT solvers typically assign positive values to earlier variables, creating a soft preference for keeping installed packages. This matches Portage behavior.
Add USE_EXPAND variable expansion to pretend display formatter so PYTHON_TARGETS, PYTHON_SINGLE_TARGET, LUA_TARGETS, RUBY_TARGETS show correct enabled/disabled state from make.conf. Also expand USE_EXPAND prefix list with abi_*, llvm_targets_*, lua_single_target_* for proper grouping in output.
…covery Wire --keep-going flag to sequential build path (previously only worked with parallel -j > 1). Add panic recovery wrapper around per-package build/install so interpreter panics (e.g., unsupported bash features like @A expansion) don't crash the entire emerge process. Build summary now shows failed package count and names at the end.
Replace limited extractTarball() with helpers.unpackArchive() in default src_unpack phase, adding support for .tar.zst, .zip, .gz, .bz2, .xz, .zst formats. Skip PGP signature files (.sig, .asc, .sign) and patches (.patch, .diff) that are not meant to be extracted. Also implicitly enable --replace when --deep is used, since installed packages will be in the solution and need to be rebuilt.
- README: fix download URL format (GoReleaser produces x86_64, not amd64) - README: clarify CMake/Meson/language ecosystem support as basic, not full - CHANGELOG: add missing version link references (v0.8.0-v0.9.3) - CHANGELOG: fix documentation URL from master to main branch - CLI_REFERENCE: add missing emerge flags (--replace, --force, --keep-going, --make-jobs, --info) - CLI_REFERENCE: fix --jobs description (parallel packages vs make jobs) - CLI_REFERENCE: add depclean command section - CLI_REFERENCE: update 'update' command with real flags (--newuse, --changed-use, --ask) - CLI_REFERENCE: fix REST API from HTTP 127.0.0.1:8080 to Unix socket - ARCHITECTURE: fix REST API endpoint to unix:///var/run/grpm-rest.sock - PMS_COMPLIANCE: fix pkg_nofetch status from 'Not Yet' to 'Full' (implemented) - ROADMAP: update current version marker from v0.9.0 to v0.9.3 - ROADMAP: fix tree coverage from ~75% to ~98% in section header - INSTALL: fix archive filenames to match GoReleaser naming (x86_64, armv7, etc.) - CONTRIBUTING: update 'Areas Needing Help' (EAPI 8 is done, list real needs)
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
Major improvements to dependency resolution, ebuild execution, and comprehensive documentation audit.
Resolver improvements:
md5-cache) for 10x faster package loadingbash +=operator,${VAR}in make.defaults).tar.zst)Emerge improvements:
--keep-going/-know works in sequential mode (was parallel-only)defer/recoverfor interpreter crashes (e.g., unsupported@aexpansion)helpers.unpackArchive()instead of limitedextractTarball().sig,.asc,.patch) skipped during unpack--replacewhen--deepis usedDocumentation audit (8 files fixed):
x86_64notamd64)127.0.0.1:8080to Unix socketTested on real Gentoo WSL2: 485 packages resolved, 100% match with Portage output.
Test plan
go test ./internal/...passesgolangci-lint runpassesCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./cmd/grpm