From patchwork Wed Nov 23 12:58:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 698217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tP2VP5KXGz9s3v for ; Wed, 23 Nov 2016 23:59:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 61CA98926E; Wed, 23 Nov 2016 12:59:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YhoZ29YuWa8g; Wed, 23 Nov 2016 12:59:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AA53989278; Wed, 23 Nov 2016 12:59:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A859F1BFC3F for ; Wed, 23 Nov 2016 12:59:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8ECFB883AB for ; Wed, 23 Nov 2016 12:59:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ogiYa-iCkn04 for ; Wed, 23 Nov 2016 12:59:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id 88CD4872FC for ; Wed, 23 Nov 2016 12:59:10 +0000 (UTC) Received: from lupi.online.net (sysmic.org [62.210.89.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 40A3B426D4; Wed, 23 Nov 2016 13:59:09 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Wed, 23 Nov 2016 13:58:40 +0100 Message-Id: <1479905937-17241-2-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479905937-17241-1-git-send-email-jezz@sysmic.org> References: <1479905937-17241-1-git-send-email-jezz@sysmic.org> MIME-Version: 1.0 Cc: Thomas Petazzoni , Gilles Chanteperdrix , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v4 01/18] reproducibility: generate SOURCE_DATE_EPOCH X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Gilles Chanteperdrix 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 Signed-off-by: Jérôme Pouiller --- Notes: v4: - s/SOURCE_DATE_GIT/BR2_VERSION_GIT_EPOCH/ v3: - Fix typo in commit message (Arnout) - Introduce BR2_VERSION_EPOCH (Thomas and Arnout) - Set and export SOURCE_DATE_EPOCH together (Thomas) Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index eff814b..8acbe58 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 +BR2_VERSION_GIT_EPOCH = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at) +export SOURCE_DATE_EPOCH = $(if $(wildcard $(TOPDIR)/.git),$(BR2_VERSION_GIT_EPOCH),$(BR2_VERSION_EPOCH)) endif # To put more focus on warnings, be less verbose as default