How to query rpm for exact versions of BuildRequires built against?
by M Hickford
On Debian, I can use `apt show` or `dpkg-deb -I` to find out the exact versions of dependencies a deb package was built against. Can I do anything similar for a Fedora rpm package?
Example (NB. The field Built-Using is renamed to Static-Built-Using in the next version of Debian)
> apt info ./caddy_2.6.2-1_amd64.deb
Package: caddy
Version: 2.6.2-1
Built-Using: badger (= 2.2007.2-3), go-md2man-v2 (= 2.0.2+ds1-1), golang-1.19 (= 1.19.4-1), golang-blackfriday-v2 (= 2.1.0-1), golang-filippo-edwards25519 (= 1.0.0~rc1+git20210721-0.1), golang-github-alecthomas-chroma (= 0.10.0-3), golang-github-antlr-antlr4 (= 4.11.1+ds-2), golang-github-aryann-difflib (= 0.0~git20210328.ff5ff6d-4), golang-github-beorn7-perks (= 1.0.1-1), golang-github-caddyserver-certmagic (= 0.17.2-2), golang-github-cespare-xxhash (= 2.1.1-2), golang-github-chzyer-readline (= 1.4.39.g2972be2-3), golang-github-coreos-bbolt (= 1.3.5-1), golang-github-dgraph-io-ristretto (= 0.0.3-2), golang-github-dgryski-go-farm (= 0.0~git20171119.ac7624ea8da3-1.1), golang-github-dlclark-regexp2 (= 1.4.0+ds1-1), golang-github-dustin-go-humanize (= 1.0.0-3), golang-github-fullsailor-pkcs7 (= 0.0~git20210826.33d0574-2), golang-github-go-chi-chi (= 5.0.7-1), golang-github-go-kit-kit (= 0.10.0-1), golang-github-go-logfmt-logfmt (= 0.5.0-2), golang-github-go-sql-driver-mysql (= 1.5.0-2),
golang-github-golang-snappy (= 0.0.2-3), golang-github-google-uuid (= 1.3.0-1), golang-github-huandu-xstrings (= 1.3.3-1), golang-github-imdario-mergo (= 0.3.12-1), golang-github-juju-ansiterm (= 1.0.0-1), golang-github-klauspost-compress (= 1.15.12+ds1-1), golang-github-klauspost-cpuid (= 2.2.2-1), golang-github-libdns-libdns (= 0.2.0-2), golang-github-lucas-clemente-quic-go (= 0.29.0-1), golang-github-lunixbochs-vtclean (= 1.0.0-1), golang-github-manifoldco-promptui (= 0.8.0-2), golang-github-marten-seemann-qpack (= 0.2.1+ds-1), golang-github-marten-seemann-qtls-go1-19 (= 0.1.0-3), golang-github-masterminds-goutils (= 1.1.1-4), golang-github-masterminds-semver-dev (= 3.1.1-1), golang-github-masterminds-sprig (= 3.2.3-2), golang-github-mattn-go-colorable (= 0.1.13-1), golang-github-mattn-go-isatty (= 0.0.16-2), golang-github-mgutz-ansi (= 0.0~git20200706.d51e80e-1), golang-github-mholt-acmez (= 0.1.3-2), golang-github-micromdm-scep (= 2.1.0-3), golang-github-miekg-dns (= 1.1.43-1)
, golang-github-mitchellh-copystructure (= 1.2.0-1), golang-github-mitchellh-go-ps (= 0.0~git20150710.0.e6c6068-1.1), golang-github-mitchellh-reflectwalk (= 1.0.1-1), golang-github-pkg-errors (= 0.9.1-2), golang-github-prometheus-client-golang (= 1.14.0-2), golang-github-prometheus-client-model (= 0.3.0-2), golang-github-prometheus-common (= 0.39.0-1), golang-github-prometheus-procfs (= 0.8.0-3), golang-github-rs-xid (= 1.4.0-1), golang-github-shopspring-decimal (= 1.2.0-2), golang-github-smallstep-certificates (= 0.19.0-1), golang-github-smallstep-cli (= 0.15.16+ds-2), golang-github-smallstep-nosql (= 0.3.8-2), golang-github-smallstep-truststore (= 0.12.0-2), golang-github-spf13-cast (= 1.5.0-1), golang-github-spf13-cobra (= 1.6.1-1), golang-github-spf13-pflag (= 1.0.6~git20210604-d5e0c0615ace-1), golang-github-stoewer-go-strcase (= 1.2.0-4), golang-github-tailscale-tscert (= 0.0~git20220316.54bbcb9-2), golang-github-urfave-cli (= 1.22.9-2), golang-github-yuin-goldmark (= 1.5.2-1),
golang-github-yuin-goldmark-highlighting (= 0.0~git20220208.594be19-1), golang-go.crypto (= 1:0.4.0-1), golang-go.uber-atomic (= 1.10.0-1), golang-go.uber-multierr (= 1.6.0-1), golang-go.uber-zap (= 1.23.0-1), golang-golang-x-exp (= 0.0~git20221028.83b7d23-2), golang-golang-x-net (= 1:0.4.0+dfsg-1), golang-golang-x-sys (= 0.3.0-1), golang-golang-x-term (= 0.3.0-1), golang-golang-x-text (= 0.5.0-1), golang-google-genproto (= 0.0~git20200413.b5235f6-3), golang-google-grpc (= 1.33.3-1), golang-google-protobuf (= 1.28.1-2), golang-gopkg-natefinch-lumberjack.v2 (= 2.1-2), golang-gopkg-square-go-jose.v2 (= 2.6.0-1), golang-gopkg-yaml.v3 (= 3.0.1-3), golang-goprotobuf (= 1.3.5-2), golang-logrus (= 1.9.0-1), golang-protobuf-extensions (= 1.0.1-3), golang-step-cli-utils (= 0.7.5+ds-2), golang-step-crypto (= 0.17.3-2), golang-step-linkedca (= 0.19.0-1), golang-toml (= 1.2.0-2), nebula (= 1.6.1+dfsg-3)
1 year, 2 months
`go version -m` missing module version information
by M Hickford
`go version -m` prints "Go version and module versions used to build a specific executable"
Example from the Go docs https://go.dev/ref/mod#go-version-m
> The -m flag causes go version to print each executable’s embedded module version information, when available. For each executable, go version -m prints a table with tab-separated columns like the one below.
>
> $ go version -m ~/go/bin/goimports
> /home/jrgopher/go/bin/goimports: go1.14.3
> path golang.org/x/tools/cmd/goimports
> mod golang.org/x/tools v0.0.0-20200518203908-8018eb2c26ba h1:0Lcy64USfQQL6GAJma8BdHCgeofcchQj+Z7j0SXYAzU=
> dep golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
> dep golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
However this information seems to be missing in Fedora go binaries:
$ go version -m /usr/bin/caddy
caddy: go1.19
path github.com/caddyserver/caddy/cmd/caddy
build -compiler=gc
build -ldflags=" -X github.com/caddyserver/caddy/version=2.5.2 -B 0x5ed1393cc60665b6fd18eda730da04e78c91ee51 -compressdwarf=false -linkmode=external -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/caddy-2.5.2/.package_note-caddy-2.5.2-1.fc37.x86_64.ld '"
build -tags=rpm_crashtraceback
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v1
Presumably the module version information is stripped by some build flag. Could it be added back? Or would it add too much to binary size?
1 year, 2 months