You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/02/14 21:31:47 UTC

[logging-log4j2] branch master updated (432f7d4cfc -> a4143d1b31)

This is an automated email from the ASF dual-hosted git repository.

vy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


    from 432f7d4cfc Remove `revapi` leftovers
     add 4f06f14fcd Fix Javadoc generation and links for the site
     new a4143d1b31 Check build reproducibility in CI

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/build.yml                        |  68 +++++--
 log4j-1.2-api/pom.xml                              |  67 -------
 log4j-api-test/pom.xml                             |  71 -------
 log4j-api/pom.xml                                  |  73 +------
 log4j-appserver/pom.xml                            |  71 -------
 log4j-cassandra/pom.xml                            |  67 -------
 log4j-core-test/pom.xml                            |  73 -------
 log4j-core/pom.xml                                 |  96 +--------
 log4j-couchdb/pom.xml                              |  67 -------
 log4j-csv/pom.xml                                  |  66 ------
 log4j-distribution/pom.xml                         | 192 ------------------
 log4j-docker/pom.xml                               |  71 -------
 log4j-flume-ng/pom.xml                             |  67 -------
 log4j-iostreams/pom.xml                            |  67 -------
 log4j-jakarta-web/pom.xml                          |  69 -------
 log4j-jcl/pom.xml                                  |  67 -------
 log4j-jdbc-dbcp2/pom.xml                           |  66 ------
 log4j-jdbc/pom.xml                                 |  66 ------
 log4j-jeromq/pom.xml                               |  66 ------
 log4j-jms/pom.xml                                  |  66 ------
 log4j-jmx-gui/pom.xml                              |  67 -------
 log4j-jndi-test/pom.xml                            |  67 -------
 log4j-jndi/pom.xml                                 |  67 -------
 log4j-jpa/pom.xml                                  |  66 ------
 log4j-jpl/pom.xml                                  |  73 -------
 log4j-jul/pom.xml                                  |  67 -------
 log4j-kafka/pom.xml                                |  66 ------
 log4j-kubernetes/pom.xml                           |  71 -------
 log4j-layout-jackson-json/pom.xml                  |  66 ------
 log4j-layout-jackson-xml/pom.xml                   |  66 ------
 log4j-layout-jackson-yaml/pom.xml                  |  66 ------
 log4j-layout-jackson/pom.xml                       |  66 ------
 log4j-layout-template-json-test/pom.xml            |  65 ------
 log4j-layout-template-json/pom.xml                 |  65 ------
 log4j-liquibase/pom.xml                            |  67 -------
 log4j-mongodb3/pom.xml                             |  67 -------
 log4j-mongodb4/pom.xml                             |  67 -------
 log4j-osgi/pom.xml                                 |  70 -------
 log4j-plugin-processor/pom.xml                     |  73 -------
 log4j-plugins-test/pom.xml                         |  73 -------
 log4j-plugins/pom.xml                              |  73 -------
 log4j-script/pom.xml                               |  67 -------
 log4j-slf4j-impl/pom.xml                           |  67 -------
 log4j-slf4j2-impl/pom.xml                          |  66 ------
 log4j-smtp/pom.xml                                 |  66 ------
 log4j-spring-boot/pom.xml                          |  66 ------
 .../log4j-spring-cloud-config-client/pom.xml       |  67 -------
 log4j-taglib/pom.xml                               |  71 -------
 log4j-to-jul/pom.xml                               |  66 ------
 log4j-to-slf4j/pom.xml                             |  67 -------
 log4j-web/pom.xml                                  |  70 -------
 pom.xml                                            | 222 ++++++++++-----------
 src/site/asciidoc/javadoc.adoc                     |  69 +------
 src/site/site.xml                                  |   7 +-
 54 files changed, 160 insertions(+), 3755 deletions(-)


[logging-log4j2] 01/01: Check build reproducibility in CI

Posted by vy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit a4143d1b31e3983965cdcb45ab4d510b32de0d27
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Tue Feb 14 22:33:13 2023 +0100

    Check build reproducibility in CI
---
 .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++++++----------
 pom.xml                     |  9 +++---
 2 files changed, 58 insertions(+), 19 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 71394e01d1..5e657d8d2f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,7 +28,9 @@ jobs:
   build:
 
     runs-on: ${{ matrix.os }}
-
+    # Based on: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
+    env:
+      MAVEN_OPTS: -Xms3072m -Xmx3072m
     strategy:
       matrix:
         os: [ ubuntu-latest, windows-latest, macos-latest ]
@@ -36,12 +38,12 @@ jobs:
     steps:
 
       - name: Checkout repository
-        uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8   # 3.1.0
+        uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b   # 3.2.0
         with:
           fetch-depth: 32
 
       - name: Setup JDK 11
-        uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc   # 3.6.0
+        uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b   # 3.9.0
         with:
           distribution: temurin
           java-version: 11
@@ -49,43 +51,68 @@ jobs:
           architecture: x64
           cache: maven
 
-      - name: Maven "verify"
+      # We could have used `verify`, but `clean install` is required for the following:
+      # 1. The build reproducibility report
+      #    For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
+      # 2. `javadoc:javadoc-no-fork`, which is attached to the `site` goal
+      - name: Build
         timeout-minutes: 60
         shell: bash
         run: |
           ./mvnw \
-            --show-version --batch-mode --errors --no-transfer-progress --fail-at-end \
+            --show-version --batch-mode --errors --no-transfer-progress \
             -DtrimStackTrace=false \
             -Dsurefire.rerunFailingTestsCount=2 \
             -Dlog4j2.junit.fileCleanerSleepPeriodMillis=1000 \
-            verify
+            -DinstallAtEnd=true \
+            clean install
+
+      # `clean verify artifact:compare` is required to generate the build reproducibility report.
+      # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
+      - name: Report build reproducibility
+        shell: bash
+        run: |
+          ./mvnw \
+            --show-version --batch-mode --errors --no-transfer-progress \
+            -DskipTests=true \
+            clean verify artifact:compare
+
+      - name: Verify build reproducibility
+        shell: bash
+        run: |
+          for report_file in target/*.buildcompare **/target/*.buildcompare; do
+            if ! grep -q "^ko=0$" "$report_file"; then
+              echo "Spotted build reproducibility failure in \`$report_file\`:"
+              cat "$report_file"
+              exit 1
+            fi
+          done
 
       - name: Maven "site"
-        # FreeMarker integration of `log4j-changelog` is broken on Windows: https://github.com/apache/logging-log4j-tools/issues/19
-        if: runner.os != 'Windows'
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
-            --show-version --batch-mode --errors --no-transfer-progress --fail-at-end \
-            --non-recursive \
+            --show-version --batch-mode --errors --no-transfer-progress \
             site
 
   deploy:
 
     runs-on: ubuntu-latest
+    env:
+      MAVEN_OPTS: -Xms3072m -Xmx3072m
     needs: build
     if: github.repository == 'apache/logging-log4j2' && github.ref == 'refs/heads/master'
 
     steps:
 
       - name: Checkout repository
-        uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8   # 3.1.0
+        uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b   # 3.2.0
         with:
           fetch-depth: 32
 
       - name: Setup JDK 11
-        uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc   # 3.6.0
+        uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b   # 3.9.0
         with:
           distribution: temurin
           java-version: 11
@@ -96,17 +123,28 @@ jobs:
       - name: Inspect environment
         run: env | grep '^JAVA'
 
-      - name: Maven "deploy"
+      - name: Inspect project version
+        run: |
+          echo ::set-output name=version::$(./mvnw \
+            -q -Dexec.executable=echo \
+            -Dexec.args='${project.version}' --non-recursive exec:exec)
+        id: get_version
+
+      - name: Deploy artifacts
+        # Do not deploy release versions
+        if: ${{ endsWith(steps.get_version.outputs.version, '-SNAPSHOT') }}
         timeout-minutes: 15
         shell: bash
         # `package install:install deploy:deploy` goal is needed to deploy without configuring the plugin in the POM.
-        # For details see: https://maven.apache.org/plugins/maven-gpg-plugin/examples/deploy-signed-artifacts.html
+        # For details, see: https://maven.apache.org/plugins/maven-gpg-plugin/examples/deploy-signed-artifacts.html
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
+            --settings .github/workflows/maven-settings.xml \
             -Dgpg.skip=true \
             -DskipTests=true \
-            --settings .github/workflows/maven-settings.xml \
+            -DinstallAtEnd=true \
+            -DdeployAtEnd=true \
             package install:install deploy:deploy
         env:
           NEXUS_USER: ${{ secrets.NEXUS_USER }}
diff --git a/pom.xml b/pom.xml
index d27e0bb459..a82de67fcd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -246,9 +246,8 @@
     <maven.compiler.release>11</maven.compiler.release>
     <maven.compiler.parameters>true</maven.compiler.parameters>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <!-- See https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
-    <!-- 1672527600 = 2023-01-01, instead of the default 1969, which shows up in Javadoc -->
-    <project.build.outputTimestamp>1672527600</project.build.outputTimestamp>
+    <!-- Fixed `project.build.outputTimestamp` is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
+    <project.build.outputTimestamp>0</project.build.outputTimestamp>
     <docLabel>Site Documentation</docLabel>
     <projectDir/>
     <module.name/>
@@ -1679,7 +1678,9 @@
             </goals>
           </execution>
         </executions>
-        <configuration>
+        <configuration combine.self="override">
+          <!-- `notimestamp` avoids `diff` noise and is required for reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
+          <notimestamp>true</notimestamp>
           <skip>${javadoc.skip}</skip>
           <bottom><![CDATA[
             <p align="center">