Bug#1024367: In 4.9.1, the example uses not recommended install -s

2023-09-24 Thread Sean Whitton
Hello,

On Sat 09 Sep 2023 at 03:16pm -07, Russ Allbery wrote:

> I looked at this snippet and I think it has worse problems than the use of
> install -s.  For example, it predates the existence of dpkg-buildflags,
> which would also handle noopt.  I'm also dubious that it serves any useful
> purpose given that nearly every package should just use debhelper.  The
> typical current Debian packager seems more likely to be confused by this
> fragment than aided by it.
>
> I'm therefore going to propose fixing this bug with the following patch,
> which is more aggressive than you propose.
>
> I think this is informative rather than normative and therefore
> technically doesn't require seconds, but I'll give this some time for
> other people to take a look and talk me out of deleting this section if
> they wish.
>
> --
> Russ Allbery (r...@debian.org)  
>
>>From 409bbd815a946a7bb7b1eea8cab8198c494dd7d4 Mon Sep 17 00:00:00 2001
> From: Russ Allbery 
> Date: Sat, 9 Sep 2023 15:10:21 -0700
> Subject: [PATCH] Remove old Makefile DEB_BUILD_OPTIONS example
>
> The correct way to implement most DEB_BUILD_OPTIONS these days is
> to just use debhelper. The detailed Makefile fragment was probably
> more confusing than helpful, given that it predates dpkg-buildflags,
> uses install -s (which Policy elsewhere recommends against), and
> manually does other work debhelper would automate. Replace it with
> a note that packaging helper frameworks do much of this work.
> ---
>  policy/ch-source.rst | 35 +++
>  1 file changed, 3 insertions(+), 32 deletions(-)

LGTM.

-- 
Sean Whitton


signature.asc
Description: PGP signature


Bug#1024367: In 4.9.1, the example uses not recommended install -s

2023-09-10 Thread Edward Little
Please remove the following email address:  e.little...@gmail.com

On Sat, Sep 9, 2023 at 6:18 PM Russ Allbery  wrote:

> Enrico Zini  writes:
>
> > Hello, and thank you for maintaining the Policy!
>
> > Policy paragraph 4.9.1 has an example debian/rules which contains these
> > lines:
>
> >INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755
>
> >ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
> >INSTALL_PROGRAM += -s
> >endif
>
> > However, paragraph 10.1 recommends against it:
>
> >It is not recommended to strip binaries by passing the "-s" flag to
> >"install", because this fails to remove .comment and .note sections,
> >and also prevents the automatic creation of dbgsym binary packages by
> >tools like "dh_strip".
>
> > I would personally prefer if the example built on debhelper. If the
> > intention is to show what are the expectations at a lower level then
> > I wish the example had a comment saying "This snippet serves to explain
> > what are the expectations as a lower level. You usually want to use
> > debhelper instead"
>
> I looked at this snippet and I think it has worse problems than the use of
> install -s.  For example, it predates the existence of dpkg-buildflags,
> which would also handle noopt.  I'm also dubious that it serves any useful
> purpose given that nearly every package should just use debhelper.  The
> typical current Debian packager seems more likely to be confused by this
> fragment than aided by it.
>
> I'm therefore going to propose fixing this bug with the following patch,
> which is more aggressive than you propose.
>
> I think this is informative rather than normative and therefore
> technically doesn't require seconds, but I'll give this some time for
> other people to take a look and talk me out of deleting this section if
> they wish.
>
> --
> Russ Allbery (r...@debian.org)  
>
>


Bug#1024367: In 4.9.1, the example uses not recommended install -s

2023-09-09 Thread gregor herrmann
On Sat, 09 Sep 2023 15:16:10 -0700, Russ Allbery wrote:

> I'm therefore going to propose fixing this bug with the following patch,
> which is more aggressive than you propose.
> 
> I think this is informative rather than normative and therefore
> technically doesn't require seconds, but I'll give this some time for
> other people to take a look and talk me out of deleting this section if
> they wish.

Looks good to me.

Cheers,
gregor 


-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   


signature.asc
Description: Digital Signature


Bug#1024367: In 4.9.1, the example uses not recommended install -s

2023-09-09 Thread Russ Allbery
Enrico Zini  writes:

> Hello, and thank you for maintaining the Policy!

> Policy paragraph 4.9.1 has an example debian/rules which contains these
> lines:

>INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755

>ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
>INSTALL_PROGRAM += -s
>endif

> However, paragraph 10.1 recommends against it:

>It is not recommended to strip binaries by passing the "-s" flag to
>"install", because this fails to remove .comment and .note sections,
>and also prevents the automatic creation of dbgsym binary packages by
>tools like "dh_strip".

> I would personally prefer if the example built on debhelper. If the
> intention is to show what are the expectations at a lower level then
> I wish the example had a comment saying "This snippet serves to explain
> what are the expectations as a lower level. You usually want to use
> debhelper instead"

I looked at this snippet and I think it has worse problems than the use of
install -s.  For example, it predates the existence of dpkg-buildflags,
which would also handle noopt.  I'm also dubious that it serves any useful
purpose given that nearly every package should just use debhelper.  The
typical current Debian packager seems more likely to be confused by this
fragment than aided by it.

I'm therefore going to propose fixing this bug with the following patch,
which is more aggressive than you propose.

I think this is informative rather than normative and therefore
technically doesn't require seconds, but I'll give this some time for
other people to take a look and talk me out of deleting this section if
they wish.

-- 
Russ Allbery (r...@debian.org)  

>From 409bbd815a946a7bb7b1eea8cab8198c494dd7d4 Mon Sep 17 00:00:00 2001
From: Russ Allbery 
Date: Sat, 9 Sep 2023 15:10:21 -0700
Subject: [PATCH] Remove old Makefile DEB_BUILD_OPTIONS example

The correct way to implement most DEB_BUILD_OPTIONS these days is
to just use debhelper. The detailed Makefile fragment was probably
more confusing than helpful, given that it predates dpkg-buildflags,
uses install -s (which Policy elsewhere recommends against), and
manually does other work debhelper would automate. Replace it with
a note that packaging helper frameworks do much of this work.
---
 policy/ch-source.rst | 35 +++
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/policy/ch-source.rst b/policy/ch-source.rst
index 4307e89..b6f2c86 100644
--- a/policy/ch-source.rst
+++ b/policy/ch-source.rst
@@ -588,38 +588,9 @@ The meaning of the following tags has been standardized:
 
 Unknown flags must be ignored by ``debian/rules``.
 
-The following makefile snippet is an example of how one may implement
-the build options; you will probably have to massage this example in
-order to make it work for your package.
-
-.. code-block:: Makefile
-
-CFLAGS = -Wall -g
-INSTALL = install
-INSTALL_FILE= $(INSTALL) -p-o root -g root  -m  644
-INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755
-INSTALL_SCRIPT  = $(INSTALL) -p-o root -g root  -m  755
-INSTALL_DIR = $(INSTALL) -p -d -o root -g root  -m  755
-
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-CFLAGS += -O0
-else
-CFLAGS += -O2
-endif
-ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-build:
-# ...
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-# Code to run the package test suite.
-endif
-
+Packaging helper frameworks such as debhelper will automatically support
+many of these options without any further work required by the package
+maintainer.
 
 .. _s-debianrules-gainrootapi:
 
-- 
2.40.1



Bug#1024367: In 4.9.1, the example uses not recommended install -s

2022-11-18 Thread Bill Allombert
On Fri, Nov 18, 2022 at 02:14:32PM +0100, Enrico Zini wrote:
> Package: debian-policy
> Version: 4.6.1.1
> Severity: normal
> 
> Hello, and thank you for maintaining the Policy!
> 
> Policy paragraph 4.9.1 has an example debian/rules which contains these
> lines:
> 
>INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755
> 
>ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
>INSTALL_PROGRAM += -s
>endif
> 
> However, paragraph 10.1 recommends against it:
> 
>It is not recommended to strip binaries by passing the "-s" flag to
>"install", because this fails to remove .comment and .note sections,
>and also prevents the automatic creation of dbgsym binary packages by
>tools like "dh_strip".
> 
> I would personally prefer if the example built on debhelper. If the
> intention is to show what are the expectations at a lower level then
> I wish the example had a comment saying "This snippet serves to explain
> what are the expectations as a lower level. You usually want to use
> debhelper instead"

I know it is not what you are after, but maybe it is time to fix install -s ?

dh_strip only work if the upstream 'make install' did not already
strip the binaries by using install -s itself. So packagers need to work
around it each time.

Cheers,
-- 
Bill. 

Imagine a large red swirl here. 



Bug#1024367: In 4.9.1, the example uses not recommended install -s

2022-11-18 Thread Enrico Zini
Package: debian-policy
Version: 4.6.1.1
Severity: normal

Hello, and thank you for maintaining the Policy!

Policy paragraph 4.9.1 has an example debian/rules which contains these
lines:

   INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755

   ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
   INSTALL_PROGRAM += -s
   endif

However, paragraph 10.1 recommends against it:

   It is not recommended to strip binaries by passing the "-s" flag to
   "install", because this fails to remove .comment and .note sections,
   and also prevents the automatic creation of dbgsym binary packages by
   tools like "dh_strip".

I would personally prefer if the example built on debhelper. If the
intention is to show what are the expectations at a lower level then
I wish the example had a comment saying "This snippet serves to explain
what are the expectations as a lower level. You usually want to use
debhelper instead"

Enrico


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

debian-policy depends on no packages.

Versions of packages debian-policy recommends:
ii  libjs-sphinxdoc  4.5.0-4

Versions of packages debian-policy suggests:
ii  doc-base  0.11.1

-- no debconf information