Le samedi 29 février 2020 à 13:49 +0100, clime a écrit :
> On Sat, 29 Feb 2020 at 10:15, Nicolas Mailhot via devel
> <devel(a)lists.fedoraproject.org> wrote:
> > Hi,
> >
> > Anyway, here is what I would personnaly consider a robust,
> > inclusive,
> > and future-proof design:
>
> I will need to ask some questions to really understand it.
>
> > — a %{use_dynstate} rpm variable enables dynamic changelog/release
> > behaviour
> > — probably initialy set to false distro-wide, to let volunteers
> > test
> > the thing by setting it to true iin their specs,
> > — then to true (opt-out), when kinks have been fixed, and
> > FPC/FESCO
> > greenlights general availability
> >
> > – when activated, last changelog, evr and %{dynrel} state are saved
> > in one or several detached files
>
> You mean the last changelog, evr, and %{dynrel} are stored once
> %{use_dynstate} is set and and after one invokes fedpkg commit?
> I think there should be some explicit action (e.g. the commit) to
> generate the files after I set the %{use_dynstate} value to true in
> the spec file.
Once a spec sets %{use_dynstate} to true changelog, last computed
changelog, ev, neutralized-r, and %{dynrel} are taken from detached
files. neutralized-r is the evaluation of Release with %{dist} set to a
neutral value (for example “-”).
State is stored in files included in the srpm to be able to import to
and from Fedora git (pretty much a hard requirement if tooling is to be
kept Fedora-git neutral, which is itself a hard requirement to be able
to interact with packaging work existing outside Fedora git).
You need the last computed ev and neutralized-r to decide whether
%{dynrel} can be kept, needs bumping, or should be reset to 1.
I don’t trust mixed mode, KISS, changelog is detached or not, don’t try
to have it both ways, here lies madness and confusion.
> How is %{dynrel} computed here at this stage
Nothing is computed at this stage.
Detached changelog state, is a commit property (except for build date).
It is computed at fedpkg commit time:
– if detached changelog data is absent
→ move in-spec changelog data to the detached file if data exists,
→ otherwise init detached data to nothing
– after the first fedpkg commit with %{use_dynstate} set to true, the
detached changelog file exists and the in-spec changelog has been
removed.
– others have detailed possible fedpkg commit strategies to stuff
changelog with new info
%{dynrel} and build changelog info are a build property. They are
computed at build time:
– if computed ev ≠ last saved ev or last %{dynrel} is undefined
→ reset %{dynrel} to 1
– otherwise if computed neutralized-r = last neutralized-r
→ bump %{dynrel}
– otherwise, do nothing, something already took care of things
– save the new computed ev, computed neutralized-r and dynrel to the
detached files
– add a build line with the full evr (and full dist) to detached
changelog
– at build time, there is no relationship with magic git state or
magic buildsys info, the srpms are 100% autonomous as before. The
detached changelog has already been populated manually or by distro
automation or manual processes when it reaches build stage and a new
build is recorded (with a new dynrel value, if necessary).
> Is the intention here that with each new build of the same package,
> the value of %{dynrel} is bumped and committed back?
It is bumped (or reseted to 1) whenever comparison with last saved
state shows a bump or reset is needed.
Build-time state changes need to be commited back, of course (otherwise
the produced srpm needs to be re-imported manually)
> That means the evr file read from the repository needs to contain
> somehow outdated values at this point (when srpm is being built in
> build system), otherwise %{dynrel} would be always bumped?
Final dynrel state is not computed before a build, yes. The build will
decide if it needs to bump dynrel, or can reset it to 1. I had
forgotten to document the reset, sorry.
There is no need to compute a new dynrel before actual build, the
packager may yet change ev or r.
> > – a build line is added to the detached changelog, using the
> > current
> > date and full evr (without %{dist} neutralization)
> > — that probably requires defining a rpm variable to track whom
> > the
> > build is attributed to
> > – it can default to "Anonymous coward" or whatever if not
> > explicitely
> > set
>
> I think today's changelogs do not contain name of the person who
> built the pacakge
Today’s changelog mixes who made spec changes and who built the result.
That what confuses you. Confusion is anthetical with automation. This
proposal clearly documents that changelog can change at build time
(fedpkg build) and between builds (fedpkg commit).
From a package consumer POW, the only attribution and timestamp that
matters is who build the final package and when, because the builder is
taking the responsability of pushing a result to users.
A clean changelog is:
%changelog
* timestamp builder-id - built-EVR ← set at build time
- change ← set at commit time
- change ← set at commit time
- change ← set at commit time
Not sure at all the change lines need attribution or timestamping. From
a package user POW they are virtual potential changes that won’t
materialize before a build.
So yes before someone presses the build button the detached changelog
will look like this
%changelog
- staged change
- staged change
- staged change
* timestamp builder-id - built-EVR ← set at build time
- past change
- past change
- past change
The act of building adds the final %changelog line:
* timestamp builder-id - built-EVR
> You mean there would be different kinds of built srpms?
We already have two level of srpms, one before dynamic BuildRequires
processing and one after. It’s up to rpm upstream to decide at which
srpm level they would prefer preforming dynrel and dynchangelog
munging.
I want upstream rpm involved for dynrel and dynchangelog to be
independent from current Fedora git infra, and interoperable.
> For copr, it is not possible, because it has read-only access to git
> repositories being built.
It has some access to private git repos, you see copr initialising them
when giving it a new srpm to build.
> I think there are good examples where some things can be done without
> rpm changes - e.g. the simple-koji-ci to do automatic scratch builds
> on a new commit.
For something that is effectively a format change (moving changelog
outside the spec itself) it’s a bad bad idea to do it without rpm
upstream vetting and involvment. Sure you can kludge things without
them. Operational word: kludge. Will forever be a pain point as long as
it is not integrated upstream. Magic git-only or bbuildsys-only state
is a misfeature, (s)rpms should cut the git/buildsys cordon as soon as
they are born.
scratch build are something else entirely. They are transient non-
shared things that do not need to cleanly export or import in other
build systems
Regards,
--
Nicolas Mailhot