Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autogen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2016 Research Organization for Information Science
# Copyright (c) 2015-2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2015 IBM Corporation. All rights reserved.
#
Expand Down Expand Up @@ -1178,7 +1178,7 @@ sub in_tarball {
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) . "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this does what you expect. My reading of https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Bash_.2F_POSIX_shell is that it expects SOURCE_DATE_EPOCH to be of the form 'YYYY-MM-DD'. If you pass a string of the form 'YYYY-MM-DD' to localtime(), you get... weirdness:

$ perl -e 'print localtime("2010-10-10") . "\n"';
Wed Dec 31 16:33:30 1969
$ perl -e 'print localtime("2018-10-10") . "\n"';
Wed Dec 31 16:33:38 1969

Did you mean:

... . ($ENV{SOURCE_DATE_EPOCH} || localtime(time)) . ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it is a plain int. In the linked example, you can see ${SOURCE_DATE_EPOCH:-$(date +%s)}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. So this comment on the review is probably moot. But my other comments are still relevant.

dnl on $full_hostname.
$dnl_line\n\n";

Expand Down
6 changes: 6 additions & 0 deletions config/getdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.

date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to put a comment here in this file explaining why it exists. Otherwise, Future People will wonder why there's a 1-line script to run the date command.

It might actually be good to put a 1-line comment in most/all places we do $SOURCE_DATE_EPOCH, referring to reproducible builds, just so that no on accidentally removes the $SOURCE_DATE_EPOCH because they don't understand what it's for.

4 changes: 2 additions & 2 deletions config/opal_functions.m4
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ EOF

OPAL_CONFIGURE_USER="`whoami`"
OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`"
OPAL_CONFIGURE_DATE="`date`"
OPAL_CONFIGURE_DATE="`date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"`"

OPAL_LIBNL_SANITY_INIT

Expand All @@ -118,7 +118,7 @@ AC_DEFUN([OPAL_BASIC_SETUP],[

OPAL_CONFIGURE_USER="`whoami`"
OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`"
OPAL_CONFIGURE_DATE="`date`"
OPAL_CONFIGURE_DATE="`date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"`"

#
# Make automake clean emacs ~ files for "make clean"
Expand Down
4 changes: 2 additions & 2 deletions config/opal_get_version.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2014 Research Organization for Information Science
dnl Copyright (c) 2014-2017 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
Expand Down Expand Up @@ -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`date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" '+%Y-%m-%d'`"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion ompi/tools/mpisync/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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@\"" \
Expand Down
2 changes: 1 addition & 1 deletion ompi/tools/ompi_info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"`(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@\"" \
Expand Down
2 changes: 1 addition & 1 deletion orte/tools/orte-info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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@\"" \
Expand Down
3 changes: 2 additions & 1 deletion oshmem/tools/oshmem_info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AM_CPPFLAGS = \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"`(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@\"" \
Expand All @@ -29,6 +29,7 @@ AM_CPPFLAGS = \
-DOMPI_BUILD_LIBS="\"@LIBS@\"" \
-DOPAL_CC_ABSOLUTE="\"@OPAL_CC_ABSOLUTE@\"" \
-DOMPI_CXX_ABSOLUTE="\"@OMPI_CXX_ABSOLUTE@\""

if OSHMEM_PROFILING
AM_CPPFLAGS += -DOSHMEM_PROFILING=1
else
Expand Down