From 3116713672bbcf6aec50439537e451646bc9a11a Mon Sep 17 00:00:00 2001 From: Thomas Koch Date: Sun, 10 Jul 2022 09:13:34 +0000 Subject: [PATCH] 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". --- build.nsi | 6 ++--- build.properties | 3 +-- build.xml | 22 +++++-------------- htroot/api/version.java | 2 +- htroot/api/version.xml | 2 +- .../yacyBuildProperties.java.template | 10 --------- .../net/yacy/peers/operation/yacyVersion.java | 1 - source/net/yacy/yacy.java | 5 ++--- 8 files changed, 13 insertions(+), 38 deletions(-) diff --git a/build.nsi b/build.nsi index 6587e3810..cdd7218de 100644 --- a/build.nsi +++ b/build.nsi @@ -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 diff --git a/build.properties b/build.properties index dd0e58a10..c2438f437 100644 --- a/build.properties +++ b/build.properties @@ -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 diff --git a/build.xml b/build.xml index 1e21bad53..4ce3d5377 100644 --- a/build.xml +++ b/build.xml @@ -30,11 +30,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - - - - @@ -143,10 +138,6 @@ - - - - @@ -155,14 +146,11 @@ - - - - + @@ -591,8 +579,8 @@ - + @@ -602,13 +590,13 @@ - + - + diff --git a/htroot/api/version.java b/htroot/api/version.java index 333a246b1..c19eff656 100644 --- a/htroot/api/version.java +++ b/htroot/api/version.java @@ -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; } diff --git a/htroot/api/version.xml b/htroot/api/version.xml index d75a5be48..b0585f62c 100644 --- a/htroot/api/version.xml +++ b/htroot/api/version.xml @@ -2,5 +2,5 @@ #[versionstring]# #[svnRev]# - #[buildDate]# + 19700101 diff --git a/source/net/yacy/peers/operation/yacyBuildProperties.java.template b/source/net/yacy/peers/operation/yacyBuildProperties.java.template index 4f6dfd95f..0304159d9 100644 --- a/source/net/yacy/peers/operation/yacyBuildProperties.java.template +++ b/source/net/yacy/peers/operation/yacyBuildProperties.java.template @@ -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@"; - } } diff --git a/source/net/yacy/peers/operation/yacyVersion.java b/source/net/yacy/peers/operation/yacyVersion.java index d5e1924fc..97d40ae43 100644 --- a/source/net/yacy/peers/operation/yacyVersion.java +++ b/source/net/yacy/peers/operation/yacyVersion.java @@ -82,7 +82,6 @@ public class yacyVersion implements Comparator, Comparable