debian-packaging

What's the meaning of "any" in "python3:any (>= 3.5)" in a Debian `control` file?


In meson's debian/control file, I see its Build-Depends is as follows (see the last line):

Source: meson
Maintainer: Jussi Pakkanen <jpakkane@gmail.com>
Section: devel
Priority: optional
Standards-Version: 4.5.0
Homepage: https://mesonbuild.com
X-Python3-Version: >= 3.7
Rules-Requires-Root: no
Build-Depends: debhelper (>= 12),
  python3:any (>= 3.5),
  ... ...

What is the meaning of "any" in "python3:any (>= 3.5)"?

I found the related part of the source code here (and hopefully I found the right code):

return if not $dep =~
       m{^\s*                           # skip leading whitespace
          ($pkgname_re)                 # package name
          (?:                           # start of optional part
            :                           # colon for architecture
            ([a-zA-Z0-9][a-zA-Z0-9-]*)  # architecture name
          )?                            # end of optional part

The code comment says the ":any" part specifies the architecture.

However, after reading the following chapters in Debian Policy Manual v4.5.0.2:

[2] does talk about the bracket syntax (e.g., "hurd-dev [hurd-i386]") that specifies the architectures that the package should be installed. I haven't found the text that mentions this colon syntax.

So my previous question can be further divided into:

  1. Am I correct that the "any" part specifies the architecture?
  2. If "any" specifies the architecture, what's the difference between the colon syntax (e.g., "python3:any") and the bracket syntax (e.g., "hurd-dev [hurd-i386]")?
  3. Why is the colon syntax needed if we already have the bracket syntax?
  4. Most importantly, could someone point me to the related documentation for this colon syntax?

Solution

  • Right terms first so they lead to the right docs. First of all, such fields as Build-Depends are called relationship fields. And there I could find that

    Relationships may be restricted to a certain set of architectures. This is indicated in brackets after each individual package name and the optional version specification. The brackets enclose a non-empty list of Debian architecture names in the format described in Architecture specification strings, separated by whitespace.

    So, then Architecture specification strings is what we are looking for. From this we can deduce that these are defined by dpkg-architecture. And from its manpage, architecture name is either

    The Debian architecture string, which specifies the binary tree in the FTP archive. Examples: i386, sparc, hurd-i386.

    or

    An architecture wildcard is a special architecture string that will match any real architecture being part of it. The general form is -. Examples: linux-any, any-i386, hurd-any.

    Here is additional explanation:

    Specifying only any indicates that the source package isn’t dependent on any particular architecture and should compile fine on any one. The produced binary package(s) will be specific to whatever the current build architecture is.

    ,BTW contrary to all which

    indicates that the source package will only build architecture-independent packages