• Bug#1069256: debian-policy: clarify requirement for use of Static-Built

    From Simon Josefsson@21:1/5 to Maytham Alsudany on Fri Apr 19 10:30:01 2024
    XPost: linux.debian.policy

    Maytham Alsudany <maytha8thedev@gmail.com> writes:

    In early 2022, Guillem added support for a new Static-Built-Using field to dpkg, encouraging packagers to use it over Built-Using to specify statically-linked dependencies [2]. The commit message states the following:

    This field mimics the previous Built-Using field semantics, but is
    specifically intended for shadow dependencies stemming from static builds.

    In Debian, the Rust and Go teams agreed to use this language agnostic field,
    instead of one for each of the languages. This means it can be easily
    supported by dpkg, and can be used by other languages and run-times.

    This was also added to the deb-control(5) manpage, specifically differentiating
    it from Built-Using as a field to be used "for static building purposes (for example linking against static libraries, builds for source-centered languages
    such as Go or Rust[...])".

    The proposed change is to clarify and formally mandate the requirement to declare statically-linked libraries used to build packages containing binaries
    in Static-Built-Using. Attached is a draft patch of the proposed change. Feedback is welcome!

    I think there is a gap between "statically linked libraries" and "builds
    for source-centered languages" -- could it be clarified if
    Static-Built-Using is intended to cover situations where package A
    incorporate source code from package B and source code from B affects
    whatever goes into the binary package of A? That is definitely true for statically linked libraries.

    I'm thinking of how gnulib C code is included in many packages, which
    could be set up to work in a way similar to how Go packages work. I
    just made 'libntlm' use the 'gnulib' package this way, to reduce
    xz-related risks with vendored gnulib code. Should libntlm's
    debian/control now include a 'Static-Built-Using: gnulib'?

    /Simon

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCZiIo3BQcc2ltb25Aam9z ZWZzc29uLm9yZwAKCRBRcisI/kdFolJAAQCFtVfCwaewV/pW19vMszL6/Lp7YuEt 4oNG0QwTteeWFQEAgamYomY9lacrHt5Lp8ZQLYdMHrsELMZ/qyJW1TaP8g4=SLvs
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Hofstaedtler@21:1/5 to Maytham Alsudany on Sat Apr 20 11:50:01 2024
    XPost: linux.debian.policy

    On Thu, Apr 18, 2024 at 11:29:11PM +0300, Maytham Alsudany wrote:
    +``Static-Built-Using``
    +~~~~~~~~~~~~~~~~~~~~~~

    IMO this should not only state when it is to be used, but also what
    it is used for and by whom. IOW who is the intended receiver. What
    will they do with the info provided in this field?

    +When a binary is statically linked to libraries in other packages and +incorporated into the build process,

    Should this also include non-libraries that were included?
    publicsuffix is a package providing *data* that is often translated
    into binary data during package builds and thus included. But it is
    not a "library" in the traditional way.

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Guillem Jover@21:1/5 to Maytham Alsudany on Sat Apr 20 20:30:02 2024
    XPost: linux.debian.policy

    Hi!

    On Thu, 2024-04-18 at 23:29:11 +0300, Maytham Alsudany wrote:
    Package: debian-policy
    Version: 4.7.0.0
    Severity: normal
    X-Debbugs-Cc: debian-devel@lists.debian.org

    In early 2022, Guillem added support for a new Static-Built-Using field to dpkg, encouraging packagers to use it over Built-Using to specify statically-linked dependencies [2]. The commit message states the following:

    This field mimics the previous Built-Using field semantics, but is
    specifically intended for shadow dependencies stemming from static builds.

    In Debian, the Rust and Go teams agreed to use this language agnostic field,
    instead of one for each of the languages. This means it can be easily
    supported by dpkg, and can be used by other languages and run-times.

    This was also added to the deb-control(5) manpage, specifically differentiating
    it from Built-Using as a field to be used "for static building purposes (for example linking against static libraries, builds for source-centered languages
    such as Go or Rust[...])".

    I think this (and the policy proposal) is omitting several important
    parts for the intended use for the field, as it was considered on its
    addition. Quoting from deb-control(5) for context, which I think
    covers the concerns from the mails from Simon and Chris:

    Built-Using: <package-list>
    This dependency field lists extra source packages that were used
    during the build of this binary package, for license compliance
    purposes. This is an indication to the archive maintenance
    software that these extra source packages must be kept whilst this
    binary package is maintained. This field must be a comma-separated
    list of source package names with strict ‘=’ version relationships
    enclosed within parenthesis. Note that the archive maintenance
    software is likely to refuse to accept an upload which declares a
    Built-Using relationship which cannot be satisfied within the
    archive.

    Static-Built-Using: <package-list>
    This dependency field lists extra source packages that were used
    during the build of this binary package, for static building
    purposes (for example linking against static libraries, builds for
    source-centered languages such as Go or Rust, usage of header-only
    C/C++ libraries, injecting data blobs into code, etc.). This is
    useful to track whether this package might need to be rebuilt when
    source packages listed here have been updated, for example due to
    security updates. This field must be a comma-separated list of
    source package names with strict ‘=’ version relationships enclosed
    within parenthesis.

    Supported since dpkg 1.21.3.

    The proposed change is to clarify and formally mandate the requirement to declare statically-linked libraries used to build packages containing binaries
    in Static-Built-Using. Attached is a draft patch of the proposed change.

    Thanks for starting this!

    As mentioned before I think the currently proposed description is too restrictive and specific to Go and Rust, and it should be expanded. The
    example usage seems also too specific, and might lead people to think
    this is the only valid use, and their placement feels a bit odd, perhaps
    these should be given as a footnote? (But this is really for the Policy
    editors to decide.)

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter B@21:1/5 to All on Wed Apr 24 16:40:01 2024
    XPost: linux.debian.policy

    Regarding ;-

    "(for example linking against static libraries, builds for
     source-centered languages such as Go or Rust, usage of header-only
     C/C++ libraries, injecting data blobs into code, etc.)"

    Perhaps Pascal & Lazarus could be added to that list for clarity? [1]


    Regards,
    Peter

    [1]  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=997948

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)