-
Notifications
You must be signed in to change notification settings - Fork 17
Bumping Ebuilds
scripts/bump_and_qa_ebuild.sh is the tool for moving COSMIC packages to a new cosmic-epoch tag. It discovers packages by directory name (cosmic-*, plus xdg-desktop-portal-cosmic and pop-launcher) under cosmic-base/, so dev-lang/dart and other non-COSMIC toolchain packages are out of scope for it — see Adding and Updating Packages for those.
Requires an authenticated GitHub CLI (gh auth login) and network access to GitHub, unconditionally — even for -n/--dry-run or --no-upload runs. The startup checks (gh in PATH, gh auth status, a live gh api reachability check against COSMIC_OVERLAY_REPO) run before any flag-specific logic and will hard-fail the script if they don't pass. --no-upload only skips the later gh release create/upload calls, not these startup checks.
There is no resume mode. A run without -p reprocesses every discovered package from scratch every time — it does not skip packages a previous run already completed. In practice this means: run it once for the whole set, then use -p <pkg> to retry only the packages that failed (see below), never a bare re-run to "continue".
# Full release bump, all packages
./scripts/bump_and_qa_ebuild.sh -v epoch-1.4.0
# Preview only, no changes written
./scripts/bump_and_qa_ebuild.sh -n epoch-1.4.0
# Single package (also how you retry a package that failed)
./scripts/bump_and_qa_ebuild.sh -v epoch-1.4.0 -p cosmic-comp-v/--verbose isn't required but is used in practice on every invocation — the default log level is too quiet to debug a failure after the fact.
-p/--package only accepts one package per invocation — passing it twice silently keeps only the last one, it does not process both. For a handful of specific packages, just invoke the script once per package.
Other flags:
-
-r<N>/--revision <N>— Gentoo revision bump (-r1, ...), for overlay-only patch bumps (see Release Workflow notes on versioning) -
--no-commit— run the pipeline without committing, to inspect the result first -
--no-upload— skip the GitHub release/tarball upload step (local-only testing) -
--allow-non-frozen-vendoring— runcargo vendorwithout--locked; needed when upstream forgot to bumpCargo.lockfor a tag (requires-p, one package) -
-c/--create <pkg> --description <text>— bootstrap a brand-new package (see Adding and Updating Packages) -
--clean-temp— delete the kept temp working directory for this version when the run finishes (see "Temp directories" below)
Environment variables COSMIC_EPOCH_REPO, COSMIC_OVERLAY_REPO, DISTDIR override the upstream repo, this overlay's GitHub repo (for release uploads — set this if you're running the script against a fork), and the portage distfiles dir, respectively. They can also be set persistently in ~/.cosmic-bump.conf (sourced before CLI args are parsed, so CLI flags still win). ./scripts/bump_and_qa_ebuild.sh --help prints the full reference including examples.
Nine phases, run in order, for each package:
-
Archive — build a unified source+vendored-crates tarball from the
cosmic-epochsubmodule (cargo vendor --lockedunless--allow-non-frozen-vendoring). Skipped for meta-packages (noCargo.toml/Makefile/justfile/src/). -
Manifest write — write the
DISTentry (BLAKE2B+SHA512) for that tarball intoManifest. The script's own hashes are authoritative — it does not shell out toebuild digest. -
Upload — push the tarball to a GitHub release tagged
${GENTOO_VERSION}inCOSMIC_OVERLAY_REPO(creating the release if needed). Skipped with--no-uploador-n. -
Bump — generate the new ebuild by copying the highest-versioned existing tagged ebuild in the package directory (via
sort -V,-9999excluded) and updating only theVERGEN_GIT_COMMIT_DATE/VERGEN_GIT_SHAvariables if present. Nothing else in the ebuild is touched automatically. -
Verify fetch —
ebuild <pkg>-<version>.ebuild fetch, to prove the Manifest hashes just written actually resolve. -
Sysdeps check — cross-references vendored
-syscrates against a built-in crate→Gentoo-package map and warns about anything unmapped. Non-fatal: recorded in the report, never blocks the package or fails the run. Dependencies are never added to the ebuild automatically. -
src_preparetest —ebuild <pkg>-<version>.ebuild clean unpack prepare. On failure, if the ebuild has aPATCHES=entry, the script comments the whole block out and retries once (see Troubleshooting); if that also fails, or there's noPATCHESentry, the package fails here. -
QA scan —
pkgcheck scan cosmic-base/<pkg>(default pkgcheck settings, notscripts/pkgcheck.conf— see QA and Testing). Non-fatal: any output is recorded in the report but never blocks the commit. -
Commit —
git addthe ebuild (+Manifest, unless meta-package) and commit ascosmic-base/<pkg>: add <version>, with a note appended ifPATCHESwas commented or sysdeps were missing. Skipped with--no-commitor-n.
Meta-packages (cosmic-meta, pop-theme-meta) only go through phases 4, 8, 9 — no source, so no tarball/fetch/prepare.
Because step 4 is a straight copy of the previous tagged ebuild, the automation does not know about anything upstream changed — a new install path in the Justfile, a new system dependency in Cargo.toml, a renamed binary. That's exactly what step 5 of Release Workflow (checking upstream release notes/diffs) exists to catch; the script will happily produce a bumped ebuild that builds and installs the old file layout against the new source.
If a package fails phase 1–5 or 7, the script logs it to the run's failure list and moves on to the next package rather than aborting — a full run against ~35 packages will get through the rest even if several need manual attention. Phases 6 and 8 (sysdeps, QA) never fail a package at all.
For phases 4, 5, and 7 specifically, a failure automatically rolls back what that package's run had touched: the Manifest entry is restored and the half-written <pkg>-<version>.ebuild is deleted before the script moves to the next package. You generally don't need to manually git rm/rm anything before retrying — just fix the underlying problem and re-run with -p <pkg>.
There's no persisted state — the completed/failed/patches-commented/missing-deps/QA-issues report is generated in memory at the end of that one run and printed to both the console and the timestamped log file (.bump-<version>-<timestamp>.log, auto-.gitignored). If you need to check what happened in a run you're not looking at anymore, read that log file — there's no separate state file to consult (despite .gitignore still listing a .bump-state-*.json pattern, a leftover from an older version of the script).
To find the actual error quickly instead of scrolling:
grep -i -e rror -e failed .bump-<version>-<timestamp>.log-
Reproduce interactively from inside the package directory — this mirrors what phase 7 does, plus the compile/install the script doesn't test:
cd cosmic-base/<pkg> ebuild <pkg>-<version>.ebuild clean unpack prepare # what phase 7 runs ebuild <pkg>-<version>.ebuild compile ebuild <pkg>-<version>.ebuild install ebuild <pkg>-<version>.ebuild clean # always clean up the work dir after
-
Diff against the previous tagged ebuild (the template phase 4 copied from) and against
-9999, since-9999is the only place upstream/eclass changes might already be reflected:A recurring cause: an eclass function/variable was renamed (e.g.diff -Nuar <pkg>-<prev-version>.ebuild <pkg>-<version>.ebuild diff -Nuar <pkg>-<version>.ebuild <pkg>-9999.ebuild
cosmic-de-r2_target_dir→cosmic-common_target_dir) and the copied ebuild still references the old name. Fix with a targetedsedacross affected ebuilds if it's systemic:sed -i -e 's:cosmic-de-r2_target_dir:cosmic-common_target_dir:' */*/*-<version>.ebuild
-
If you generated a replacement vendor tarball out-of-band, append its
DISTline manually rather than hand-computing hashes —b2sum/sha512sumproduce them:DIST <pkg>-<version>.tar.zst BLAKE2B <hash> SHA512 <hash> -
Re-run the script for just that package once the fix is in place:
./scripts/bump_and_qa_ebuild.sh -v epoch-1.4.0 -p <pkg>
For a fix that needs to ship as an ebuild-level patch rather than waiting for upstream to retag:
ebuild <pkg>-<version>.ebuild prepare # unpacks to a work dir
diff -Nuar <pkg>-<version>.orig <pkg>-<version> \
> cosmic-base/<pkg>/files/<pkg>-<version>-backport-<PR#>.patchReference the new patch file from PATCHES=() in the ebuild. Name patches descriptively (-backport-137.patch for "backports upstream PR #137") so a future reader knows why it exists without archaeology.
If phase 7 comments out a PATCHES entry because it failed to apply (see phase list above), that's a signal the patch needs regenerating against the new source. The comment-out is only there to let the rest of the bump proceed — it always surfaces the package as PATCHES COMMENTED in the run report and in the commit message; regenerating or re-enabling the patch is a manual follow-up, never attempted automatically.
By default the script keeps its per-run temp working directory (under TMPDIR, /var/tmp unless overridden — deliberately not /tmp, to avoid running out of space on a tmpfs-backed mount) after finishing, purely so you can inspect it if something looked off. Clean it up when you're done:
./scripts/bump_and_qa_ebuild.sh epoch-<version> --clean-temp
# or, if you already know the run is over and want it gone now:
rm -rf /var/tmp/cosmic-bump.*After a batch of bumps, before committing the "drop old version" cleanup (see Release Workflow):
pkgcheck scan --config scripts/pkgcheck.conf
python3 scripts/simple-qa-check.py
emerge -uDN @world --quiet --keep-goingThe emerge run is what actually proves the bumped packages build and install — see QA and Testing for why a pkgcheck scan alone isn't sufficient proof.