[pkg-php-pear] Bug#1150327: php-nesbot-carbon: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Oct 8 18:29:52 BST 2026


Source: php-nesbot-carbon
Version: 3.10.3-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: nocheck
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

This is because the testsuite bumps the modification time of the
src/Carbon/Lang directory to the current time (which later gets clamped
*back* to SOURCE_DATE_EPOCH), so if the tests are skipped via nocheck,
then this directory will retain its original, upstream timestamp.

Patch attached that ensures this directory always has the same
timestamp, regardless of whether the tests are run.


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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/rules	2026-10-08 10:14:01.330491395 -0700
--- b/debian/rules	2026-10-08 10:29:11.906670562 -0700
@@ -35,3 +35,8 @@
 else
 	@echo 'The PHPUnit test suite requires a 64-bit system.' >&2
 endif
+
+execute_before_dh_auto_install:
+	# If we ran the tests, we adjusted the mtimes of this dir, so force it
+	# to a fixed time for reproducibility
+	touch -d@$(SOURCE_DATE_EPOCH) src/Carbon/Lang


More information about the pkg-php-pear mailing list