Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jezz@sysmic.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 01/18] reproducibility: generate SOURCE_DATE_EPOCH
Date: Wed, 23 Nov 2016 12:08:01 +0100	[thread overview]
Message-ID: <1479899298-14655-2-git-send-email-jezz@sysmic.org> (raw)
In-Reply-To: <1479899298-14655-1-git-send-email-jezz@sysmic.org>

From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>

When reproducibility is requested, generate a global SOURCE_DATE_EPOCH
environment variable which contains either the date of Buildroot last
commit if running from a git repository, or the latest release date.

This means that all packages embedding build dates will appear to
have the same build date, so in case of new commit or release, all
packages will appear to have been changed, even though some of them
may not have changed in fact.

The meaning of SOURCE_DATE_EPOCH is specified by the following
specification:
  https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index eff814b..fcb80ec 100644
--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,8 @@ all:
 
 # Set and export the version string
 export BR2_VERSION := 2016.11-rc1
+# Actual time the release is cut (for reproducible builds)
+BR2_VERSION_EPOCH = 1478206447
 
 # Save running make version since it's clobbered by the make package
 RUNNING_MAKE_VERSION := $(MAKE_VERSION)
@@ -249,6 +251,8 @@ ifeq ($(BR2_REPRODUCIBLE),y)
 export TZ=UTC
 export LANG=C
 export LC_ALL=C
+SOURCE_DATE_GIT = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at)
+export SOURCE_DATE_EPOCH = $(if $(wildcard $(TOPDIR)/.git),$(SOURCE_DATE_GIT),$(BR2_VERSION_EPOCH))
 endif
 
 # To put more focus on warnings, be less verbose as default
-- 
1.9.1

  reply	other threads:[~2016-11-23 11:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 11:08 [Buildroot] [PATCH v3 00/18] Reproducible builds Jérôme Pouiller
2016-11-23 11:08 ` Jérôme Pouiller [this message]
2016-11-23 11:15   ` [Buildroot] [PATCH v3 01/18] reproducibility: generate SOURCE_DATE_EPOCH Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 02/18] reproducible: fix DATE/TIME macros in toolchain-wrapper Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 03/18] reproducible: add '-n' to gzip invocations Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 04/18] fs/tar: make results reproducible Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 05/18] reproducibility/linux: override build timestamp Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 06/18] reproducibility/linux: inhibit build-id Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 07/18] reproducibility/busybox: disable build timestamps Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 08/18] reproducible: lock modification times in $TARGET_DIR Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 09/18] fakedate: new package Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 10/18] core: do not reset DEPENDENCIES_HOST_PREREQ in dependencies.mk Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 11/18] reproducible: enable fakedate Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 12/18] pycompile: allow to force compilation Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 13/18] python2: generate reproducible .pyc Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 14/18] python3: " Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 15/18] python2: remove full path from .pyc Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 16/18] python3: " Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 17/18] reproducible: improve help text Jérôme Pouiller
2016-11-23 11:08 ` [Buildroot] [PATCH v3 18/18] reproducible: fix coding style Jérôme Pouiller
2016-11-23 12:24 ` [Buildroot] [PATCH v3 00/18] Reproducible builds Thomas Petazzoni
2016-11-23 12:54   ` Jérôme Pouiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479899298-14655-2-git-send-email-jezz@sysmic.org \
    --to=jezz@sysmic.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox