Skip to content

build(fedora): add an RPM package published through COPR - #2120

Merged
l0gicgate merged 5 commits into
lgse:mainfrom
bgmulinari:build/2118-fedora-rpm-copr
Nov 12, 2026
Merged

l0gicgate merged 5 commits into
lgse:mainfrom
bgmulinari:build/2118-fedora-rpm-copr

Conversation

@bgmulinari

Copy link
Copy Markdown
Contributor

Description

Adds a Fedora RPM, built from source and published to two COPR projects (stable and preview) for every non-nightly release. Fedora users then get Strata and its runtime dependencies through dnf, and updates with ordinary system updates.

  • packaging/rpm/strata.spec.in and scripts/build_srpm.py turn a release tag into a source RPM: a git archive of the tag, the vendored crates (COPR builders have no network access), and the rendered spec. Its License tag is generated from the crates and the bundled assets.
  • The package is compiled with STRATA_UPDATER=disabled (Let distribution packages build without the in-app updater, and license every source file as MIT #1933), so dnf owns updates, and it installs no install-source.toml.
  • It is built without RAR support (Make RAR support optional at build time so distros can ship Strata as free software #1327). COPR accepts only licenses Fedora allows, which excludes UnRAR's, so unrar and unrar_sys are vendored only as empty stubs, and the script refuses to build a source RPM otherwise.
  • Tags map to RPM versions that sort correctly (1.3.0~rc.1 < 1.3.0). Nightlies are not packaged.
  • publish-copr.yml submits a release to COPR and waits for the builds. Stable releases go to both projects; alpha, beta and RC releases go only to preview. The Release workflow calls it after each non-nightly release, and it can also be run by hand to retry, rebuild or backfill a release (back to v1.2.0-rc.1).
  • rpm.yml builds, lints and installs the RPM in a Fedora container when its inputs change, including Cargo.toml and Cargo.lock, since a dependency update can bring in a license COPR rejects.
  • docs/packaging.md documents the package and its setup, and README.md gains a Fedora install section.

Publishing stays off until COPR_PUBLISH_ENABLED is set to true, so merging this changes nothing in the release process until the setup below is done.

Setup for the maintainer

None of this blocks merging, but publishing needs it, and the README section should not reach users before step 1.

  1. Create the COPR projects. COPR names projects after a Fedora account or group, and the README assumes lgse/strata and lgse/strata-preview. If you pick other names or a group (@group/strata), tell me and I'll update the README before merge. Settings I tested with:
    • chroots fedora-44 and fedora-45, each for x86_64 and aarch64;
    • Enable internet access during builds off;
    • Follow Fedora branching on, so new Fedora releases are added automatically.
  2. Set repository variables COPR_PROJECT and COPR_PREVIEW_PROJECT to <owner>/<project>.
  3. Create the copr-production environment, restricted to main, with a secret COPR_CONFIG holding the ~/.config/copr file shown at https://copr.fedorainfracloud.org/api/.
  4. Set COPR_PUBLISH_ENABLED to true.
  5. Optionally publish v1.2.1 now with Actions → Publish COPR packages → Run workflow, version 1.2.1. Otherwise the first packages arrive with the next release.

COPR API tokens expire after 180 days. Renew the token on the same page and replace COPR_CONFIG before then; an expired token fails only the COPR job, which can be rerun by hand.

Both workflows run on ubuntu-24.04 with a Fedora container rather than on Blacksmith runners. rpm.yml takes about 25 minutes: the release profile's lto = true and codegen-units = 1 make the final link single-threaded. It runs only when the packaging inputs change. publish-copr.yml mostly waits for COPR; it took about 70 minutes, bounded by the aarch64 builds.

Visual evidence

N/A: packaging and CI only, with no change to the application's interface.

How to test

  1. On Fedora 44 or 45 (or in a container), build the package:
    sudo dnf install git rpm-build rpmlint cargo-rpm-macros cargo-vendor-filterer 'dnf-command(builddep)'
    python3 scripts/build_srpm.py --tag v1.2.1
    sudo dnf builddep target/rpm/strata-*.src.rpm
    rpmbuild --rebuild target/rpm/strata-*.src.rpm
    sudo dnf install ~/rpmbuild/RPMS/*/strata-1.2.1-*.rpm
  2. Launch Strata from the application menu. Preview an image, a PDF and a video, then open Diagnostics.
  3. Or test the published packages from my COPR projects, which publish-copr.yml built from this branch: sudo dnf copr enable bgmulinari/strata && sudo dnf install strata.

Expected result: Strata starts from the desktop launcher, and previews and thumbnails render in the sandbox. Diagnostics reports that in-app updates are disabled, and Settings has no Updates page. rpm -q --provides strata lists bundled(crate(...)) entries but no unrar crate.

I tested this on:

  • x86_64: Fedora 44 and 45 in clean containers, with the steps above.
  • aarch64: built, installed and launched under QEMU emulation. The preview sandbox can't start there, because the emulator lacks Landlock and user namespaces, so sandboxed previews on aarch64 are untested on real hardware.
  • COPR: a run of publish-copr.yml on my fork built all eight chroots in both projects. Installing from that repository works on my Fedora 45 desktop, and dnf offers the rebuilt 1.2.1-2 as an upgrade.

Related issue

Closes #2118

Build Strata from source as an RPM for Fedora and publish it to a
stable and a preview COPR project for every non-nightly release.

- packaging/rpm/strata.spec.in and scripts/build_srpm.py render the
  spec for a release tag and build a source RPM from the tag and its
  vendored crates, because COPR builders have no network access.
- The package compiles with STRATA_UPDATER=disabled and without RAR
  support. unrar and unrar_sys are vendored only as empty stubs, and
  tags that predate STRATA_UPDATER are refused.
- publish-copr.yml submits a release to COPR. The Release workflow
  calls it, and it stays disabled until COPR_PUBLISH_ENABLED is true.
- rpm.yml builds, lints, and installs the RPM whenever its inputs
  change.

Refs lgse#2118
@github-actions github-actions Bot added the build Build system or packaging changes label Nov 12, 2026
The updater switch moved from the root build script to
crates/strata-desktop in lgse#2112, so build_srpm.py refused every commit
after it as predating STRATA_UPDATER, and rpm.yml looked for the
updater cfg on the root crate's rustc command.

- Look for STRATA_UPDATER in the workspace crates' build scripts too.
- Check the updater cfg and the rar feature across all Strata crates.
- Rebuild the RPM when a workspace crate's manifest or build script
  changes.

Refs lgse#2118
@l0gicgate

Copy link
Copy Markdown
Contributor

Review

Merged main (b978134) into the branch with no conflicts, then reviewed the full diff against it.

Fixed in 35b2990

The merge brought in #2112, which split the app into workspace crates and moved the STRATA_UPDATER switch from the root build.rs to crates/strata-desktop/build.rs. That broke the package on current main:

  • scripts/build_srpm.py refused the merged head with v1.2.1 predates STRATA_UPDATER and cannot be packaged as an RPM, so every release after refactor: extract the toolkit-free code into workspace crates #2112 would have been refused. It now also looks in the workspace crates' build scripts. Tags with the old layout still package; v1.1.1 and nightlies are still refused.
  • The "Verify the build configuration" step in rpm.yml looked for --cfg strata_updater_disabled on the root crate's rustc command, where it no longer appears. It now checks the updater cfg and the rar feature across all Strata crates.
  • rpm.yml now also runs when a workspace crate's Cargo.toml or build.rs changes, since the rar feature wiring and the updater switch live there.
  • docs/packaging.md and the updater-switch test follow the new layout.

Verified locally (Fedora 45 container, x86_64)

  • build_srpm.py --tag v1.2.1 --ref HEAD on the merged head: unrar and unrar_sys are stubs, 84 stubs listed.
  • rpmbuild --rebuild succeeds offline from the vendored crates. No Strata crate is compiled with feature="rar", unrar is never compiled, and strata_desktop gets --cfg strata_updater_disabled.
  • rpmlint: 0 errors, 2 warnings (no man page, Source1 is not a URL).
  • The package installs; strata --version prints strata 1.2.1; no D-Bus activation file or install-source.toml; 357 bundled(crate(...)) provides, none for unrar.
  • Every Requires and Recommends name resolves in Fedora's repositories.
  • python3 -m unittest discover -s scripts -p 'test_*.py': 239 tests pass.

No Rust code changes, so I did not run the Rust suite, fmt or clippy locally; CI covers them.

Tests and comments

The tests in scripts/test_build_srpm.py cover real parsing and refusal logic; none removed. Every added comment explains a constraint the code cannot (license rules, offline build, stub handling); none removed.

Before merging

  • The README's COPR projects do not exist yet. lgse/strata and lgse/strata-preview both return 404 from the COPR API, so the new Fedora install section would not work for users until they are created (step 1 of the setup in the description).

Not verified

  • The release.yml → publish-copr.yml call path with the copr-production environment secret. Only a manual run on the author's fork has exercised publishing.
  • Sandboxed previews on real aarch64 hardware, as the description notes.

COPR names a project after the Fedora account that owns it, and the
packages are published from l0gicgate/strata and
l0gicgate/strata-preview.

Refs lgse#2118
@l0gicgate

Copy link
Copy Markdown
Contributor

Waiting on Fedora to create an FAS group named lgse to publish.
https://forge.fedoraproject.org/infra/tickets/issues/13683

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system or packaging changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build(fedora): add an RPM package published through COPR

2 participants