Your message dated Tue, 27 Feb 2024 04:19:50 +0000
with message-id <[email protected]>
and subject line Bug#1037136: fixed in dpkg 1.22.5
has caused the Debian Bug report #1037136,
regarding dpkg-buildflags: 64-bit time_t by default
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1037136: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037136
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dpkg-dev
Version: 1.21.22
Tags: patch
User: [email protected]
Usertags: origin-ubuntu mantic patch

Hi Guillem,

The discussion on debian-devel around 64-bit time_t has died down, so I
figure it's time to propose some patches to implement what's been discussed
there.

I'm not sure whether you were persuaded that i386 should stay with the
current ABI, but anyway thought I would propose the patches and we could
discuss further if necessary.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
[email protected]                                     [email protected]
From 5a861d19b1610ae82bf95e6c5142a3365436fbd2 Mon Sep 17 00:00:00 2001
From: Steve Langasek <[email protected]>
Date: Fri, 2 Jun 2023 14:30:20 +0000
Subject: [PATCH 1/3] lfs and time64 are no longer "future", call them
 "feature" instead

Recognize future= for backwards compatibility.
---
 scripts/Dpkg/Vendor/Debian.pm | 32 ++++++++++++++++++++++----------
 scripts/t/Dpkg_BuildFlags.t   |  2 +-
 2 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 9285a61cf..f3d81bcc2 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -105,10 +105,14 @@ sub set_build_features {
 
     # Default feature states.
     my %use_feature = (
-        future => {
+        feature => {
             lfs => 0,
             time64 => 0,
         },
+        future => {
+            lfs => -1,
+            time64 => -1,
+        },
         qa => {
             bug => 0,
             canary => 0,
@@ -172,9 +176,17 @@ sub set_build_features {
         ($abi, $os, $cpu) = ('', '', '');
     }
 
-    ## Area: future
+    # compatibility: map future=[+-]lfs,time64 onto 'feature'
+    if ((my $flag = $use_feature{future}{lfs}) != -1) {
+        $use_feature{feature}{lfs} = $flag;
+    }
+    if ((my $flag = $use_feature{future}{time64}) != -1) {
+        $use_feature{feature}{time64} = $flag;
+    }
+    
+    ## Area: feature
 
-    if ($use_feature{future}{time64}) {
+    if ($use_feature{feature}{time64}) {
         # On glibc, new ports default to time64, old ports currently default
         # to time32, so we track the latter as that is a list that is not
         # going to grow further, and might shrink.
@@ -211,16 +223,16 @@ sub set_build_features {
         if ($abi_bits != 32 or
             not exists $time32_arch{$arch} or
             $libc eq 'musl') {
-            $use_feature{future}{time64} = 0;
+            $use_feature{feature}{time64} = 0;
         } elsif ($libc eq 'gnu') {
             # On glibc 64-bit time_t support requires LFS.
-            $use_feature{future}{lfs} = 1;
+            $use_feature{feature}{lfs} = 1;
         }
     }
 
-    if ($use_feature{future}{lfs}) {
+    if ($use_feature{feature}{lfs}) {
         if ($abi_bits != 32) {
-            $use_feature{future}{lfs} = 0;
+            $use_feature{feature}{lfs} = 0;
         }
     }
 
@@ -375,14 +387,14 @@ sub _add_build_flags {
     $flags->append($_, $default_flags) foreach @compile_flags;
     $flags->append('DFLAGS', $default_d_flags);
 
-    ## Area: future
+    ## Area: feature
 
-    if ($flags->use_feature('future', 'lfs')) {
+    if ($flags->use_feature('feature', 'lfs')) {
         $flags->append('CPPFLAGS',
                        '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64');
     }
 
-    if ($flags->use_feature('future', 'time64')) {
+    if ($flags->use_feature('feature', 'time64')) {
         $flags->append('CPPFLAGS', '-D_TIME_BITS=64');
     }
 
diff --git a/scripts/t/Dpkg_BuildFlags.t b/scripts/t/Dpkg_BuildFlags.t
index 850fe28b8..d64c54bfd 100644
--- a/scripts/t/Dpkg_BuildFlags.t
+++ b/scripts/t/Dpkg_BuildFlags.t
@@ -85,7 +85,7 @@ is($bf->get_origin('DPKGFLAGS'), 'env', 'flag has an env origin');
 ok($bf->is_maintainer_modified('DPKGFLAGS'), 'prepend marked flag as maint modified');
 
 my %known_features = (
-    future => [ qw(
+    feature => [ qw(
         lfs
         time64
     ) ],
-- 
2.40.1

From 02ea4e4b7b472754458a64f37f61712d55d25c91 Mon Sep 17 00:00:00 2001
From: Steve Langasek <[email protected]>
Date: Fri, 2 Jun 2023 14:54:33 +0000
Subject: [PATCH 2/3] Enable time64 by default for all 32-bit archs, except for
 i386

---
 scripts/Dpkg/Vendor/Debian.pm | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index f3d81bcc2..20d77fea1 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -107,7 +107,7 @@ sub set_build_features {
     my %use_feature = (
         feature => {
             lfs => 0,
-            time64 => 0,
+            time64 => 1,
         },
         future => {
             lfs => -1,
@@ -160,11 +160,6 @@ sub set_build_features {
     my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
     my $opts_maint = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS');
 
-    foreach my $area (sort keys %use_feature) {
-        $opts_build->parse_features($area, $use_feature{$area});
-        $opts_maint->parse_features($area, $use_feature{$area});
-    }
-
     require Dpkg::Arch;
 
     my $arch = Dpkg::Arch::get_host_arch();
@@ -176,6 +171,15 @@ sub set_build_features {
         ($abi, $os, $cpu) = ('', '', '');
     }
 
+    if ($arch eq 'i386') {
+        $use_feature{feature}{time64} = 0;
+    }
+
+    foreach my $area (sort keys %use_feature) {
+        $opts_build->parse_features($area, $use_feature{$area});
+        $opts_maint->parse_features($area, $use_feature{$area});
+    }
+
     # compatibility: map future=[+-]lfs,time64 onto 'feature'
     if ((my $flag = $use_feature{future}{lfs}) != -1) {
         $use_feature{feature}{lfs} = $flag;
-- 
2.40.1

From 7eff8f89b32b6921a0d86c50c6c62154c6ddc96e Mon Sep 17 00:00:00 2001
From: Steve Langasek <[email protected]>
Date: Fri, 2 Jun 2023 16:30:19 +0000
Subject: [PATCH 3/3] Also emit -Werror=implicit-function-declaration for
 feature=+time64

Per https://lists.debian.org/debian-devel/2023/05/msg00262.html et al.,
missing glibc includes can cause packages to link to the wrong symbols,
potentially causing crashes or misbehavior.  Since functions that use
time_t are fairly ubiquitous, there's a high risk of this happening for
*some* package in Debian.  Better to make all software with missing
function declarations fail to build now, than to spend all cycle tracking
down runtime bugs.
---
 scripts/Dpkg/Vendor/Debian.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 20d77fea1..803949024 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -400,6 +400,8 @@ sub _add_build_flags {
 
     if ($flags->use_feature('feature', 'time64')) {
         $flags->append('CPPFLAGS', '-D_TIME_BITS=64');
+        $flags->append('CFLAGS', '-Werror=implicit-function-declaration');
+        $flags->append('CXXFLAGS', '-Werror=implicit-function-declaration');
     }
 
     ## Area: qa
-- 
2.40.1

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: dpkg
Source-Version: 1.22.5
Done: Guillem Jover <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <[email protected]> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 27 Feb 2024 04:28:03 +0100
Source: dpkg
Architecture: source
Version: 1.22.5
Distribution: unstable
Urgency: medium
Maintainer: Dpkg Developers <[email protected]>
Changed-By: Guillem Jover <[email protected]>
Closes: 1037136 1063641 1064036 1064856
Changes:
 dpkg (1.22.5) unstable; urgency=medium
 .
   [ Guillem Jover ]
   * dpkg-buildapi: Remove -v alias for --version.
   * dpkg-query: Fix exit codes for --show. Closes: #1064036
   * Perl modules:
     - Dpkg::OpenPGP::Backend::Sequoia: Update to new CLI API changes.
     - Dpkg::OpenPGP::Backend::GnuPG: Add support for Sequoia gpg Chameleon.
     - Dpkg::Vendor::Debian: Only append branch compiler flags if $flag is set.
     - Dpkg::Vendor: Make the add_build_flags() a non-private method.
     - Dpkg::Vendor::Ubuntu: Pass compiler flags to disable features.
       Based on a patch by Matthias Klose <[email protected]>.
     - Dpkg::Vendor::Debian: Enable time64 feature by default except on
       <some>-i386. Closes: #1037136
       Based on a patch by Steve Langasek <[email protected]>.
     - Dpkg::Vendor::Debian: Enable qa=+bug-implicit-func for abi=+time64
       feature. Based on a patch by Steve Langasek <[email protected]>.
   * Documentation:
     - man, doc: Fix dpkg-buildapi option and command grouping in descriptions.
     - man: Add spaces around make variable assignments.
     - man: Do not duplicate list of known feature areas in dpkg-buildflags.
     - man: Document known feature areas in DEB_BUILD_OPTIONS for
       dpkg-buildpackage.
     - man: Improve build flags feature specification in environment variables.
       Closes: #1063641
     - man: Use L</> markup for inter link reference.
     - man: Mention Build-Depends-Packages in dpkg-shlibdeps(1).
   * Code internals:
     - libdpkg: Add comment clarifying GNU long name tar format expectations.
     - libdpkg: Use an intermediate mode variable in secure_unlink_statted().
     - dpkg: Rename symlink_len to linksize.
     - dpkg: Rename r variable for readlink() return value to linksize.
     - dpkg: Reduce variable scope in conffderef().
     - libdpkg: Refactor file_readlink() function.
     - libdpkg: Deindent an else clause.
     - lib, src: Fold if with last previous else.
     - perl: Fold if into previous else.
     - dpkg-mergechangelogs: Refactor merge_tail() sub from anonymous sub.
     - dpkg-query: Rename rc variables tracking no matches to misses.
     - dpkg-query: Rename failures variables tracking no matches to misses.
   * Build system:
     - Rename pkexec variables to polkitactions.
     - Move directory definitions to configure.
     - Use PACKAGE_TARNAME for pathname components in directories.
     - Split each automake variable value into its own line.
     - Reorder automake variables.
     - Move update-alternatives rules within automake conditional.
     - Move MD_LIBS from LDFLAGS to LDADD for libdpkg.
     - Fix libdpkg library flags for static and dynamic linking.
     - Add infrastructure for bash-completions.
   * Test suite:
     - Pass -T+1 to xz to workaround spurious warning with xz 5.6.0.
       Closes: #1064856
 .
   [ Helge Kreutzmann ]
   * Localization:
     - Update German man pages translation.
     - Update German scripts translation.
Checksums-Sha1:
 a327bd1b09be4af91b84d0d99e0e45595dda6eeb 3041 dpkg_1.22.5.dsc
 16de0df8aabef7a777671f3186c821d165e0e079 5627632 dpkg_1.22.5.tar.xz
 2a4adf938a94ceab4ddd577a38e4650b1f628bf8 8392 dpkg_1.22.5_amd64.buildinfo
Checksums-Sha256:
 da8f47d0174427502206282aae146858a999778c15f2c662990a09813239aa4e 3041 
dpkg_1.22.5.dsc
 26d27610536fdf951aa2be84503166c6ca8f6c36f71c049ab562ccca3233ca7e 5627632 
dpkg_1.22.5.tar.xz
 fedda0f33084e509c9c147cef44d4a39fc2a5f8fd11eb2f53e67a4a1d142e3bf 8392 
dpkg_1.22.5_amd64.buildinfo
Files:
 6feada20e49aea82498284bb446c068a 3041 admin required dpkg_1.22.5.dsc
 e93542dfde9d812b7d2b1120b9f2bb8d 5627632 admin required dpkg_1.22.5.tar.xz
 ff238038bfca125fe35af84a364b9242 8392 admin required 
dpkg_1.22.5_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEETz509DYFDBD1aWV0uXK/PqSuV6MFAmXdW04ACgkQuXK/PqSu
V6MKBRAAvGSS8SwQGu7peESxpZIIZkASJ/h+I1vrEDzfAvtBie+bYbaNVUQBurjb
qOZ50c1S07rH267GOYwFX0HlQ0RXYwmlAtT6ZiZ+XY0GLlvszN6i1yaIY8wk8Acm
royLUf18PEXb/bGfhTQRzxedWcJPwJ67You0fjZLb0SRMirZJgPE4k3tNbGHyD/5
NDMSrzYPGHL/8QwvFpp2WC4rX/gOCaEHcdJCxyA4ddXYWjMyj1xmU4h++UCY83zH
ZGj+hVWMkC4eTvwDBFtb4FeD8TPxmzJWnI211wZNbx/C8yMEdvt7nXm7PAHaRVwb
iCT7yKsmIoSwN7jinyJKeH0MgxL5FnlCwj8f/DTVHstIYAUP02eQ+G+I5vebiSF7
9yF9agcSSHuBExdCfsEuUhg+hvNy9NOQNafoutvHd8dUQ8yepCX1pIhuZ8ITwbGj
O32wXqan+8gSUwbEmsANv9KkWxESStAiL1LwR2aWQtar7LXMQrJEpPRFObUNAHwE
KDY9e8izBgnxWNWiWVuV+sBbdhNs5a+r9Vjd4YUrZF+GZrwbFqrxMGLM+qL/liGs
n3G6VfOaloAmhFObUClrW7h3yAX/6ay7spQ69TjuOpxWb288AzFcmwdgb60BnX+L
c/rmk64o4FYbebn89xcna4oLuOGwjqUaGBAycBRME8KpfcNLTIo=
=5SMN
-----END PGP SIGNATURE-----

Attachment: pgpxF7f88LQBl.pgp
Description: PGP signature


--- End Message ---

Reply via email to