Enable reproducible packaging of template archives
ClosedPublic

Authored by aaronpuchert on Mon, Sep 4, 10:18 PM.

Details

Summary

Builds of KDevelop are not reproducible right now because the archives
containing templates contain metadata related to the build environment,
such as the time of checkout. The order of files in an archive is also
not guaranteed.

The Reproducible Builds project recommends [1] to use (in addition to
what we have) --mtime="@${SOURCE_DATE_EPOCH}" and --sort=name. This will
only be used if the environment variable is set. The latter option is
available only since tar 1.28 (from 2014), but we assume that people
have it if they know about reproducible builds.

[1] https://reproducible-builds.org/docs/archives/

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aaronpuchert created this revision.Mon, Sep 4, 10:18 PM
kfunk requested changes to this revision.Mon, Sep 4, 10:41 PM
kfunk added a subscriber: kfunk.
kfunk added inline comments.
kdevplatform/cmake/modules/KDevPlatformMacros.cmake
65

Can you refactor this so you don't need another add_custom_command call?

i.e. put this in the else() branch:

set(extraArgs "")
if (DEFINED ENV{...})
   set(extraArgs "--mtime=...")
endif()
add_custom_command(...
  ... ${extraArgs} ...

)

This revision now requires changes to proceed.Mon, Sep 4, 10:41 PM
This revision was automatically updated to reflect the committed changes.

I see you already submitted the change, but you omitted --sort=name.

Was that oversight, or is there a reason for that?

kdevplatform/cmake/modules/KDevPlatformMacros.cmake
65

Yes, that's probably a good idea.

kfunk added a comment.Tue, Sep 5, 7:27 PM

I see you already submitted the change, but you omitted --sort=name.

Was that oversight, or is there a reason for that?

Sorry, oversight. Fixed now with https://commits.kde.org/kdevelop/75e9fe4bbd9696350be970bba189b2acba51518f