rm buildDate from build.xml and its usages

The https://reproducible-builds.org project invests a lot of work
to make builds reproducible. This is a security property. It allows
to compare the build of binaries from different builder machines.
If they are identical, it means that either the builds have not
been manipulated or an attacker managed to attack all builder
machines in exactly the same way.

One problem that the reproducible-builds project often sees is
that projects include the build time in their binaries. This
makes builds unreproducible for apparently no reason. The build
date should not be of interest since binaries built on different
dates but from the same source code should not be different.

Thus I decided to remove the build date instead of re-implementing
the functionality without the GitRev task. Anyways the reported
date was not the build date but the date of the last git commit
which is even less informative. The git commit ID would have
information value but should only be relevant for "nightly builds".
This commit is contained in:
Thomas Koch 2022-07-10 09:13:34 +00:00
parent 572558244a
commit 3116713672
8 changed files with 13 additions and 38 deletions

View File

@ -30,10 +30,10 @@ VIAddVersionKey "ProductName" "YaCy"
VIAddVersionKey "LegalCopyright" "YaCy"
VIAddVersionKey "FileVersion" "@REPL_VERSION@"
VIAddVersionKey "FileDescription" "YaCy"
VIAddVersionKey "OriginalFilename" "yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
VIAddVersionKey "OriginalFilename" "yacy_v@REPL_VERSION@_@REPL_REVISION_NR@.exe"
Name "YaCy @REPL_VERSION@"
OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_REVISION_NR@.exe"
;default installation folder
InstallDir "$PROFILE\YaCy"
@ -95,7 +95,7 @@ SetCompressor /SOLID LZMA
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
ComponentText "YaCy v@REPL_VERSION@ (Build @REPL_DATE@)"
ComponentText "YaCy v@REPL_VERSION@"
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckDriveSpace
!insertmacro MUI_PAGE_DIRECTORY

View File

@ -4,8 +4,7 @@ javacTarget=1.8
# Release Configuration
releaseVersion=1.925
stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
sourceReleaseFile=yacy_src_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
stdReleaseFile=yacy_v${releaseVersion}_${releaseNr}.tar.gz
releaseFileParentDir=yacy
privateKeyFile=private.key

View File

@ -30,11 +30,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<!-- defining the timestamp format -->
<tstamp>
<format property="REPL_DATE_FORMAT" pattern="yyyymmdd" />
</tstamp>
<!-- defining all needed directory names -->
<property name="yacyroot" location="."/>
<property name="addon" location="addon"/>
@ -143,10 +138,6 @@
<mkdir dir="${data}"/>
<mkdir dir="${release}"/>
<!-- YaCy Release Date -->
<filter token="REPL_DATE" value="${DSTAMP}"/>
<filter token="REPL_RELEASE" value="${stdReleaseFile}"/>
<!-- YaCy Release Version number -->
<echo message="YaCy Version number: ${releaseVersion}" />
<filter token="REPL_VERSION" value="${releaseVersion}" />
@ -155,14 +146,11 @@
<echo message="YaCy Release number: ${releaseNr}" />
<filter token="REPL_REVISION_NR" value="${releaseNr}"/>
<!-- YaCy root directory -->
<filter token="REPL_YACY_ROOT_DIR" value="${yacyroot}"/>
<!-- apply replacments -->
<copy file="${src}/net/yacy/peers/operation/yacyBuildProperties.java.template" tofile="${src}/net/yacy/peers/operation/yacyBuildProperties.java" overwrite="true" filtering="true" />
<!-- copy log4j config file -->
<copy file="${src}/log4j.properties" tofile="${build}/log4j.properties" overwrite="true" filtering="true" /> <!-- @TODO: obsolete, contains no replace/filter pattern -->
<copy file="${src}/log4j.properties" tofile="${build}/log4j.properties" overwrite="true" filtering="false" /> <!-- @TODO: obsolete, contains no replace/filter pattern -->
</target>
@ -591,8 +579,8 @@
<classpath location="${libbuild}/nsisant-1.2.jar"/>
</taskdef>
<nsis script="${release_windows}/build.nsi" nocd="yes" verbosity="2" />
<move file="${release_windows}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe"
tofile="${release}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe" />
<move file="${release_windows}/yacy_v${releaseVersion}_${releaseNr}.exe"
tofile="${release}/yacy_v${releaseVersion}_${releaseNr}.exe" />
<delete dir="${release_main}"/>
<delete dir="${release_windows}" failonerror="false" />
@ -602,13 +590,13 @@
<copy todir="${release_mac}/YaCy.app">
<fileset dir="${addon}/YaCy.app"></fileset>
</copy>
<copy file="${addon}/YaCy.app/Contents/Info.plist" tofile="${release_mac}/YaCy.app/Contents/Info.plist" filtering="true" overwrite="true" />
<copy file="${addon}/YaCy.app/Contents/Info.plist" tofile="${release_mac}/YaCy.app/Contents/Info.plist" filtering="false" overwrite="true" />
<move file="${release_main}" tofile="${release_mac}/YaCy.app/Contents/MacOS" verbose="false" />
<!-- startYACY.sh and startYACYMacOS.sh will be the main entry points : we set permissions to make it executable files -->
<chmod file="${release_mac}/YaCy.app/Contents/MacOS/startYACYMacOS.sh" perm="755"/>
<chmod file="${release_mac}/YaCy.app/Contents/MacOS/startYACY.sh" perm="755"/>
<exec executable="hdiutil">
<arg line="create -srcfolder ${release_mac}/YaCy.app ${release}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.dmg"/>
<arg line="create -srcfolder ${release_mac}/YaCy.app ${release}/yacy_v${releaseVersion}_${releaseNr}.dmg"/>
</exec>
<delete dir="${release_mac}" failonerror="false" verbose="false" />
</target>

View File

@ -13,7 +13,7 @@ public class version {
prop.put("versionstring", yacyBuildProperties.getLongVersion());
prop.put("svnRev", yacyBuildProperties.getSVNRevision());
prop.put("buildDate", yacyBuildProperties.getBuildDate());
// return rewrite properties
return prop;
}

View File

@ -2,5 +2,5 @@
<version>
<number>#[versionstring]#</number>
<svnRevision>#[svnRev]#</svnRevision>
<buildDate>#[buildDate]#</buildDate>
<buildDate>19700101</buildDate>
</version>

View File

@ -40,14 +40,4 @@ public final class yacyBuildProperties {
public static String getLongVersion() {
return String.format(Locale.US, "%.3f%05d", Float.valueOf(getVersion()), Integer.valueOf(getSVNRevision()));
}
/**
* returns the date, when this release was build
*/
public static String getBuildDate() {
if ("@REPL_DATE@".contains("@")) {
return "19700101";
}
return "@REPL_DATE@";
}
}

View File

@ -82,7 +82,6 @@ public class yacyVersion implements Comparator<yacyVersion>, Comparable<yacyVers
thisVersion = new yacyVersion(
"yacy" +
"_v" + yacyBuildProperties.getVersion() + "_" +
yacyBuildProperties.getBuildDate() + "_" +
yacyBuildProperties.getSVNRevision() + ".tar.gz", null);
}
return thisVersion;

View File

@ -125,8 +125,7 @@ public final class yacy {
// static objects
public static final String vString = yacyBuildProperties.getVersion();
public static final String vDATE = yacyBuildProperties.getBuildDate();
public static final String copyright = "[ YaCy v" + vString + ", build " + vDATE + " by Michael Christen / www.yacy.net ]";
public static final String copyright = "[ YaCy v" + vString + " by Michael Christen / www.yacy.net ]";
public static final String hline = "-------------------------------------------------------------------------------";
public static final Semaphore shutdownSemaphore = new Semaphore(0);
@ -874,4 +873,4 @@ class shutdownHookThread extends Thread {
ConcurrentLog.severe("SHUTDOWN","Unexpected error. " + e.getClass().getName(),e);
}
}
}
}