Anonymous Login
2017-09-20 11:09 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001928OpenClonkEnginepublic2017-08-14 15:08
Reporterpkern 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version7.0 
Target Version8.0Fixed in Version8.0 
Summary0001928: Apply patch for reproducible builds
DescriptionIn https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823797 I received a patch from Alexis Bienvenüe <pado@passoire.fr> (as attached) to fix the build system to produce a reproducible (bit identical) build on Debian. This requires looking at SOURCE_DATE_EPOCH if set in the environment instead of date to get the current year at build (which is displayed in a copyright notice). I'd be nice if this could be included in the next release of OpenClonk.
TagsNo tags attached.
Attached Files
  • diff file icon openclonk_7.0-3_reproductible.diff (2,176 bytes) 2017-06-30 10:19 -
    diff -Nru openclonk-7.0/debian/changelog openclonk-7.0/debian/changelog
    --- openclonk-7.0/debian/changelog	2016-02-14 12:26:56.000000000 +0100
    +++ openclonk-7.0/debian/changelog	2016-05-04 11:15:38.000000000 +0200
    @@ -1,3 +1,9 @@
    +openclonk (7.0-3.0~reproducible1) UNRELEASED; urgency=medium
    +
    +  * Honour SOURCE_DATE_EPOCH for the copyright year.
    +
    + -- Alexis Bienvenüe <pado@passoire.fr>  Wed, 04 May 2016 11:15:38 +0200
    +
     openclonk (7.0-3) unstable; urgency=medium
     
       * Ship Music.ocg's content unpacked.
    diff -Nru openclonk-7.0/debian/patches/honour_SOURCE_DATE_EPOCH.patch openclonk-7.0/debian/patches/honour_SOURCE_DATE_EPOCH.patch
    --- openclonk-7.0/debian/patches/honour_SOURCE_DATE_EPOCH.patch	1970-01-01 01:00:00.000000000 +0100
    +++ openclonk-7.0/debian/patches/honour_SOURCE_DATE_EPOCH.patch	2016-05-04 11:14:54.000000000 +0200
    @@ -0,0 +1,24 @@
    +Description: Honour SOURCE_DATE_EPOCH
    + Honour the SOURCE_DATE_EPOCH environment variable to get the copyright year,
    + to make the build reproducible.
    + See https://reproducible-builds.org/specs/source-date-epoch/
    +Author: Alexis Bienvenüe <pado@passoire.fr>
    +
    +--- openclonk-7.0.orig/cmake/Version.cmake
    ++++ openclonk-7.0/cmake/Version.cmake
    +@@ -24,7 +24,14 @@ git_get_changeset_id(C4REVISION)
    + ############################################################################
    + 
    + IF(CMAKE_HOST_UNIX)
    +-	EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
    ++if (DEFINED ENV{SOURCE_DATE_EPOCH})
    ++  EXECUTE_PROCESS(
    ++    COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y"
    ++    OUTPUT_VARIABLE DATE
    ++    OUTPUT_STRIP_TRAILING_WHITESPACE)
    ++else ()
    ++  EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
    ++endif ()
    + ELSEIF(CMAKE_HOST_WIN32)
    + 	EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
    + ENDIF()
    diff -Nru openclonk-7.0/debian/patches/series openclonk-7.0/debian/patches/series
    --- openclonk-7.0/debian/patches/series	2016-02-14 12:26:08.000000000 +0100
    +++ openclonk-7.0/debian/patches/series	2016-05-04 11:13:40.000000000 +0200
    @@ -1 +1,2 @@
     do-not-pack-music-ocg.patch
    +honour_SOURCE_DATE_EPOCH.patch
    
    diff file icon openclonk_7.0-3_reproductible.diff (2,176 bytes) 2017-06-30 10:19 +

-Relationships
+Relationships

-Notes

~0005722

Caesar (developer)

We're now using STRING(TIMESTAMP C4COPYRIGHT_YEAR "%Y") (see https://git.openclonk.org/openclonk.git/commitdiff/8fef67378d193e7d116c61b4b359a8788388d6fa ) and I was wondering if this patch is still necessary.

~0005723

Luchs (developer)

cmake >= 3.8 seems to honor SOURCE_DATE_EPOCH [1], so it's probably fine as-is.

[1]: https://cmake.org/cmake/help/latest/command/string.html#timestamp
+Notes

-Issue History
Date Modified Username Field Change
2017-06-30 10:19 pkern New Issue
2017-06-30 10:19 pkern File Added: openclonk_7.0-3_reproductible.diff
2017-08-05 15:58 Maikel Target Version => 8.0
2017-08-13 11:44 Caesar Note Added: 0005721
2017-08-13 11:45 Caesar Note Deleted: 0005721
2017-08-13 11:45 Caesar Assigned To => Caesar
2017-08-13 11:45 Caesar Status new => feedback
2017-08-13 11:45 Caesar Note Added: 0005722
2017-08-13 12:38 Luchs Note Added: 0005723
2017-08-14 15:08 Caesar Assigned To Caesar =>
2017-08-14 15:08 Caesar Status feedback => resolved
2017-08-14 15:08 Caesar Resolution open => fixed
2017-08-14 15:08 Caesar Fixed in Version => 8.0
+Issue History