Bug#91815: Patch to add memusage and memusagestat
Hi Stephen,
On Wed, Jul 08, 2020 at 05:38:46PM +0200, Stephen Kitt wrote:
> I don’t mind, it’s not as if this is an urgent bug ;-).
Thank you for your patience and work on this.
> I went for libc-devtools to avoid making it too closely-tied to libc-dev-bin,
> on purpose; it’s not only useful for people needing libc-dev.
Sounds good to me.
> I’ve implemented this, see the attached patch. I’m not sure the upgrade
> scenario is ideal though: recommends are ignored on upgrades. This means
> that, if libc-dev-bin recommends libc-devtools, upgrades won’t install the
> latter, but new installations of libc-dev-bin will.
There is little to add here.
> Pushing memusage* to a separate package would result in that being installed
> on upgrade: libc-dev-bin would depend on libc-devtools (following the
> transition rules strictly), so that would get pulled in automatically on
> upgrade, and since it’s a new package, it would count as installation, and
> thus pull in its recommendations.
I don't have an opinion on this and leave it to the glibc maintainers.
> diff --git a/debian/control.in/main b/debian/control.in/main
> index 659267bd..c513a01a 100644
> --- a/debian/control.in/main
> +++ b/debian/control.in/main
> @@ -12,7 +12,8 @@ Build-Depends: gettext, dpkg (>= 1.18.7), dpkg-dev (>= 1.17.14), xz-utils, file,
> g++-9, g++-9-multilib [amd64 i386 kfreebsd-amd64 mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 s390x sparc sparc64 x32] <!nobiarch>,
> python3:native,
> libidn2-0 (>= 2.0.5~) <!nocheck>,
> - libc-bin (>= @GLIBC_VERSION@) <cross>
> + libc-bin (>= @GLIBC_VERSION@) <cross>,
> + libgd-dev <!stage1> <!stage2>
I suggest adding a trailing comma to make the diff for the next change
smaller.
> Build-Depends-Indep: perl, po-debconf (>= 1.0)
> Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
> Uploaders: Clint Adams <clint@debian.org>, Aurelien Jarno <aurel32@debian.org>, Adam Conrad <adconrad@0c3.net>, Samuel Thibault <sthibault@debian.org>
> @@ -47,11 +48,31 @@ Section: libdevel
> Priority: optional
> Multi-Arch: foreign
> Depends: ${shlibs:Depends}, ${misc:Depends}
> -Recommends: manpages, manpages-dev
> +Recommends: libc-devtools (>> @GLIBC_VERSION@)
> Build-Profiles: <!stage1>
> Description: GNU C Library: Development binaries
> This package contains utility programs related to the GNU C Library
> development package.
> + .
> + * gencat: generate message catalogs
> + * rpcgen: compile RPC protocols to C
> +
> +Package: libc-devtools
> +Architecture: any
> +Section: devel
> +Priority: optional
> +Multi-Arch: foreign
I doubt that memusage is eligible for Multi-Arch: foreign.
> +Depends: ${shlibs:Depends}, ${misc:Depends}
> +Recommends: manpages, manpages-dev
> +Build-Profiles: <!stage1> <!stage2>
You need Breaks + Replaces here. With the current patch, piuparts should
be unhappy.
> +Description: GNU C Library: Development tools
> + This package contains development tools shipped by the GNU C
> + Library.
> + .
> + * memusage, memusagestat: profile a program's memory usage
> + * mtrace: interpret the malloc trace log
> + * sotruss: trace shared library calls
> + * sprof: display shared object profiling data
>
> Package: libc-l10n
> Architecture: all
> diff --git a/debian/debhelper.in/libc-dev-bin.install b/debian/debhelper.in/libc-dev-bin.install
> index 0d760a7e..902029b5 100644
> --- a/debian/debhelper.in/libc-dev-bin.install
> +++ b/debian/debhelper.in/libc-dev-bin.install
> @@ -1,5 +1,2 @@
> debian/tmp-libc/usr/bin/gencat usr/bin
> -debian/tmp-libc/usr/bin/mtrace usr/bin
> debian/tmp-libc/usr/bin/rpcgen usr/bin
> -debian/tmp-libc/usr/bin/sotruss usr/bin
> -debian/tmp-libc/usr/bin/sprof usr/bin
> diff --git a/debian/debhelper.in/libc-dev-bin.manpages b/debian/debhelper.in/libc-dev-bin.manpages
> index c33123a0..576ec52c 100644
> --- a/debian/debhelper.in/libc-dev-bin.manpages
> +++ b/debian/debhelper.in/libc-dev-bin.manpages
> @@ -1,3 +1,2 @@
> debian/local/manpages/gencat.1
> debian/local/manpages/rpcgen.1
> -debian/local/manpages/sotruss.1
> diff --git a/debian/debhelper.in/libc-devtools.install b/debian/debhelper.in/libc-devtools.install
> new file mode 100644
> index 00000000..7a0024da
> --- /dev/null
> +++ b/debian/debhelper.in/libc-devtools.install
> @@ -0,0 +1,5 @@
> +debian/tmp-libc/usr/bin/memusage usr/bin
> +debian/tmp-libc/usr/bin/memusagestat usr/bin
> +debian/tmp-libc/usr/bin/mtrace usr/bin
> +debian/tmp-libc/usr/bin/sotruss usr/bin
> +debian/tmp-libc/usr/bin/sprof usr/bin
> diff --git a/debian/debhelper.in/libc-dev-bin.lintian-overrides b/debian/debhelper.in/libc-devtools.lintian-overrides
> similarity index 58%
> rename from debian/debhelper.in/libc-dev-bin.lintian-overrides
> rename to debian/debhelper.in/libc-devtools.lintian-overrides
> index eedd7cbd..1031449a 100644
> --- a/debian/debhelper.in/libc-dev-bin.lintian-overrides
> +++ b/debian/debhelper.in/libc-devtools.lintian-overrides
> @@ -1,3 +1,5 @@
> # these manpages are provided by the manpages package
> +libc-dev-bin: binary-without-manpage usr/bin/memusage
> +libc-dev-bin: binary-without-manpage usr/bin/memusagestat
> libc-dev-bin: binary-without-manpage usr/bin/mtrace
> libc-dev-bin: binary-without-manpage usr/bin/sprof
> diff --git a/debian/debhelper.in/libc-devtools.manpages b/debian/debhelper.in/libc-devtools.manpages
> new file mode 100644
> index 00000000..c43e02da
> --- /dev/null
> +++ b/debian/debhelper.in/libc-devtools.manpages
> @@ -0,0 +1 @@
> +debian/local/manpages/sotruss.1
> diff --git a/debian/rules b/debian/rules
> index 97e00f91..84bddc48 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -136,6 +136,9 @@ ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
> endif
> else
> DEB_ARCH_REGULAR_PACKAGES = $(libc) $(libc)-dev $(libc)-dbg $(libc)-pic libc-bin libc-dev-bin
> + ifeq ($(filter stage2,$(DEB_BUILD_PROFILES)),)
> + DEB_ARCH_REGULAR_PACKAGES += libc-devtools
> + endif
> DEB_INDEP_REGULAR_PACKAGES = glibc-doc glibc-source libc-l10n locales
> ifneq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
> DEB_UDEB_PACKAGES =
> diff --git a/debian/rules.d/build.mk b/debian/rules.d/build.mk
> index 0d03116a..7dbe9024 100644
> --- a/debian/rules.d/build.mk
> +++ b/debian/rules.d/build.mk
> @@ -37,7 +37,15 @@ $(stamp)configure_%: $(stamp)config_sub_guess $(stamp)patch $(KERNEL_HEADER_DIR)
> echo "BASH := /bin/bash" >> $(DEB_BUILDDIR)/configparms
> echo "KSH := /bin/bash" >> $(DEB_BUILDDIR)/configparms
> echo "SHELL := /bin/bash" >> $(DEB_BUILDDIR)/configparms
> +ifeq (,$(filter stage1 stage2,$(DEB_BUILD_PROFILES)))
> + if [ "$(curpass)" = "libc" ]; then \
> + echo "LIBGD = yes" >> $(DEB_BUILDDIR)/configparms; \
> + else \
> + echo "LIBGD = no" >> $(DEB_BUILDDIR)/configparms; \
> + fi
> +else
> echo "LIBGD = no" >> $(DEB_BUILDDIR)/configparms
> +endif
> echo "bindir = $(bindir)" >> $(DEB_BUILDDIR)/configparms
> echo "datadir = $(datadir)" >> $(DEB_BUILDDIR)/configparms
> echo "complocaledir = $(complocaledir)" >> $(DEB_BUILDDIR)/configparms
> --
> 2.20.1
>
Helmut
Reply to: