#1049406 debian-policy: Does Debian have native vs. non-native *binary* packages?

#1049406#5
Date:
2023-08-15 08:36:20 UTC
From:
To:
Hi,

I re-read a bit on the policy definition of native vs. non-native
packages and it occurred to me that the written word of the policy seems
to be confusing to read at best.


The concept of a native package is introduced in chapter 4 "Source
packages" and the following definition is given:

"""
Debian **source** packages are classified as native or non-native.

A native source package is one that does not distinguish between Debian
packaging releases and upstream releases. A native source package
contains a single tar file of source material, and the versioning does
not have a Debian-specific component. Native packages are normally (but
not exclusively) used for software that has no independent existence
outside of Debian, such as software written specifically to be a Debian
package.

[... more stuff about non-native packages ...]
"""

I put emphasis here on "Debian **source** packages", which implies that
this definition do not apply to binary packages. I had a look in Chapter
3 "Binary packages" and it does mention "Native Debian packages" but
does not define the term.
   I assume the term in chapter 3 is a forward reference to chapter 4
but it never explicitly states this. I feel it would aid the reader if
it did have a explicit forward reference if that is what it is.
   Based on this assumption, I feel the full term should probably be
along the lines of "binary packages built from a (non-)native source
package". However, I admit that phrase is a bit obscene to use compared
to "N(on-n)ative Debian packages" as it is a full sentence on its own.
However, the shorter phrase used now may confuse readers into believing
that "native binary packages" are a thing, which they do not seem to be
according to chapter 4.


Assuming we agree so far, this has the consequences that:

  * The basename of the installed changelog name ("changelog" vs.
    "changelog.Debian") is decided based on the source package version
    and not the binary package version.
    - This is de facto what debhelper does because it does not know the
      version of the binary at the time debhelper installs the changelog
      (dh_installchangelog is run long before dh_gencontrol).
    - Not sure whether this affects lintian (I do not remember the code).

  * The remark in chapter 3 about date versioning for native packages is
    misplaced and should be in chapter 4 (the one about dashes being
    unsuitable for date separators in a native package). Because, a
    binary package built from a native source *can* have hyphens in its
    version.  Both according to the letter of the policy (the "native"
    trait only applies to the source package) but also in practice[1].

Assuming we do not agree on the above reading and "native binary
packages" are a thing, then:

  * We have at least one instance of a non-native binary built from a
    native source that contains hyphens[1] with no open bugs of policy
    violations on this matter.

Maybe we should also review this from the angle of "Can a non-native
source package produce binaries without a hyphen?" (e.g., replace "-"
with "+") and still be policy complaint.  I would say "no", but tooling
wise, I am certain it is possible.  Having a rule that all binaries
built from a source must use the same "native-ness" of the source would
solve this problem but would define java-common to be non-complaint.

However for the reasons stated above, we probably do not *want* to
resolve this by mandating a binary is native based on its own version
regardless of the source version/native-ness. This would lead debhelper
to be non-compliant and in practice unable to become compliant out of
the box.

Additionally, I hope we can improve the policy language around native
vs. non-native and how it relates to binary packages.

Best regards,
Niels

[1]:
$ apt-cache show default-jre | grep -e ^Source: -e ^Version
Source: java-common (0.74)
Version: 2:1.17-74

The java-common source is a native package (version 0.74) but its binary
default-jre is 2:1.17**-**74 and contains a hyphen.

This practice existed for over a decade now as I remember and no one
complained. So the use of hyphens in binary versions are definitely not
causing tooling issues and in my eyes makes this a "common practice"
question rather than a "breaks stuff" question for whether it is allowed.

Feel free to open the on whether decade of use vs. it is only one
package. Either way, the Policy is in my eyes not clear enough / aligned
on this topic on what is allowed and what is not allowed.

#1049406#10
Date:
2024-08-09 13:13:20 UTC
From:
To:
Hi

The linux package currently uses this behaviour.  To be exact the
linux-signed-*, which are generated using the Debian code signing
infrastructure produce this:

| Package: linux-image-6.10.3-amd64
| Version: 6.10.3-1
| Built-Using: linux (= 6.10.3-1)
| Source: linux-signed-amd64 (6.10.3+1)

There are several requirements in this.

Source package:
- The source package needs to be "3.0 (native)", which is enforced by
  the code signing stuff.
- "3.0 (native)" source packages must have a native version, which the
  CTTE did not want to do anything about.
- We need to be pretty strict in what versions can be used, or they
  might not longer compare correctly.

Binary packages:
- We redirect bug reports to "src:linux", which requires all binary
  packages produced by linux and linux-signed-* to have the same
  version, or version tracking breaks down.
- We generate dependencies regardless if they are built from either
  source, which only works if we know the correct version.

Bastian

#1049406#15
Date:
2025-06-03 14:24:12 UTC
From:
To:
I came across this while dealing with #1107137 / #1007717.

My answer to the headline question is "no".

In answer to the subsidiary questions:
won't be looking at the version number of the containing binary
package.

Computers can use a much simpler algorithm: the Debian changelog is in
"changelog.Debian" if it exists and "changelog" otherwise.  I presume
this is what tooling does already.

Therefore I don't think policy needs to demand that the Debian
changelog installation path depends on the binary version number.

Usually it will make semantic sense to use the source version number.
After all, the changelog is a source changelog, and whether there is a
distinct upstream is a property of the way we organise the
development, not a property of how the binary package is made.

But I don't think it matters if some package does this differently for
some reason.

Yes.  Indeed I think *all* the discussion of version numbers in that
chapter is misplaced.  As things are currently structured, that
material ought to be in the description of the Version control field.

But, there's a *lot* of stuff about version numbering.  Perhaps it
would be better to put it all in its own chapter and leave the
`Version:` element as a stub which refers to that chapter.

IMO, yes.  This should be allowed, and also the converse should be
allowed.  We already allowe binary version numbers to diverge from the
source version number.  I'm not sure why there would be a rule of this
kind.

If we move the stuff about version numbers to where it belongs, then
policy will be silent on all of these questions, and all the existing
(working) practices are implicitly legitimised.

Ian.

#1049406#20
Date:
2026-01-10 10:10:20 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.