DEV Community

Cover image for GRPM v0.5.0: 75% Gentoo Coverage — Rapid Development Complete
Andrey Kolkov
Andrey Kolkov

Posted on • Originally published at github.com

GRPM v0.5.0: 75% Gentoo Coverage — Rapid Development Complete

October 2019, Gentoo Forums:

Me: "I'd rather rewrite Portage on Golang."

Reply: "We look forward to you having some work to show another 5 years from now."

forums.gentoo.org

6 years later: 110,000 lines of Go. 7 releases. 75% tree coverage.

This is a follow-up to Why I Rewrote Portage in Go: Introducing GRPM v0.1.0


Rapid Development Complete

Today I'm releasing GRPM v0.5.0 — the final release of the rapid development phase. What started as "let's see how hard this is" became an 8-month sprint from v0.1.0 to v0.5.0:

Version Coverage Key Features
v0.1.0 ~20% Core, SAT solver, autotools
v0.3.0 ~30% PMS compliance, EAPI 0-8
v0.4.0 ~60% CMake, Meson, toolchain-funcs
v0.5.0 ~75% Python, Rust, Go ecosystems

The rapid development phase is now complete.

From here, GRPM enters a new phase: stabilization, code refinement, testing, and bug fixing. No more major feature sprints — the focus shifts to making what exists rock-solid and production-ready.


What's New in v0.5.0

Python Ecosystem Support

Full Python eclass suite implementation:

// internal/ebuild/eclass_python.go
type PythonEclass struct{}

func (e *PythonEclass) ExportedFunctions() []string {
    return []string{
        "python_foreach_impl",
        "python_setup",
        "python_fix_shebang",
        "distutils-r1_src_compile",
        "distutils-r1_src_install",
    }
}
Enter fullscreen mode Exit fullscreen mode

Supported eclasses:

  • python-utils-r1 — Core Python utilities
  • python-single-r1 — Single implementation packages
  • python-r1 — Multi-implementation packages
  • python-any-r1 — Build-time dependencies
  • distutils-r1 — setuptools/flit/poetry builds

Rust Packages (cargo.eclass)

# Rust packages now work out of the box
sudo grpm emerge dev-util/ripgrep
Enter fullscreen mode Exit fullscreen mode

GRPM handles:

  • Crate URI generation for SRC_URI
  • Automatic crate vendoring from DISTDIR
  • .cargo/config.toml generation
  • CFLAGS → RUSTFLAGS conversion
  • CHOST → Rust target triple mapping

Go Packages (go-module.eclass)

# Go packages with EGO_SUM support
sudo grpm emerge app-misc/yq
Enter fullscreen mode Exit fullscreen mode

Features:

  • EGO_SUM parsing and SRC_URI generation
  • Go module cache setup
  • Vendor directory detection
  • GOPROXY=off for offline builds
  • CGO integration with system compilers

Package Sets

# Update entire system
sudo grpm update @world

# System packages only
sudo grpm update @system
Enter fullscreen mode Exit fullscreen mode

Implemented sets:

  • @world — All explicitly installed packages
  • @system — Essential system packages
  • @selected — Packages in /var/lib/portage/world
  • @preserved-rebuild — Packages needing rebuild

Multilib Support

32-bit/64-bit ABI handling:

// internal/ebuild/eclass_multilib.go
var CommonABIs = map[string][]ABIInfo{
    "amd64": {
        {Name: "amd64", LibDir: "lib64", CFlags: ""},
        {Name: "x86", LibDir: "lib32", CFlags: "-m32"},
    },
    // arm64, arm, ppc64...
}
Enter fullscreen mode Exit fullscreen mode

Functions: get_libdir, get_abi_CHOST, multilib_foreach_abi, multilib_is_native_abi

REQUIRED_USE Solver

Automatic USE flag resolution:

// internal/pkg/required_use.go
// Handles: || (any-of), ^^ (exactly-one), ?? (at-most-one)
// Conditionals: flag?, !flag?

expr := "|| ( python_targets_python3_11 python_targets_python3_12 )"
result := ValidateRequiredUse(expr, enabledFlags)
Enter fullscreen mode Exit fullscreen mode

Architecture Recap

GRPM uses SAT-based dependency resolution with Domain-Driven Design:

┌─────────────────────────────────────┐
│  CLI / Daemon Layer                 │
├─────────────────────────────────────┤
│  Application Layer                  │  ← Use cases
├─────────────────────────────────────┤
│  Domain Layer                       │  ← SAT solver, packages
├─────────────────────────────────────┤
│  Infrastructure Layer               │  ← Portage repo, sync, install
└─────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Why SAT solvers? If a valid installation exists, the solver will find it. No heuristics, no "dependency hell" — mathematically guaranteed.


Build System Support

GRPM now handles the three major build systems:

System Coverage Implementation
Autotools ~40% of tree econf, emake
CMake ~15% of tree cmake.eclass with Ninja/Makefiles
Meson ~5% of tree meson.eclass with ninja

Plus language-specific:

  • Python (~10%) — distutils-r1
  • Rust (~3%) — cargo.eclass
  • Go (~2%) — go-module.eclass

Combined: ~75% of Gentoo package tree.


Performance: Still Fast

GRPM uses coregex for regex operations:

Operation stdlib regexp coregex Speedup
Compile 5,100 ns 23 ns 221x
Match 185 ns 1.5 ns 123x

For a package manager parsing thousands of ebuilds, this matters.


Technical Stats

Metric v0.1.0 v0.5.0
Lines of Code ~60,000 ~110,000
Internal Packages 15 20
Test Coverage ~70% ~70%
Tree Coverage ~20% ~75%

Key Dependencies

Library Purpose
gophersat SAT solver (pure Go)
mvdan.cc/sh Bash interpreter
coregex Fast regex
modernc.org/sqlite Pure Go SQLite
gokrazy/rsync Native rsync

All pure Go — no CGO required.


What Was Fixed Since v0.1.0

Every limitation from the initial release has been addressed:

v0.1.0 Limitation Status
"Autotools only" ✅ CMake, Meson added (v0.4.0)
"Limited eclass support" ✅ 15+ eclasses (v0.3.0-v0.5.0)
"No EAPI 8" ✅ Full EAPI 0-8 (v0.3.0)
"No CMake/Meson" ✅ Full support (v0.4.0)
"No Python packages" ✅ distutils-r1 (v0.5.0)
"No Rust packages" ✅ cargo.eclass (v0.5.0)
"No Go packages" ✅ go-module.eclass (v0.5.0)

Quick Start

# Download latest release
wget https://github.com/grpmsoft/grpm/releases/latest/download/grpm_linux_amd64.tar.gz
tar -xzf grpm_linux_amd64.tar.gz
sudo install -m 0755 grpm /usr/bin/grpm

# Sync and use
sudo grpm sync
grpm search firefox
sudo grpm emerge --pretend app-misc/hello
Enter fullscreen mode Exit fullscreen mode

What's Next: Stabilization Phase

The rapid development phase is complete. No more feature sprints.

The next phase focuses on:

  1. Bug Fixing — Edge cases, error handling, hardening
  2. Code Quality — Refactoring, cleanup, documentation
  3. Testing — Unit tests, integration tests, real Gentoo systems
  4. Performance — Optimization for large dependency graphs
  5. Community Feedback — Issues, bug reports, real-world usage

v1.0.0 will be released when the community validates it's production-ready. No artificial deadlines — quality comes first.


Links


From forum skepticism to 75% coverage in 6 years. The rapid development sprint is done — now comes the careful work of stabilization. Sometimes the best response to "we'll see in 5 years" is shipping code, then polishing it until it shines.

Top comments (0)