Files
gentoo-zh/.agents/rules/prebuilt-binaries.md
T
Zakk a55f0925b0 AGENTS.md, .agents/rules: rewrite as target states, add QA lessons
AGENTS.md is read on every task, so it keeps routing, the hard stops,
the install and keyword gates and the completion report, and drops to
514 words; all rule files together drop from 7546 to 5783 words. Rules
state the result to reach, and keep a prohibition only where a mistake
is hard to undo or a reviewer has caught it before.

Lessons from reviewed PRs: PATCHES carried over a bump, Go -ldflags
without -s or -w, RUST_MIN_VER from the highest rust-version, cargo
QA_FLAGS_IGNORED, ISA gating through cpu_flags, Python Requires-Dist,
draft PRs for eclass provider slots missing from ::gentoo, skel.ebuild
variable order, DependencyMissingKeywords, and the Go vendor layout.

The PR template asks for the reason, a Tested: line and two checks, and
names the merge-base scan range so it is not read as a bare --commits.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-11-15 03:09:02 +11:00

2.7 KiB

Bundled and Prebuilt Binaries

Read with: version-bumps.md or new-packages.md for the change; dependencies.md for linkage evidence; desktop-integration.md for desktop apps; openrc-systemd.md for services; kernels.md for -kernel-bin.

  • Whitelist published artifact arches, e.g. KEYWORDS="-* ~amd64 ~arm64", with per-arch SRC_URI. Never keyword or reference an unpublished artifact.
  • Set RESTRICT from verified stripping and redistribution needs; strip and splitdebug differ.
  • Scope QA_PREBUILT to exact installed paths of manually reviewed, immutable blobs. It suppresses DT_NEEDED, executable-stack, textrel/W+X, flags, pre-stripped-file, and SONAME checks; RESTRICT=strip controls stripping.
  • Audit each installed object's ELF class/machine, interpreter, NEEDED, SONAME, RPATH, installed path, libc/libstdc++ floors, and CPU ISA baseline. Inspect every arch's archive layout and linkage separately; same-release builds may differ, including OpenSSL linkage.
  • Smoke-test amd64. Add untested ~arm64 when upstream ships that release's arm64 artifact; report it unverified and fix arch-specific problems on report.
  • Apply dependencies.md for evidence-backed dependencies and immutable-byte ABI constraints.
  • Set per-arch RDEPEND glibc floors as >=sys-libs/glibc-X from the highest binary GLIBC_ symbol version. Static-PIE has no such symbols and needs no floor. Express glibc needs through dependencies, leaving elibc_glibc out of REQUIRED_USE: musl profiles otherwise produce error-level RequiredUseUnsatisfiableInDev and fail new-package CI.
  • Resolve every NEEDED through verified bundled layout or genuine system RDEPEND, including QA-suppressed objects. An unresolved entry is a runtime defect.
  • Private modules may lack SONAME; justify unusual RPATH per object. A retained private blob may use verified literal '$ORIGIN/...'.
  • For source-built objects, fix build/link/install behavior first. Use evidence-backed patchelf only as fallback, with BDEPEND.
  • Replace bundled components with system ones only after verifying ABI, functionality, and launcher/configuration integration; otherwise stop.
  • REQUIRES_EXCLUDE filters metadata only. Use it for verified unresolved-soname false positives: an RDEPEND provider installs the requested filename with a different SONAME (app-arch/bzip2 provides libbz2.so.1.0), or an optional plugin stays unloaded without its provider. Otherwise fix the dependency or layout; never patch the binary to hide the notice.
  • Exclude runtime self-hashing files from stripping individually with dostrip -x <path>, as net-proxy/flclash-bin does; retain stripping for the rest of the package.
  • For prebuilt dotnet-pkg-base payloads, match DOTNET_PKG_COMPAT to each *.runtimeconfig.json framework.