Comment 7 for bug 1942394

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

dh_golang adds misc:Built-Using via `go list -f`.
1. on the target binaries, deriving "{{ range .Deps }}".
2. And then from all Deps deriving the filenames
3. and then it tracks down the package that owns the files
=> That then makes the list for Built-Using

That does not seem to exist for Rust yet.

The build-cache [1] has plenty of information on the build.
Hopefully we might be able to derive somiething from there.
rlibs are part of the linking, think intermediate static
libs [2][3].

Gladly I found that I do not have to re-invent the wheel.
dh-cargo-built-using does what I'd expect.

Along cargo install it dh_cargo runs this already.
The current format in d/control for this seems to be

  Built-Using: ${cargo:Built-Using}
  XB-X-Cargo-Built-Using: ${cargo:X-Cargo-Built-Using}

That might follow the debate in golang to not use Built-Using for
the libraries as it already splits compiler (still useful for the
potential ABI issues) but puts the libs in an extra non-standard field.

I've added this to mdevctl so that we can continue to use this as
test-example for potential e.g. britney extensions to probe component
mismatches based on it.

[1]: https://doc.rust-lang.org/cargo/guide/build-cache.html
[2]: https://doc.rust-lang.org/reference/linkage.html
[3]: https://rustc-dev-guide.rust-lang.org/backend/libs-and-metadata.html