Skip to content

Latest commit

 

History

History
215 lines (191 loc) · 22.9 KB

README.md

File metadata and controls

215 lines (191 loc) · 22.9 KB

libzypp Maintainer Handbook

Warning

AI-generated content: verify before relying on it. This handbook was generated with the help of an AI assistant (October 2026). The assistant analysed the libzypp source code, the git history, zypp/package/libzypp.changes and, for some chapters, related projects (libsolv, zypper, public OBS/GitHub data). The text was not written or fully reviewed by a human expert.

  • It may contain hallucinations: wrong statements, misread code, incorrect bug numbers or invented details that sound plausible.
  • File, class and function references can be wrong or outdated. Always check them against the actual code before acting on them.
  • Items marked "unverified", "likely bug" or "suspected bug" are hypotheses from code reading only. None of them were reproduced.
  • Treat the source code as the only source of truth. Use this handbook as a map for finding your way around, not as a specification.

If you find an error, please fix it in the affected chapter.

This directory is a maintainer-focused guide to the libzypp source tree. It is for people who need to fix bugs, review pull requests, cut releases and steer the ongoing migration to the next-generation (NG) code. It is not user documentation (the man pages and the doxygen docs in zypp/doc/ cover that). It explains how the code is built and why, plus the many historic special cases you will run into.

All paths in this handbook are relative to the libzypp/ source root unless stated otherwise.

Chapters

# Chapter What you learn
00 Big picture What libzypp is, who uses it, the end-to-end flow of a zypper install, the main objects
00a Concepts primer & glossary Every core concept explained from first principles (NEVRA, Edition, Arch, solvable vs PoolItem vs Selectable, capabilities, patch/pattern/product, the three meanings of "buddy", ResStatus causers, locks, vendor stickiness, DUP vs update, keyrings, media/mirrors, tiers) plus a glossary of about 260 terms
01 Layout, build & dependencies Directory map, CMake options, targets, installed helpers, devel builds
02 Core infrastructure Logging, exceptions, smart pointers, PIMPL, Url/Pathname, ExternalProgram, callbacks/reports
03 Sat pool & resolvables libsolv integration, IdString, Capability, Edition, Arch, ResPool, PoolItem, ResStatus, Selectable, locks, vendors
03a Special solvables How products, patterns, applications, srcpackages, patches, retracted packages and PTFs are defined (release-package provides, .prod files, pattern packages, updateinfo.xml, ptf()/ptf-package()), how libsolv converts them, how libzypp models them, blacklisting, quirks
03b Modalias Hardware-dependent packages: drivers, firmware, KMPs, CPU vendor (AMD/Intel) and CPU-feature packages. Spec syntax, libsolv rewriting, matching rules, solver behaviour, cookbook, pitfalls
03c ResPool, PoolItem & Selectable How to work with the pool: the three layers and who uses which, ResPool lookups, PoolItem status and causers, Selectable candidates and status, worked zypper examples, invalidation
04 Solver Resolver, SATResolver, job building, solver flags, update/dup/verify, problems & solutions, testcases
05 Repositories & services RepoManager, RepoInfo, services, repo variables, refresh & caches, metadata parsers
06 Security, GPG & keyrings KeyRing, gpgme, repo/pkg GPG checks, rpm key import, checksums, credentials
07 Media & downloads MediaManager and handlers, MediaCurl vs MediaCurl2, mirrors/metalink, credentials/proxy, NG provide workers
08 Target, commit & rpm TargetImpl, RpmDb, zypp-rpm single transaction, history, lock, plugins
09 Configuration & environment ZConfig / zypp.conf, every environment variable, the new NG config system
10 zyppng (next generation) NG architecture, async/sync logic, C++20 modules, zypp-glib, migration state
11 Testing Test suite layout, running tests, test webserver, solver testcases, reproducing bugs
12 Release, packaging & compatibility Versioning, changelog, spec, symbol map, ABI rules, release checklist
13 Pitfalls & special cases (cross-cutting) Condensed list of the gotchas from all chapters
14 Consumers & API surface How zypper, YaST, libyui, PackageKit, Agama, snapper and connect-ng use libzypp; what must never change
15 Bug triage guide Symptom → subsystem → log strings to grep → likely causes → data to request; historic bug clusters; escalation map
16 Solver crash course Exercise-driven learning path for triaging and fixing solver bugs, using real testcases
17 SLE migration zypper migration and YaST migration end to end: who does what (SCC/RMT, connect-ng, zypper, libzypp, libsolv), the exact command sequence, migration-specific DUP features, SLE 15 → 16 transitions, failure catalogue with real bugs, reproduction
18 patch vs update vs dist-upgrade What zypper patch, update, dist-upgrade and install do differently: libzypp entry points, a tested behaviour matrix for retracted packages, PTFs, vendor, blocked updates; zypper's patch policy; exit codes; triage FAQ

Suggested reading order

  1. Read 00, then 00a (concepts; come back to its glossary whenever a term is unclear), then 01 to get oriented.
  2. Skim 02 so the idioms (ZYPP_THROW, RW_pointer, MIL <<, reports) make sense.
  3. Read 03c, then 03 → 04 → 05 → 08. That is the core data flow: pool → solver → repos → commit.
  4. Read 13 and 14 and keep them at hand when reviewing PRs.
  5. Before your first release, read 12 and 11.
  6. Before your first change, read CONTRIBUTING.md. If you work on the (paused) NG code, read 10 together with zyppng/CONTRIBUTING.md.

Reading paths by task

Each path lists the sections to read, in order. The chapters stay organised by subsystem; these paths cut across them.

Fix a security issue (CVE)

  1. Earlier CVEs and the code areas they touched: 06 §17
  2. The affected flow: repo metadata 06 §12, packages 06 §14, TLS/credentials 07 §7.16, plugins 08 §9
  3. Consumers that depend on callback defaults: 14 §7
  4. Write a regression test: 11 §12
  5. Release it: 12 §11

Triage a repository refresh / download failure

  1. Symptoms and log strings: 15 §2
  2. Refresh logic and caches: 05 §5
  3. Signature decisions: 06 §12
  4. HTTP backend, mirrors, auth, proxy: 07 §7.2, 07 §7.5, 07 §7.16, 07 §7.17
  5. Repo variables ($releasever …): 05 §6

Triage a solver / dependency bug

  1. Get and replay a testcase: 11 §15, format in 04 §17
  2. Learn the method: 16 Solver crash course
  3. Concepts: 00a §A.7, 00a §A.8
  4. Mechanics: 04 §3, 04 §5, 04 §14, 04 §16
  5. Special solvables (products, patches, PTFs, retracted): 03a; hardware packages: 03b

Why wasn't X updated? (patch / update / dup questions)

  1. Compare the operations: 18 §1, 18 §3
  2. FAQ with owners: 18 §6
  3. Concepts: patches 03a §B.1, retracted 03a §B.2, PTFs 03a §B.3

Triage a migration bug (zypper migration, SP or major upgrade)

  1. Who owns which step: 17 §2, the step sequence: 17 §3
  2. Symptom → owner: 17 §8
  3. Solver side: 17 §5, 04 §5.3; why fixes must reach the source system: 17 §7
  4. Reproduce: 17 §9

Triage a commit / rpm failure

  1. Symptoms: 15 §2
  2. Which rpm backend ran: 08 §5
  3. The pipeline and download during commit: 08 §6, 08 §15
  4. How results and errors are reported: 08 §16

Add or change a zypp.conf option

  1. How the config is located and merged: 09 §2
  2. How ZConfig reads it and handles root changes: 09 §3, 09 §4
  3. Existing keys and docs that must be updated with it: 09 §5, 09 §11
  4. The NG config registry: 09 §15
  5. ABI impact of new getters: 12 §12

Review a pull request

  1. ABI checklist: 12 §12, symbol export: 12 §5
  2. Who could break: 14 §6, 14 §8
  3. Known traps in the touched area: 13 and the chapter's own Pitfalls section
  4. Rules for changes: CONTRIBUTING.md; NG tier rules: zyppng/CONTRIBUTING.md, 10 §11

Cut a release

  1. Checklist: 12 §11, a real example: 12 §14
  2. Version and soname rules: 12 §2
  3. OBS submission: 12 §13, zypper coupling: 12 §17

Work on the NG code

  1. What already runs in production: 10 §6
  2. Async framework and the sync/async pattern: 10 §3, 10 §4, 10 §17
  3. Building it: 10 §10, 10 §18

Topic index (A–Z)

For topics that several chapters touch, Home is the one place that explains them fully. Other chapters should keep only the detail they need and link there.

Topic Home Also relevant
ABI, symbol export, libzypp.map, ZYPP_API 12 §5 12 §12, 14
Arch detection, x86_64_v2/v3/v4 09 §6 03 §4
AutoInstalled, unneeded, orphaned 00a §A.8 04 §3.4, 08 §17
Buddy (all meanings) 00a §A.5 03a §A2
Build system, CMake options 01
Callbacks / reports 02 §11 14
Capability, dependencies, rich deps 00a §A.3 03 §4, 04 §18
Commit pipeline 08 §6 08 §15, 08 §16
Consumers (zypper, YaST, PackageKit, …) 14
Credentials, HTTP auth 07 §7.16 06 §9
CVE history 06 §17
Delta rpms, package cache 05 §10
Disk usage 08 §12
Download settings, HTTP backend (MediaCurl / MediaCurl2) 07 §7.2 07 §7.9
Environment variables 09 §8 09 §12 (variables libzypp sets)
Exceptions 02 §4
History log 08 §8
Keyring, GPG keys 06 06 §15
Locks (package locks, /etc/zypp/locks) 03 §10 04 §11, 08 §17
Lock, global (/run/zypp.pid) 08 §2 14
Logging and debug switches 02 §3 15 §1
Media handlers (CD, ISO, NFS, …) 07 §7.6 07 §7.19
Mirrors, metalink, GeoIP 07 §7.5 05 §11
Migration (SLE SP/major, zypper migration) 17 04 §5.3
Modalias, hardware packages 03b
Multiversion, PurgeKernels 04 §13 03 §10
Namespaces (language, modalias, filesystem) 03 §9 04 §12, 03b
NG code in production 10 §6
Patches (status, update stack) 03a §B.1 04 §8, 04 §19
Patterns 03a §A3
patch vs update vs dist-upgrade (operations) 18 04 §5
Plugins (commit, services, verification, …) 08 §9 06 §11, 05 §7
PoolQuery 03 §13
Products, base product, /etc/products.d 03a §A2 08 §13
Progress reporting 02 §13
PTFs, retracted, blacklisting 03a §B.3 03a §B.2, 03a §B.4
Release process 12 §11
Repo GPG checks (repo_gpgcheck …) 06 §7 06 §12
Repo refresh, raw/solv caches 05 §5
Repo variables 05 §6
ResPool, PoolItem (using them) 03c 03 §7 (internals)
ResStatus, causers 03 §7 03c §3, 00a §A.7
rpm backends (classic / single transaction, zypp-rpm) 08 §5
Selectable, ResPoolProxy 03c §4 03 §12 (internals), 00a §A.7
Services (RIS, plugin services) 05 §7
Solver flags 04 §14 04 §4
Solver history (built-in → satsolver → libsolv), per codestream 04 §2.1 12 §18
Solver modes (update, dup, verify) 04 §5
Solver problems and solutions 04 §16
Solver testcases 04 §17 11 §15
SystemCheck 04 §10
Tests (running, writing) 11
Translations 12 §15 02 §18
Url, Pathname 02 §8 02 §7
Vendor equivalence 03 §10
zypp.conf keys 09 §5

Keeping this handbook alive

  • These documents were derived from the source at the time of writing (branch ng-config, Oct 2026). Code moves fast, especially under zyppng/ and zypp-logic/*/ng/. When you change a mechanism described here, update the chapter in the same PR.
  • Statements are backed by file references. If a reference no longer exists, treat the paragraph as suspect.
  • Each chapter's table of contents is generated. After changing headings, run tools/toc.py. Before committing, run tools/check-links.py, which reports broken links and anchors and warns about § references without a matching heading.