From owner-svn-src-all@freebsd.org Thu Jan 7 17:00:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F47A668D7; Thu, 7 Jan 2016 17:00:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E07A10B8; Thu, 7 Jan 2016 17:00:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07H0ZeL067229; Thu, 7 Jan 2016 17:00:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07H0Zu8067228; Thu, 7 Jan 2016 17:00:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601071700.u07H0Zu8067228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 17:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293333 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:00:36 -0000 Author: emaste Date: Thu Jan 7 17:00:35 2016 New Revision: 293333 URL: https://svnweb.freebsd.org/changeset/base/293333 Log: MFC r291691: newvers: Honour SOURCE_DATE_EPOCH for build reproducibility One reason the kernel does not build reproducibly is that it includes a timestamp in the version string. SOURCE_DATE_EPOCH provides a standard method to address this: it should be set to the last modification time of the source, and build processes use the specified timestamp instead of the "current" date and time. This change uses SOURCE_DATE_EPOCH if it is set; how it gets set needs to be addressed elsewhere. Modified: stable/10/sys/conf/newvers.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Jan 7 16:48:47 2016 (r293332) +++ stable/10/sys/conf/newvers.sh Thu Jan 7 17:00:35 2016 (r293333) @@ -87,7 +87,15 @@ then fi touch version -v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` +v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} +if [ -n "$SOURCE_DATE_EPOCH" ]; then + if ! t=`date -r $SOURCE_DATE_EPOCH 2>/dev/null`; then + echo "Invalid SOURCE_DATE_EPOCH" >&2 + exit 1 + fi +else + t=`date` +fi i=`${MAKE:-make} -V KERN_IDENT` compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version')