|
| 1 | +# UPSTREAM - Portage Reference Tracking |
| 2 | + |
| 3 | +This file tracks the upstream Portage package manager and PMS specification |
| 4 | +that GRPM implementation is based on. |
| 5 | + |
| 6 | +## Primary References |
| 7 | + |
| 8 | +### Package Manager Specification (PMS) |
| 9 | +URL: https://projects.gentoo.org/pms/ |
| 10 | +Version: PMS 8 (EAPI 8) |
| 11 | +Date: 2024-05-01 (last major update) |
| 12 | +Status: Fully supported (EAPI 0-8) |
| 13 | + |
| 14 | +### Portage (Reference Implementation) |
| 15 | +Repository: https://github.com/gentoo/portage |
| 16 | +Branch: master |
| 17 | +Commit: [`f41f766f3e`](https://github.com/gentoo/portage/commit/f41f766f3e1d0c60c34e4cb6a9e6b06c67d18fe1) |
| 18 | +Date: 2026-01-14 |
| 19 | + |
| 20 | +### Gentoo Repository (Ebuilds) |
| 21 | +Repository: https://github.com/gentoo/gentoo |
| 22 | +Sync: Via `grpm sync` or `emerge --sync` |
| 23 | +Note: Eclasses loaded dynamically, no tracking needed |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Upstream Sync History |
| 28 | + |
| 29 | +### Latest Sync: 2026-01-17 |
| 30 | + |
| 31 | +**Commit**: [`f41f766f3e`](https://github.com/gentoo/portage/commit/f41f766f3e1d0c60c34e4cb6a9e6b06c67d18fe1) |
| 32 | +**Local Ref**: `f41f766f3e` (synced) |
| 33 | +**Commits Synced**: 11 commits |
| 34 | + |
| 35 | +#### Notable Changes Reviewed |
| 36 | + |
| 37 | +| Commit | Description | Impact | |
| 38 | +|--------|-------------|--------| |
| 39 | +| `0783d82` | **EAPI 9 enabled** | NEW EAPI! | |
| 40 | +| `d466b96` | Scheduler: implicit jobserver slot support | Low | |
| 41 | +| `a3f0843` | Scheduler: fix error handling typo | None | |
| 42 | +| `faaf697` | gpkg: checksum_helper improvements | Low | |
| 43 | + |
| 44 | +#### EAPI 9 Features (Bug #965922) |
| 45 | +- Profile EAPI defaults to top-level |
| 46 | +- `use.stable` and `package.use.stable` support |
| 47 | +- PMS special profile variables handling |
| 48 | +- `FEATURES=export-pms-vars` |
| 49 | + |
| 50 | +#### Tasks Created |
| 51 | +- **v0.9.0-001**: Add EAPI 9 support (HIGH) |
| 52 | +- Review: https://wiki.gentoo.org/wiki/Future_EAPI/EAPI_9_tentative_features |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +### Previous Sync: 2026-01-07 |
| 57 | + |
| 58 | +**Commit**: [`af1ba8bc34`](https://github.com/gentoo/portage/commit/af1ba8bc34153e10b667482036774faac630dcc9) |
| 59 | +**Version**: portage-3.0.75 |
| 60 | + |
| 61 | +#### Features Referenced |
| 62 | +- action_info() implementation (v0.8.2) |
| 63 | +- package.mask loading logic (v0.8.1) |
| 64 | +- KEYWORDS filtering (v0.8.1) |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Implementation Notes |
| 69 | + |
| 70 | +GRPM is a **Go reimplementation**, not a Python port or wrapper. |
| 71 | + |
| 72 | +### Approach |
| 73 | +- PMS specification as primary reference for behavior |
| 74 | +- Portage source code consulted for edge cases |
| 75 | +- Go idioms preferred over Python patterns |
| 76 | +- Independent test suite with real Gentoo repository validation |
| 77 | + |
| 78 | +### Key Differences from Portage |
| 79 | +1. **Language**: Go vs Python |
| 80 | +2. **Bash Execution**: mvdan.cc/sh interpreter vs subprocess |
| 81 | +3. **Dependency Resolution**: SAT solver vs backtracking |
| 82 | +4. **Architecture**: Single binary vs Python package |
| 83 | +5. **Daemon Mode**: gRPC/REST API vs D-Bus |
| 84 | + |
| 85 | +### Feature Parity Status |
| 86 | + |
| 87 | +| Feature | Portage | GRPM | Notes | |
| 88 | +|---------|---------|------|-------| |
| 89 | +| Dependency Resolution | ✅ | ✅ | SAT-based | |
| 90 | +| Package Masks | ✅ | ✅ | v0.8.1 | |
| 91 | +| KEYWORDS Filtering | ✅ | ✅ | v0.8.1 | |
| 92 | +| USE Flags | ✅ | ✅ | Full support | |
| 93 | +| Slots/Subslots | ✅ | ✅ | Full support | |
| 94 | +| Binary Packages | ✅ | ✅ | GPKG + TBZ2 | |
| 95 | +| emerge --info | ✅ | ✅ | v0.8.2 | |
| 96 | +| emerge --pretend | ✅ | ✅ | With USE flags | |
| 97 | +| Sandboxing | ✅ | ❌ | Planned v1.0.0 | |
| 98 | +| preserved-rebuild | ✅ | Partial | Basic support | |
| 99 | +| news system | ✅ | ❌ | Not planned | |
| 100 | +| elog system | ✅ | Partial | Basic support | |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## Files to Monitor in Portage |
| 105 | + |
| 106 | +When syncing with upstream, focus on these files: |
| 107 | + |
| 108 | +``` |
| 109 | +lib/_emerge/actions.py # emerge commands (info, pretend, etc.) |
| 110 | +lib/_emerge/resolver/ # Dependency resolution |
| 111 | +lib/_emerge/Package.py # Package model |
| 112 | +lib/portage/dbapi/ # Database API |
| 113 | +lib/portage/package/ebuild/ # Ebuild execution |
| 114 | +lib/portage/dep/ # Dependency parsing |
| 115 | +lib/portage/versions.py # Version comparison |
| 116 | +lib/portage/eapi.py # EAPI features |
| 117 | +lib/portage/repository/ # Repository handling |
| 118 | +lib/portage/sync/ # Sync modules |
| 119 | +``` |
| 120 | + |
| 121 | +### Recently Referenced (v0.8.x) |
| 122 | + |
| 123 | +| File | GRPM Feature | Version | |
| 124 | +|------|--------------|---------| |
| 125 | +| `lib/_emerge/actions.py` lines 1837-2230 | emerge --info | v0.8.2 | |
| 126 | +| `lib/_emerge/UseFlagDisplay.py` | USE flag display | v0.8.2 | |
| 127 | +| `lib/portage/versions.py` vercmp() | Version sorting | v0.8.2 | |
| 128 | +| `lib/portage/dbapi/_similar_name_search.py` | Fuzzy matching | v0.8.2 | |
| 129 | +| `lib/portage/package/ebuild/config.py` | make.conf | v0.8.0 | |
| 130 | +| `lib/portage/repository/config.py` | repos.conf | v0.8.0 | |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +## Sync Workflow |
| 135 | + |
| 136 | +When syncing with upstream changes: |
| 137 | + |
| 138 | +1. **Check Portage releases**: https://github.com/gentoo/portage/releases |
| 139 | +2. **Pull latest**: `git pull origin master` (in reference/portage) |
| 140 | +3. **Review commits**: Focus on _emerge/ and dep/ changes |
| 141 | +4. **Check PMS updates**: https://projects.gentoo.org/pms/ |
| 142 | +5. **Update this file**: Document what was synced |
| 143 | +6. **Create tasks**: Add to docs/dev/kanban/backlog/ |
| 144 | + |
| 145 | +### Automated Check (TODO) |
| 146 | + |
| 147 | +```bash |
| 148 | +# Compare local reference with upstream |
| 149 | +cd reference/portage |
| 150 | +git fetch origin |
| 151 | +git log --oneline HEAD..origin/master |
| 152 | +``` |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## Quality Validation |
| 157 | + |
| 158 | +### Gentoo Repository Coverage |
| 159 | +- Packages tested: 31,396 |
| 160 | +- Supported: 30,843 (98.2%) |
| 161 | +- Unsupported: 553 (1.8%) |
| 162 | + |
| 163 | +### Commands Verified Against Portage |
| 164 | +| Command | GRPM | Portage | Match | |
| 165 | +|---------|------|---------|-------| |
| 166 | +| resolve | ✅ | ✅ | Same versions selected | |
| 167 | +| info | ✅ | ✅ | Same output format | |
| 168 | +| search | ✅ | ✅ | Same results | |
| 169 | +| emerge --pretend | ✅ | ✅ | Same package order | |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## Community Feedback Integration |
| 174 | + |
| 175 | +### Gentoo Forums (2026-01-17) |
| 176 | +- grknight: Consider hybrid bash execution |
| 177 | +- NeddySeagoon: Bug-for-bug compatibility concerns |
| 178 | +- pietinger: Track gentoo-dev@ for eclass changes |
| 179 | + |
| 180 | +**Response**: GRPM follows PMS specification, not Portage implementation details. |
| 181 | +Eclasses are loaded dynamically from repository, not hardcoded. |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +Last Updated: 2026-01-17 |
| 186 | +Maintainer: GRPM Team |
0 commit comments