XPost: linux.debian.bugs.dist
From:
[email protected]
Package: dpkg-dev
Followup-For: Bug #872381
Hello.
Please consider this new patch queue instead of the old or untested
ones. With this one applied on 279c6ccb, the package builds and
passes all tests.
* scripts/mk: only use ASCII characters
Cosmetic independent suggestion.
* scripts/mk: protect files against double inclusion
The variables are renamed as you have recommended.
The test is fixed (ifdef fails on a defined but empty variable).
* scripts/mk: stop hard-coding dpkg_datadir
Already discussed.
* scripts/mk/buildopts.mk: search once for parallel= in DEB_BUILD_OPTIONS
[...DEB_BUILD_OPTION_PARALLEL empty instead of undefined
when parallel= is missing...]
[kind of an API change].
I have changed my patch and updated the comment.
However..
The policy only describes 'parallel=N' when N is a positive integer.
I think we should assume that the option is either missing or valid.
For me, 'parallel=' is as incorrect as 'parallel=foo'.
I think it might perhaps make more sense to fallback to setting it
to 1 if it's missing, but I need to ponder about possible consequences/fallout, etc.
I doubt any sensible default exist.
* 1 is safe/produces readable logs and $max_available_processors is fast.
* the policy/debhelper/... have found no one-size-fits-all solution.
* scripts/buildflags.mk: add missing GCJFLAGS
Fixes a bug.
* scripts/buildflags.mk: generate the _FOR_BUILD variant of each variable
* scripts/buildflags.mk: sort the flag list
These changes hopefully prevent new missing flags in the future (the
output of dpkg-buildflags is sorted).
* scripts/*.mk: reduce the number of subprocesses
* scripts/t: use loops instead of repetitions, check exports and overrides
* all four combinations of existing/new scripts/mk/*.mk pass the
existing/new tests in scripts/t/mk/*.mk.
* comparing the time taken by tests gives a rough idea of the speed
gain
architecture.mk 30 times faster (probably no gain under dpkg-buildpackage)
buildflags.mk 20 times faster
pkg-info.mk 4 times faster
buildtools.mk 20% faster
Guillem Jover
I've left this one out for now. I'm not entirely satisfied with the
sed usage here. If we keep using sed, then I think it needs to be
set via a SED variable, substituted from the value found at
In which context do you expect GNU Make but a non recent sed?
Should I rewrite the regular expressions without -r/-E?
configure time. But then, I've been pondering whether we can have
better export formats, that might make the sed usage not
necessary. I started with a make-eval export mode for buildflags,
but perhaps it would be better a more generic formatting mode where
the caller can specify how the output should look like, akin
�dpkg-query --showformat�. Will ponder about this.
A generic format would be more maintainable in the long term.
Something like that would be convenient for the makefiles.
dpkg-architecture --print-format='${Dollar}(eval export ${key} ?= ${value})' dpkg-buildflags --print-format='${Dollar}(eval ${key}:=${value})' dpkg-parsechangelog --print-format='${Dollar}(eval DEB_SOURCE:=${Source}) ${Dollar}(eval export SOURCE_DATE_EPOCH?=${Timestamp}) ..'
dpkg-vendor --print-format'${Dollar}(eval DEB_VENDOR:=${Vendor}) ${Dollar}(eval DEB_PARENT_VENDOR:=${Parent})'
* scripts/buildtools.mk: style suggestions
This arguably improves the readability, and fixes a minor issue
($(findstring nostrip,...) unwantedly matches arduinostrip).
* scripts/t/mk/buildflags.mk: fix test of _MAINT_APPEND when TEST_ is empty
This fixes a minor issue. During a test with
DEB_BUILD_OPTIONS=noopt, TEST_CXXFLAGS was empty and caused the test
of DEB_CXXFLAGS_MAINT_APPEND to fail because the correct result is
not a concatenation, Make strips a space. This issue can also be
seen with 1.22.5.
From 37f1089c450fca16d06d586cf390a05642af25f0 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <
[email protected]>
Date: Mon, 4 Mar 2024 13:23:56 +0100
Subject: [PATCH 01/11] scripts/mk: only use ASCII characters
The policy recommends english, so french parenthesis must be replaced.
More generally, prudence recommends ASCII in Make scripts.
---
scripts/mk/buildtools.mk | 2 +-
scripts/mk/vendor.mk | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk
index 933fdcfaa..7c6732210 100644
--- a/scripts/mk/buildtools.mk
+++ b/scripts/mk/buildtools.mk
@@ -20,7 +20,7 @@
# QMAKE: Qt build system generator (since dpkg 1.20.0).
#
# All the above variables have a counterpart variable for the build tool,
-# as in CC → CC_FOR_BUILD.
+# as in CC -> CC_FOR_BUILD.
#
# The variables are not exported by default. This can be changed by
# defining DPKG_EXPORT_BUILDTOOLS.
diff --git a/scripts/mk/vendor.mk b/scripts/mk/vendor.mk
index f3241a57b..8bdaa235a 100644
--- a/scripts/mk/vendor.mk
+++ b/scripts/mk/vendor.mk
@@ -1,8 +1,8 @@
# This Makefile fragment (since dpkg 1.16.1) defines the following
# vendor-related variables:
#
-# DEB_VENDOR: output of «dpkg-vendor --query Vendor».
-# DEB_PARENT_VENDOR: output of «dpkg-vendor --query Parent» (can b