feat(build): build the rpm offline, and test the package rather than the checkout #26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t3code/f2087226"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes the rpm build trustworthy: offline, tested, linted, and verified by driving the binaries out of the package itself.
What changed
Offline build.
build-aux/make-vendor-tarball.shproduces a second source tarball with every crate the workspace depends on. The spec unpacks it in%prep, writes a.cargo/config.tomlpointing at it, and exportsTK_OFFLINE=1, whichcargo-build.shandcargo-test.shturn into--offline. A build that fetches from crates.io is not reproducible and is refused outright by koji and by a COPR chroot.%checkmeans something.cargo test --workspaceis registered as a meson test in arustsuite, reusing the profile and target directory of the build so nothing compiles twice.%checkwent from two file validators to those plus the whole suite.A smoke test for the package.
build-aux/rpm-smoke.shextracts an rpm into a throwaway prefix and drives the binaries out of it on a private D-Bus session, with the installed application ID rather than.Devel. It checks the three binaries resolve their libraries, the three schemas are present and compile, the desktop entry validates and points at an icon the package ships, the man pages are there, then starts the packaged window and agent and has the packagedterminalkoctltalk to them.smoke.shcannot see any of this: it drivestarget/debug, where every file is present whether the package ships it or not.Two test fixes the packaging found.
foreground::tests::this_process_can_be_readanda_session_reports_what_it_is_runningasserted the tests are not root. That is false in a chroot or a root container — including the Fedora container the CI job already runs in — so%checkwould have failed there. Both now compare the reader against the realgeteuid().One version, one bump.
build-aux/release.sh <version> [--tag]rewritesmeson.build,Cargo.tomland the spec, refreshesCargo.lock, and prepends a%changelogentry.build-aux/version-check.sh, whichci.shruns, fails the build when the three disagree — the part that actually holds the line.Lint and man pages. Three man pages in
data/man/, installed to%{_mandir}with the version substituted.build-aux/rpmlint.tomlfilters only the deliberate findings, each with its reason next to it: British spelling, the obsolete tags Fedora dropped, an SPDX identifier the check only knows with the licence data package installed.Release plumbing.
Source0andSource1are release-asset URLs. The packaging job builds both tarballs, builds the rpm, lints the spec and the packages, and smoke tests the rpm underxvfb.Verified on Fedora 44
./build-aux/ci.sh— pass./build-aux/smoke.sh— passrpmbuild -baunderunshare -rn, so with no network at all — exit 0,%check3/3rpmlint --config build-aux/rpmlint.tomlover the spec and both rpms — 0 errors, 0 warnings./build-aux/rpm-smoke.shon the built rpm — passmeson install— man pages land in/usr/share/man/man1, render, version substitutedrelease.sh 0.1.1in a throwaway clone — bumps all three plus the lock and changelog; the guard catches driftStill open
mockrebuild, which is what provesBuildRequiresis complete.unshare -rnshows the build never touches the network, but not that the chroot has everything. Command is in the README.dnf installof the rpm, the only path that exercises%post— the schema cache and the desktop database.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.