Discussion:
Proposal: Optional `Priority: optional` and changed `Section` fall-back
(too old to reply)
Niels Thykier
2024-12-15 08:30:01 UTC
Permalink
Hi,

Historically, if you omitted `Priority` and `Section` from your
package, `dpkg` would warn and use `-` or `unknown` as placeholder
when it absolutely needed a value for these fields in the `.dsc` and
the `.changes` file. The resulting `.deb` would omit the field.

We would like to change this behavior such that `dpkg` provides
defaults for these fields. That is, if the fields are omitted from
`debian/control`, you get `Priority: optional` and `Section: unknown`
as default in all artifacts (`.dsc`, `.changes`, and in the `.deb`).

Benefits of this change and the approach being:

1. The vast majority of future maintainers will no longer need to
learn about the `Priority` field. Concretely, Only ~300 (0.5%)
of the packages in Debian testing main uses a different
`Priority`. This makes it a low hanging fruit in reducing mental
load for people learning packaging for the 99.5% case down the
line as there will be one line less worth of field/boilerplate
to know about in the average case. Tutorials and guides can move
the `Priority` field from "mandatory" to "special-case" section,
etc.

The default for `Section` would always be `unknown` rather than a
mix of `-` and `unknown` in `.dsc` and `.changes` vs. absent in
the `.deb`. This has no direct benefits to the packager, only to
consumers of the produced artifacts. `Section` would still
"de-facto" be mandatory, since `unknown` is never the right
choice. This change is mostly to keep the code aligned with the
`Priority` in `dpkg` and replace the `-` special-case (from `.dsc`
and `.changes`) with `unknown`.

2. The omission only applies to `debian/control` and the build
process. The produced artifacts will have the fields, so anything
working on the produced artifacts will be unaffected. This
includes archive metadata such as `Packages` files. In other
words, only developer tools reading `debian/control` can be
affected by this (and tools that read the `-` in the `.dsc` and
`.changes`, but we suspect there are none other than possibly dak).

3. All existing packages have these fields and will continue to have
them until the maintainer removes them (with `Priority` being the
only "removable" field at this point). Therefore, the transition
will happen slowly when the maintainers and their personal tooling
is ready. Though, maintainers of backports should keep this change
in mind, since the `dpkg` version will be relevant for the new
behavior and `dpkg` in stable/oldstable will not have the correct
default for `Priority` at the beginning.

Additionally, maintainers can choose to keep the `Priority` field
in `debian/control` if they so desire at no loss of functionality.

In other words, this should be a safe change that only has benefits by
making the default simpler.

# The affected tools

Here are the tools that we are aware of that is or might be affected.

* `dpkg` (such as `dpkg-source`, `dpkg-genchanges`, and
`dpkg-gencontrol`) will need to be updated to implement
the change.

* Maintainer tools such as `lintian`, `debputy [lint|lsp server]`,
etc. should stop warning about missing `Priority` field for
unstable. Most other maintainer facing tools should not care at
all, since the `Priority` field is mostly for d-i.

With `Section` being de facto mandatory, nothing major changes here
for that field.

* `dak` and other archive processing may need tweaking as `-` will
disappear (we can assume all uploads will come from a `dpkg`
version that has these features). Concretely, any special casing
of `-` for `Priority` will be redundant, and any special case
for `-` should apply equally to `unknown` for `Section`.

Though, our understanding is that `dak` likely only uses the cases
where `dpkg` used `unknown` consistently (such the `Package-List`
in the `.dsc`). Accordingly, we suspect it might not need any
changes other than a review to be sure.

Let us know if you are aware of any tools that might be adversely
affected. Notably, let us know if any thing here would be critically
affected that would prevent roll out in `dpkg`.

# Tools we expect to be unaffected or only positively affected

* Any tool that uses `Section` and `Priority` from the Debian archive
metadata (`Packages`). We are not aware of any case where the
archive has allowed them to be missing and this change will
no affect that.

* Any tool that reads `Section` and `Priority` from `.deb` files.
The fields will now always be there rather than theoretically
optional.


Best regards,
Guillem and Niels
Daniel Baumann
2024-12-15 09:10:01 UTC
Permalink
Hi,

both sound good (dropping mandatory priority is nice and consistent,
fixing unknown section behaviour too), thanks!

ideally these changes would be in dpkg in trixie, but maintainers would
start dropping priority fields *after* trixie so that for backports we
woudn't need to add it back en masse.

Regards,
Daniel
Holger Levsen
2024-12-15 09:30:01 UTC
Permalink
Post by Daniel Baumann
both sound good (dropping mandatory priority is nice and consistent,
fixing unknown section behaviour too), thanks!
indeed! thank you both!
Post by Daniel Baumann
ideally these changes would be in dpkg in trixie, but maintainers would
start dropping priority fields *after* trixie so that for backports we
woudn't need to add it back en masse.
indeed.
--
cheers,
Holger

⢀⣎⠟⠻⢶⣊⠀
⣟⠁⢠⠒⠀⣿⡁ holger@(debian|reproducible-builds|layer-acht).org
⢿⡄⠘⠷⠚⠋⠀ OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
⠈⠳⣄

Very hard to relate to those who think the first three years of the pandemic
were bad because they couldn’t go to bars for a while, as opposed to because
25 million people died, 400 million were disabled, and many more continue to
be unable to access public space.
Andreas Tille
2024-12-21 07:40:01 UTC
Permalink
Hi,

since feedback was requested the normally unwanted +1 ...
Post by Holger Levsen
Post by Daniel Baumann
both sound good (dropping mandatory priority is nice and consistent,
fixing unknown section behaviour too), thanks!
indeed! thank you both!
Sounds good to me
Post by Holger Levsen
Post by Daniel Baumann
ideally these changes would be in dpkg in trixie, but maintainers would
start dropping priority fields *after* trixie so that for backports we
woudn't need to add it back en masse.
indeed.
ACK

Thank you for the suggestion, Niels
Andreas.
--
https://fam-tille.de
Charles Plessy
2024-12-15 13:00:01 UTC
Permalink
We would like [...] that `dpkg` provides defaults [...] if the fields
are omitted from `debian/control`, you get `Priority: optional` and
`Section: unknown` as default in all artifacts (`.dsc`, `.changes`,
and in the `.deb`).
Hi Niels and Guillem,

that sounds good, thank you for proposing it. Can I ask you to expand a
bit on how you envision how it plays with the archive overrides system
(https://wiki.debian.org/FtpMaster/Override) and why it is better that a
default for missing values is provided by dpkg rather by the archive?

Have a nice day,

Charles
Niels Thykier
2024-12-15 13:40:09 UTC
Permalink
Post by Charles Plessy
We would like [...] that `dpkg` provides defaults [...] if the fields
are omitted from `debian/control`, you get `Priority: optional` and
`Section: unknown` as default in all artifacts (`.dsc`, `.changes`,
and in the `.deb`).
Hi Niels and Guillem,
that sounds good, thank you for proposing it. Can I ask you to expand a
bit on how you envision how it plays with the archive overrides system
(https://wiki.debian.org/FtpMaster/Override) and why it is better that a
default for missing values is provided by dpkg rather by the archive?
Have a nice day,
Charles
Hi Charles,

The default from `dpkg` is **not** intended as a replacement for the FTP
Master overrides system, so we envision this will continue unaffected.

Also, this change is about `dpkg` being consistent about *how* the
defaults are implemented. However, `dpkg` has *always* provided a
default for `.dsc` and `.changes`, which is (as I understand it) what
`dak` uses. What changes is that:

1) The default for the `.dsc` and `.changes` no longer will use `-` in
some cases and a "proper" value in other. As an example, in the
`Files` field of the `.changes` Priority and Section would default
to `-` but for the `Package-List` field in the `.dsc` it would use
`unknown`. With this change, both cases will use the same value.

For `Priority`, the new default will be `optional` with is a valid
value for that field and also exceedingly common. For `Section`,
it will be `unknown` (rather than a mix of `-` and `unknown`).

2) The default will also be visible in the control file of the `.deb`.
Since the fields have been de-facto mandatory for the past 15+
years in packaging practice, there will not be a visible effect
right now. Only if you were to start omitting fields would you see
a difference between "old dpkg" and "new dpkg".

Best regards,
Niels
Guillem Jover
2024-12-31 17:50:01 UTC
Permalink
Hi!
Post by Niels Thykier
Historically, if you omitted `Priority` and `Section` from your
package, `dpkg` would warn and use `-` or `unknown` as placeholder
when it absolutely needed a value for these fields in the `.dsc` and
the `.changes` file. The resulting `.deb` would omit the field.
We would like to change this behavior such that `dpkg` provides
defaults for these fields. That is, if the fields are omitted from
`debian/control`, you get `Priority: optional` and `Section: unknown`
as default in all artifacts (`.dsc`, `.changes`, and in the `.deb`).
Given the type of change, which seems rather safe and unobtrusive, and
with no concerns raised…
Post by Niels Thykier
# The affected tools
Here are the tools that we are aware of that is or might be affected.
* `dpkg` (such as `dpkg-source`, `dpkg-genchanges`, and
`dpkg-gencontrol`) will need to be updated to implement
the change.
…I'm going to merge the changes I had queued implementing this,
targeting dpkg 1.22.12, which should get uploaded today/tomorrow.
Post by Niels Thykier
* Maintainer tools such as `lintian`, `debputy [lint|lsp server]`,
etc. should stop warning about missing `Priority` field for
unstable. Most other maintainer facing tools should not care at
all, since the `Priority` field is mostly for d-i.
With `Section` being de facto mandatory, nothing major changes here
for that field.
I think these are pending, I guess once dpkg is in unstable, then
these can be filed/implemented.
Post by Niels Thykier
* `dak` and other archive processing may need tweaking as `-` will
disappear (we can assume all uploads will come from a `dpkg`
version that has these features). Concretely, any special casing
of `-` for `Priority` will be redundant, and any special case
for `-` should apply equally to `unknown` for `Section`.
Though, our understanding is that `dak` likely only uses the cases
where `dpkg` used `unknown` consistently (such the `Package-List`
in the `.dsc`). Accordingly, we suspect it might not need any
changes other than a review to be sure.
As mentioned in the thread, an MR was sent by Niels and has already
been merged.

Thanks,
Guillem

Loading...