Bug#1078153: pan: please make the build reproducible

Chris Lamb lamby at debian.org
Wed Aug 7 14:00:14 BST 2024


Source: pan
Version: 0.159-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: uname
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
pan could not be built reproducibly.

This is because the /usr/bin/pan binary embedded the kernel version
name and version number:

│ │ │ ├── ./usr/bin/pan
[…]
│ │ │ │ ├── strings --all --bytes=8 {}
│ │ │ │ │ @@ -5307,15 +5307,15 @@
│ │ │ │ │  Heinrich M
│ │ │ │ │  ller <heinrich.mueller82 at gmail.com> - Developer
│ │ │ │ │  Kenneth Haley <haleykd at users.sf.net> - Developer
│ │ │ │ │  Petr Kovar <pknbe at volny.cz> - Contributor
│ │ │ │ │  Calin Culianu <calin at ajvar.org> - Threaded Decoding
│ │ │ │ │  Christophe Lambin <chris at rebelbase.com> - Original Developer
│ │ │ │ │  Matt Eagleson <matt at rebelbase.com> - Original Developer
│ │ │ │ │ -Vovchansk (; Linux-6.9.7+bpo-amd64)
│ │ │ │ │ +Vovchansk (; Linux-6.1.0-23-amd64)
│ │ │ │ │  Copyright 
│ │ │ │ │   2002-2021 Charles Kerr and others
│ │ │ │ │  GNU GENERAL PUBLIC LICENSE


A patch is attached that has the effect that, if SOURCE_DATE_EPOCH
exists, we assume that a reproducible build is intended and the
"Linux-6.1.0-23-amd64" string is replaced with "-" (hyphen).

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build	2024-08-07 13:54:54.710051195 +0100
@@ -0,0 +1,20 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-08-07
+
+--- pan-0.159.orig/CMakeLists.txt
++++ pan-0.159/CMakeLists.txt
+@@ -190,7 +190,12 @@ if(NOT COMPILED_LKSTRFTIME_TEST)
+   message(WARNING "failed to compile test-strftime.c")
+ endif()
+ 
+-set(PLATFORM_INFO ${CMAKE_HOST_SYSTEM})
++# Don't embed uname -sr in PLATFORM_INFO for a reproducible build.
++if (DEFINED ENV{SOURCE_DATE_EPOCH})
++  set(PLATFORM_INFO "-")
++else ()
++  set(PLATFORM_INFO ${CMAKE_HOST_SYSTEM})
++endif ()
+ message(STATUS "platform: ${PLATFORM_INFO}")
+ 
+ # https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
--- a/debian/patches/series	2024-08-07 13:49:15.464412610 +0100
--- b/debian/patches/series	2024-08-07 13:54:53.838047062 +0100
@@ -1,2 +1,3 @@
 use-x-www-browser
 rm-windows-mac-entries
+reproducible-build


More information about the Reproducible-bugs mailing list