1
1

configury: make build Reproducible

If defined, use SOURCE_DATE_EPOCH environment variable; make the build
Reproducible by forcing timestamps.  See
https://reproducible-builds.org/docs/source-date-epoch/ for more
information.

Thanks Bernhard M. Wiedemann for bringing this to our attention.

Fixes open-mpi/ompi#3759

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Gilles Gouaillardet 2017-06-28 13:36:27 +09:00 коммит произвёл Bernhard M. Wiedemann
родитель 7c36b45847
Коммит 7b4e8ba4aa
8 изменённых файлов: 27 добавлений и 13 удалений

16
README
Просмотреть файл

@ -197,12 +197,16 @@ General notes
- Open MPI has taken some steps towards Reproducible Builds
(https://reproducible-builds.org/). Specifically, Open MPI's
"configure" and "make" process, by default, records some
system-specific information such as the hostname where Open MPI was
built and the username who built it. If you desire a Reproducible
Build, set the $USER and $HOSTNAME environment variables before
invoking "configure" and "make", and Open MPI will use those values
instead of invoking "whoami" and/or "hostname", respectively.
"configure" and "make" process, by default, records the build date
and some system-specific information such as the hostname where Open
MPI was built and the username who built it. If you desire a
Reproducible Build, set the $SOURCE_DATE_EPOCH, $USER and $HOSTNAME
environment variables before invoking "configure" and "make", and
Open MPI will use those values instead of invoking "whoami" and/or
"hostname", respectively. See
https://reproducible-builds.org/docs/source-date-epoch/ for
information on the expected format and content of the
$SOURCE_DATE_EPOCH variable.
Platform Notes
--------------

Просмотреть файл

@ -1209,7 +1209,7 @@ $dnl_line
dnl This file is automatically created by autogen.pl; it should not
dnl be edited by hand!!
dnl
dnl Generated by $username at " . localtime(time) . "
dnl Generated by $username at " . localtime($ENV{SOURCE_DATE_EPOCH} || time) . "
dnl on $full_hostname.
$dnl_line\n\n";

10
config/getdate.sh Исполняемый файл
Просмотреть файл

@ -0,0 +1,10 @@
#!/bin/sh
#
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
# Provide a way to override build date for reproducible build results
# See https://reproducible-builds.org/ for why this is good.
date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "$@"

Просмотреть файл

@ -96,7 +96,7 @@ EOF
OPAL_CONFIGURE_USER="${USER:-`whoami`}"
OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}"
OPAL_CONFIGURE_DATE="`date`"
OPAL_CONFIGURE_DATE="`$srcdir/config/getdate.sh`"
OPAL_LIBNL_SANITY_INIT

Просмотреть файл

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2014 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
@ -91,7 +91,7 @@ m4_define([OPAL_GET_VERSION],[
$2_REPO_REV=`git describe --tags --always`
fi
else
$2_REPO_REV="date`date '+%Y-%m-%d'`"
$2_REPO_REV=date`$srcdir/getdate.sh '+%Y-%m-%d'`
fi
fi

Просмотреть файл

@ -34,7 +34,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"`(hostname || uname -n) | sed 1q`\"" \
-DOMPI_BUILD_DATE="\"`date`\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \

Просмотреть файл

@ -30,7 +30,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`date`\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \

Просмотреть файл

@ -19,7 +19,7 @@ AM_CPPFLAGS = \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`date`\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \