This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 765e6d46fa Ensure zip files use UTC times. By default zip uses local time. 765e6d46fa is described below commit 765e6d46faabfed04b3eb7123c9dadd41e9cb6ac Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Aug 11 15:57:29 2022 +0100 Ensure zip files use UTC times. By default zip uses local time. --- build.xml | 45 ++++++++++++---------- .../apache/tomcat/buildutil/ForceUtcTimeZone.java | 30 +++++++++++++++ webapps/docs/changelog.xml | 8 ++++ 3 files changed, 63 insertions(+), 20 deletions(-) diff --git a/build.xml b/build.xml index 586924af45..0cc7099b0c 100644 --- a/build.xml +++ b/build.xml @@ -252,7 +252,7 @@ <format property="today" pattern="MMM d yyyy" locale="en" timezone="UTC"/> <format property="today-iso-8601" pattern="yyyy-MM-dd" locale="en" timezone="UTC"/> <format property="tstamp" pattern="HH:mm:ss" locale="en" timezone="UTC"/> - <format property="tstamp.file" pattern="yyyy-MM-dd HH:mm:ss"/> + <format property="tstamp.file" pattern="yyyy-MM-dd HH:mm:ss" timezone="UTC"/> <format property="tstamp.iso.release" pattern="yyyy-MM-dd'T'HH:mm:ssX" timezone="UTC"/> </tstamp> <filterset id="version.filters"> @@ -1195,7 +1195,7 @@ <!-- i18n JARs --> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_cs.properties" /> </fileset> @@ -1206,7 +1206,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-de.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_de.properties" /> </fileset> @@ -1217,7 +1217,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-es.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_es.properties" /> </fileset> @@ -1228,7 +1228,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-fr.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_fr.properties" /> </fileset> @@ -1239,7 +1239,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-ja.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_ja.properties" /> </fileset> @@ -1250,7 +1250,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-ko.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_ko.properties" /> </fileset> @@ -1261,7 +1261,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-pt-BR.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_pt_BR.properties" /> </fileset> @@ -1272,7 +1272,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-ru.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_ru.properties" /> </fileset> @@ -1283,7 +1283,7 @@ </jar> <jar jarfile="${tomcat.build}/lib/tomcat-i18n-zh-CN.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.i18n}"> <include name="**/LocalStrings_zh_CN.properties" /> </fileset> @@ -1806,7 +1806,7 @@ </fixcrlf> <zip destfile="${tomcat.embed}/${final.name}-embed.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <fileset dir="${tomcat.embed}"> <include name="**" /> @@ -2386,7 +2386,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform. <!-- Digester and dependencies --> <jar jarfile="${tomcat.deployer}/lib/catalina-deployer.jar" manifest="${tomcat.manifests}/default.manifest" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="${tomcat.classes}"> <include name="org/apache/catalina/startup/DigesterFactory.class" /> <include name="org/apache/catalina/util/SchemaResolver.class" /> @@ -2760,7 +2760,12 @@ asf.ldap.username=${release.asfusername} </target> <!-- Sets properties only required for releases --> - <target name="release-init" depends="gpg-init-1,gpg-init-2" /> + <target name="release-init" depends="gpg-init-1,gpg-init-2,compile" > + <taskdef name="forceUtcTimeZone" + classname="org.apache.tomcat.buildutil.ForceUtcTimeZone" + classpath="${tomcat.classes}" /> + <forceUtcTimeZone /> + </target> <target name="gpg-init-1"> <available file="${gpg.exec}" property="gpg.exec.available"/> @@ -2780,7 +2785,7 @@ asf.ldap.username=${release.asfusername} </fixcrlf> <zip zipfile="${tomcat.release}/v${version}/bin/${final.name}.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset file="${tomcat.dist}" fullpath="${final.name}"/> <zipfileset dir="${tomcat.dist}" prefix="${final.name}"> @@ -2817,7 +2822,7 @@ asf.ldap.username=${release.asfusername} <!-- Windows x86 package --> <zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-windows-x86.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset file="${tomcat.dist}" fullpath="${final.name}"/> <zipfileset dir="${tomcat.dist}" prefix="${final.name}"> @@ -2845,7 +2850,7 @@ asf.ldap.username=${release.asfusername} <!-- Windows x64 package --> <zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-windows-x64.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset file="${tomcat.dist}" fullpath="${final.name}"/> <zipfileset dir="${tomcat.dist}" prefix="${final.name}"> @@ -2889,7 +2894,7 @@ asf.ldap.username=${release.asfusername} </fixcrlf> <zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-deployer.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset file="${tomcat.deployer}" fullpath="${final.name}-deployer"/> <zipfileset dir="${tomcat.deployer}" prefix="${final.name}-deployer" includes="**" /> @@ -3041,7 +3046,7 @@ asf.ldap.username=${release.asfusername} </fixcrlf> <zip zipfile="${tomcat.release}/v${version}/src/${final-src.name}.zip" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset file="${tomcat.dist}/src" fullpath="${final-src.name}" /> <zipfileset dir="${tomcat.dist}/src" prefix="${final-src.name}" /> @@ -3917,7 +3922,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho <sequential unless:true="${jar.uptodate}"> <jar jarfile="@{jarfile}" manifest="@{manifest}" - modificationtime="${tstamp.file}"> + modificationtime="${tstamp.iso.release}"> <fileset dir="@{filesDir}"> <patternset refid="@{filesId}"/> <!-- Javadoc exclusions --> @@ -3973,7 +3978,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho <fixcrlf srcdir="${tomcat.graal}/${graalPrefix}" eol="lf" encoding="ISO-8859-1" fixlast="false" /> <zip destfile="${jarfile}" update="true" filesonly="true" - modificationtime="${tstamp.file}" + modificationtime="${tstamp.iso.release}" encoding="UTF8"> <zipfileset dir="${tomcat.graal}/${graalPrefix}" prefix="META-INF/native-image/${graalPrefix}" includes="*.*"/> </zip> diff --git a/java/org/apache/tomcat/buildutil/ForceUtcTimeZone.java b/java/org/apache/tomcat/buildutil/ForceUtcTimeZone.java new file mode 100644 index 0000000000..d4e4529798 --- /dev/null +++ b/java/org/apache/tomcat/buildutil/ForceUtcTimeZone.java @@ -0,0 +1,30 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.apache.tomcat.buildutil; + +import java.util.TimeZone; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; + +public class ForceUtcTimeZone extends Task { + + @Override + public void execute() throws BuildException { + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + } +} diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index caea8f83bb..84e11ec9b2 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -159,6 +159,14 @@ </fix> </changelog> </subsection> + <subsection name="Other"> + <changelog> + <fix> + Ensure that zip archives use UTC for file modification times to ensure + repeatable builds across time zones. (markt) + </fix> + </changelog> + </subsection> </section> <section name="Tomcat 10.1.0-M17 (markt)" rtext="2022-07-20"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org