On Mon, Oct 26, 2026, at 1:43 PM, Jeremy Bícha wrote: > Source: dh-cargo > Version: 34 > Severity: important > X-Debbugs-CC: [email protected], [email protected] > > dh-cargo forces packages to patch build.rs when a static library is > built. (I think in some cases, this can happen even if a static > library is built only by build tests.) > > In the patch, the packagers needs to indicate "whether the license(s) > of the included static libs require source distribution alongside > binaries". There isn't really an explanation for which common licenses > might require this. I didn't see a bug or discussion about why "source > distribution alongside binaries" is something that Debian needs to > worry about since we already distribute source code for everything.
The semantics of the variable value are exactly that of the `Built-Using` field as described in the Debian policy, section 7.8. If the output of the build.rs script is licensed such that the exact corresponding sources need to be preserved as long as any (other) package (statically) links it, the value should be 1. Otherwise, it should be 0. > I see some indications that some people think this applies to Rust > code distributed under the GPL but I don't think the GPL requires this > interpretation. It does, because of the following: - GPL requires the source to be provided whenever you provide a binary derived from it - GPL-licensed crate A in version X is statically linked into crate B - crate A is updated - binary package of crate B still contains a derived work of version X of crate A - the Debian archive needs to keep version X of (rust-)A around, which is done by checking Built-Using references - B must set Built-Using to include rust-A (= X), Static-Built-Using or Build-Depends is not enough to satisfy the license requirements For *regular* (dynamic) linking this is not needed, since a library A in version X always exists as a single source package with N binary packages, regular reverse-dependencies do not incorporate the contents of A, they just pull it in at runtime. If A is updated to X+1, X can be removed from the archive. > This feature was added in > https://salsa.debian.org/rust-team/dh-cargo/-/commit/36790ab787 > > This request for clarification is related to the much more general > https://bugs.debian.org/924751 I hope this helps. I'll try to find the time to improve documentation, I have to adapt dh-cargo-built-using to some upstream changes soon anyway. Fabian

