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-32686 Debian: include ELF package notes #3692

Open
wants to merge 2 commits into
base: 10.11
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

@grooverdan grooverdan commented Dec 11, 2024

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

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
@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

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 25a2be2 to 8a0a22d Compare December 12, 2024 08:27
@grooverdan grooverdan changed the title MDEV-32685 Debian: include ELF package notes MDEV-32686 Debian: include ELF package notes Dec 12, 2024
@grooverdan grooverdan requested a review from vuvova December 12, 2024 22:31
@@ -131,6 +138,7 @@ in
"focal")
replace_uring_with_aio
disable_libfmt
remove_package_notes
Copy link
Member

Choose a reason for hiding this comment

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

why do you remove package notes in focal and bullseye? too old binutils?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but more directly not a dh-package-notes package that would use it.

@@ -155,6 +163,10 @@ in
exit 1
esac

if [ ! -f /usr/share/debhelper/dh_package_notes/package-notes.mk ]; then
remove_package_notes
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's a good idea. This script builds release packages. They should be consistently built the way we want them to and not depend on whatever we forgot to install on a particular new builder. Better let it fail here — we'll see it and fix the builder — instead of us suddenly releasing the package that doesn't has what we want

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. Sure.

grooverdan added a commit to grooverdan/mariadb-buildbot that referenced this pull request Dec 18, 2024
Bootstrap this package build dependency into the
CI images before server PR MariaDB/server#3692
is merged so autobake-deb builders contine to work.

Can be removed once server commit merged up to main.
grooverdan added a commit to grooverdan/mariadb-buildbot that referenced this pull request Dec 18, 2024
Bootstrap this package build dependency into the
CI images before server PR MariaDB/server#3692
is merged so autobake-deb builders contine to work.

Can be removed once server commit merged up to main.

This excludes Debian 11 and Ubuntu focal
This tests the compile using a spec file. This spec
file is defined by environment variables.

If the spec file doesn't exist (SLES/OpenSUSE),
isn't supported (e.g. clang), or has incorrect environment
variables the linker flag won't be used.
@grooverdan grooverdan force-pushed the 10.11-MDEV-32686-deb-package-notes branch from a4de93f to 9651d5d Compare December 18, 2024 06:27
@grooverdan
Copy link
Member Author

        Run Build Command(s): /usr/bin/ninja-build -v cmTC_ea164
        [1/2] /usr/bin/c++   -pie -fPIC -fstack-protector --param=ssp-buffer-size=4    -DHAVE_LINK_FLAG__specs_/usr/lib/rpm/redhat/redhat_package_notes -o CMakeFiles/cmTC_ea164.dir/src.cxx.o -c /home/dan/repos/build-mariadb-server-10.11-gcc/CMakeFiles/CMakeScratch/TryCompile-W1g5Du/src.cxx
        <command-line>: warning: ISO C++11 requires whitespace after the macro name
        [2/2] : && /usr/bin/c++ -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -rdynamic CMakeFiles/cmTC_ea164.dir/src.cxx.o -o cmTC_ea164  -specs=/usr/lib/rpm/redhat/redhat-package-notes && :
        FAILED: cmTC_ea164 
        : && /usr/bin/c++ -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -rdynamic CMakeFiles/cmTC_ea164.dir/src.cxx.o -o cmTC_ea164  -specs=/usr/lib/rpm/redhat/redhat-package-notes && :
        c++: internal compiler error: in execute, at gcc.cc:3260
        Please submit a full bug report, with preprocessed source (by using -freport-bug).
        See <http://bugzilla.redhat.com/bugzilla> for instructions.
        ninja: build stopped: subcommand failed
        
 $  c++ --version
c++ (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)

RazvanLiviuVarzaru pushed a commit to MariaDB/buildbot that referenced this pull request Dec 19, 2024
Bootstrap this package build dependency into the
CI images before server PR MariaDB/server#3692
is merged so autobake-deb builders contine to work.

Can be removed once server commit merged up to main.

This excludes Debian 11 and Ubuntu focal
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.

3 participants