File: fix_reproductibility.patch

package info (click to toggle)
freefem%2B%2B 4.15%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,536 kB
  • sloc: cpp: 244,534; ansic: 32,568; makefile: 4,177; sh: 2,822; fortran: 1,115; perl: 865; pascal: 452; awk: 295; f90: 32; exp: 16
file content (146 lines) | stat: -rw-r--r-- 6,796 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Author: Francois Mazen <francois@mzf.fr>
Description: Fix reproducibility issues.
Forwarded: https://github.com/FreeFem/FreeFem-sources/pull/187


--- a/examples/3dCurve/Makefile.am
+++ b/examples/3dCurve/Makefile.am
@@ -56,7 +56,7 @@
 
 all.edp: Makefile
 	(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;searchMethod=0;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/examples/3dSurf/Makefile.am
+++ b/examples/3dSurf/Makefile.am
@@ -65,7 +65,7 @@
 
 all.edp: Makefile
 	(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;searchMethod=0;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/examples/eigen/Makefile.am
+++ b/examples/eigen/Makefile.am
@@ -58,7 +58,7 @@
 
 all.edp:
 	(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
@@ -67,4 +67,4 @@
 
 freefem++.pref:Makefile
 	echo includepath = \"../../idp/\" > freefem++.pref
-	echo loadpath = \"../../plugin/seq/\" >> freefem++.pref
\ No newline at end of file
+	echo loadpath = \"../../plugin/seq/\" >> freefem++.pref
--- a/examples/examples/Makefile.am
+++ b/examples/examples/Makefile.am
@@ -69,7 +69,7 @@
 
 all.edp:
 	(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/examples/3d/Makefile.am
+++ b/examples/3d/Makefile.am
@@ -134,7 +134,7 @@
 
 all.edp: Makefile
 	(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;searchMethod=0;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/examples/misc/Makefile.am
+++ b/examples/misc/Makefile.am
@@ -47,7 +47,7 @@
 
 all.edp:
 	(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/examples/plugin/Makefile.am
+++ b/examples/plugin/Makefile.am
@@ -288,7 +288,7 @@
 	mkdir o
 	@test -f ../../src/bin-win32/FreeFem++.exe && ffpp=../../src/bin-win32/FreeFem++.exe || ffpp=../../src/nw/FreeFem++; \
 	(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do  \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do  \
 	    if $$ffpp -ns -jc -v 0 $$i  1>/dev/null 2>/dev/null ; then \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;" ; \
--- a/examples/tutorial/Makefile.am
+++ b/examples/tutorial/Makefile.am
@@ -39,7 +39,7 @@
 
 all.edp:
 	(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
-	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
+	for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
 		echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
 		echo "verbosity=verbosityy;" ; \
 		echo \{ include \"$$i\"\;\}\; ;\
--- a/configure.ac
+++ b/configure.ac
@@ -185,7 +185,9 @@
     TOOL_PARAMETERS($1,$2,$3)
 ])
 
-echo "#  Build with FreeFEM with ./configure " `date`  >$ff_where_lib_conf
+BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
+
+echo "#  Build with FreeFEM with ./configure $BUILD_DATE" >$ff_where_lib_conf
 # To allow anonymous CVS version to contain a "./configure" and
 # Makefiles
 
@@ -681,7 +683,7 @@
 AC_MSG_CHECKING(prefix dir freefem++  )
 AC_MSG_RESULT($ff_prefix_dir)
 
-FF_DATE=`date`
+FF_DATE="$BUILD_DATE"
 AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFEM build date)
 AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix  dir)
 AC_SUBST(ff_prefix_dir,$ff_prefix_dir)
--- a/src/medit/Makefile.am
+++ b/src/medit/Makefile.am
@@ -16,8 +16,9 @@
 LDADD=picking.$(OBJEXT) ../libMesh/libMesh.a $(LIBSGLUT) -lm
 AM_CPPFLAGS=-I$(srcdir)/../libMesh
 BUILT_SOURCES=compil.date
+BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
 compil.date: $(ffmedit_SOURCES)
-	echo "#define COMPIL " '"' `date` '(with ff++ $(VERSION))''"' > compil.date
+	echo "#define COMPIL " '"' $(BUILD_DATE) '(with ff++ $(VERSION))''"' > compil.date
 #.PHONY: compil.date
 
 # ALH - during a parallel make, we should make sure that picking.o is not used before being made by a different
--- a/src/fflib/Makefile.am
+++ b/src/fflib/Makefile.am
@@ -106,6 +106,7 @@
 # Build date changes at every change
 EXTRA_DIST=strversionnumber.m4
 BUILT_SOURCES=strversionnumber.cpp
+BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
 strversionnumber.cpp: $(libff_a_SOURCES2) ../../Makefile 
-	m4 -DVersionFreeFemDate="`date`" -DGitVersion="`git describe --tags 2>/dev/null|| echo 'no git'`" strversionnumber.m4 > $@
+	m4 -DVersionFreeFemDate="$(BUILD_DATE)" -DGitVersion="`git describe --tags 2>/dev/null|| echo 'no git'`" strversionnumber.m4 > $@
 FORCE: