Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-32685 Debian: include ELF package notes #3692

Open
wants to merge 1 commit into
base: 10.11
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

  • The Jira issue number for this PR is: MDEV-32685

Description

Providing build information compiled into the executable provides the ability of core file
handlers to access information on the distro and source package version. This information
can sometime be lost between the source and an upstream bug report.

The Debian dh-package-notes includes the makefile included in debian/rules that
sets linking flags to the right values.

ref: https://systemd.io/ELF_PACKAGE_METADATA/

Release Notes

Include OS information compiled into executables.

How can this PR be tested?

As buildbot workers don't have the dh-package-notes package installed yet:

$ podman run --rm -ti -v "$PWD":/source:Z --mount=type=tmpfs,tmpfs-size=10G,dst=/source/build--shm-size=10g --workdir /source/build --entrypoint /bin/bash --user root --cap-add=SYS_PTRACE  --name bbwdeb12 quay.io/mariadb-foundation/bb-worker:debian12 

$ podman exec -ti --user root bbwdeb12  apt-get install dh-package-notes

root@b7a6380fdaae:/source/build# cd ..
root@b7a6380fdaae:/source# debian/autobake-deb.sh 
'storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.install' -> 'debian/mariadb-plugin-columnstore.install'
'storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.postinst' -> 'debian/mariadb-plugin-columnstore.postinst'
'storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.postrm' -> 'debian/mariadb-plugin-columnstore.postrm'
'storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.prerm' -> 'debian/mariadb-plugin-columnstore.prerm'
'storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.triggers' -> 'debian/mariadb-plugin-columnstore.triggers'
Incrementing changelog and starting build scripts
libdistro-info-perl is not installed, Debian release names are not known.
libdistro-info-perl is not installed, Ubuntu release names are not known.
Creating package version 1:10.11.11+maria~deb12 ... 
dpkg-buildpackage: info: source package mariadb
dpkg-buildpackage: info: source version 1:10.11.11+maria~deb12
dpkg-buildpackage: info: source distribution bookworm
dpkg-buildpackage: info: source changed by MariaDB Developers <[email protected]>
dpkg-buildpackage: info: host architecture amd64
dpkg-buildpackage: warning: debian/rules is not executable; fixing that

....
 readelf --notes  client/mariadb-admin 

Displaying notes found in: .note.gnu.property
  Owner                Data size 	Description
  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
      Properties: x86 ISA needed: x86-64-baseline

Displaying notes found in: .note.gnu.build-id
  Owner                Data size 	Description
  GNU                  0x00000014	NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: 054f19cafdd61616daed80c75a7213c78437c668

Displaying notes found in: .note.ABI-tag
  Owner                Data size 	Description
  GNU                  0x00000010	NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 3.2.0

Displaying notes found in: .note.package
  Owner                Data size 	Description
  FDO                  0x00000098	FDO_PACKAGING_METADATA
    Packaging Metadata: {"type":"deb","os":"Debian","name":"mariadb","version":"1:10.11.11+maria~deb12","architecture":"amd64","debugInfoUrl":"https://debuginfod.debian.net"}

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
  • [*] This is a safe to backport enhancement to the build process

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@grooverdan grooverdan requested a review from ottok December 11, 2024 22:39
Providing build information compiled into the
executable provides the ability of core file
handlers to access information on the distro
and source package version. This information
can sometime be lost between the source and
an upstream bug report.

The Debian dh-package-notes includes the
makefile included in debian/rules that
sets linking flags to the right values.

Add a small bit of safety that if the makefile
isn't installed build anyway.

ref: https://systemd.io/ELF_PACKAGE_METADATA/
@grooverdan grooverdan force-pushed the 10.11-MDEV-32686-deb-package-notes branch from 6fa05a9 to 25a2be2 Compare December 11, 2024 22:40
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Dec 11, 2024
Copy link
Contributor

@ottok ottok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I didn't even know that this exists: https://manpages.debian.org/unstable/dh-package-notes/dh_package_notes.1.en.html

I do spot any issues or have concerns, approving.

@ottok
Copy link
Contributor

ottok commented Dec 12, 2024

PR description has still unchecked checkboxes

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MariaDB Foundation Pull requests created by MariaDB Foundation
Development

Successfully merging this pull request may close these issues.

2 participants