Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Refine build scripts #18

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Refine build scripts #18

wants to merge 19 commits into from

Conversation

vlsi
Copy link

@vlsi vlsi commented Dec 28, 2021

This PR configures build and test scripts, so the project is buildable and testable with the current Maven and Java versions.

Note: this change does not alter the features, so I suggest merging this before other PRs that address CVEs.

Notable changes on top of Leo's commits in PR#17:
a) I simplified toolchains: the build requires Java <= 1.8 or it requires Java 1.8 (exactly) toolchain to be present.
b) I skipped "test: delete several broken low-quality tests".
In practice, what Leo calls "broken tests" are tests that need to be executed in
their own JVM (e.g. with special values for log4j.configuration, etc).
I kept the tests in ignored mode.

/cc @lsimons

lsimons and others added 19 commits December 28, 2021 13:48
The new build requires JDK8 or later, and a JDK6 installed as a maven
toolchain.

Main changes include:
* switch to Maven 3, requiring JDK7 to invoke
* switch to latest (compatible) maven plugins, requiring JDK8 to invoke
* introduce two profiles: toolchain (default) and no-toolchain
  * toolchain profile uses maven toolchains feature with JDK6
    (can also use JDK7) and source/target version of 1.4,
    for compatibility with JDK 1.4/5/6/7 and beyond
  * no-toolchain profile uses default system JDK with
    source/target version of 7,
    for compatibility with JDK 8/9/10/11/17 and beyond
* stop building NTEventLogAppender.dll from maven by invoking ant
  (instead use the checked-in version)
* replace some plugin use with resources section
* replace some ant tasks with maven clean plugin
* change all project metadata for correctness
* remove duplicate LICENSE and NOTICE files and use the main ones
* set default encoding to UTF-8 to silence some warnings
* enable running all unit tests instead of a whitelist
* change when and how site is generated
* customize site templating for modern site plugin
* remove unused and unsupported ant build files
* update INSTALL document to match changes
Sets up a matrix build using github actions that runs on every push.
The following combinations all work:

* Toolchain 1.6, JDK 11, OS ubuntu-18.04
* Toolchain 1.6, JDK 11, OS ubuntu-20.04
* Toolchain 1.6, JDK 11, OS windows-2019
* Toolchain 1.6, JDK 11, OS windows-2022
* Toolchain 1.7, JDK 11, OS ubuntu-18.04
* JDK 8, OS ubuntu-18.04
* JDK 11, OS ubuntu-18.04
* JDK 17, OS ubuntu-18.04
* JDK 8, OS ubuntu-20.04
* JDK 11, OS ubuntu-20.04
* JDK 17, OS ubuntu-20.04
* JDK 8, OS windows-2019
* JDK 11, OS windows-2019
* JDK 17, OS windows-2019
* JDK 8, OS windows-2022
* JDK 11, OS windows-2022
* JDK 17, OS windows-2022
Now that the main build runs all tests, remove the old way of running
them with ant or bash.
MDCTestCase has some nasty reflection inside that is not allowed anymore
on JDK >= 17. Detect and trap the error.
Changes most tests to use unique output files during their runs, so that
when they run in parallel or out-of-order or interactively they do not
cause test failures, reducing flakyness of test runs.
Copy link
Member

@jvz jvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly looked through the changes and they seem fine. Could use another reviewer.

@jvz jvz self-requested a review December 28, 2021 19:40
Copy link
Member

@jvz jvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to comment, not approve. Still need to review pom changes for an actual approval. Other changes look good, though we could use more eyes here.

@larrywest
Copy link

@jvz Sorry if this is stated somewhere I missed, but what's the reason for reversing the end-of-life decision for log4j 1.x?

@vlsi
Copy link
Author

vlsi commented Jan 1, 2022

@larrywest , log4j 1.2 is still used a lot, and there's no drop-in replacement.
That is why fixing 1.2 makes perfect sense, so the users can just upgrade log4j 1.x to a newer version and avoid spending time on migrating to another libraries.

@rgoers
Copy link
Member

rgoers commented Jan 1, 2022

@larrywest There has not been a decision to reverse this. There has been a request to reverse it. We just realized that when we made the subversion repo read-only that there was mirror at GitHub that people were making PRs to. That GitHub repo was not under the control of the Apache Logging project so we moved it here. Discussions have been happening on the dev list and there is currently a vote in progress between two options. The Logging Services PMC hasn't committed to doing anything as of yet.

Copy link

@ceki ceki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commits f723b70 is a good idea

vlsi referenced this pull request in qos-ch/reload4j Jan 12, 2022
@lsimons
Copy link

lsimons commented Jan 20, 2022

This PR should be closed.

See https://github.com/apache/logging-log4j1/blob/main/README.md for rationale.

See

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants