Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducibility of Log4jPlugins.java #1520

Closed
ppkarwasz opened this issue Jun 19, 2023 · 5 comments
Closed

Reproducibility of Log4jPlugins.java #1520

ppkarwasz opened this issue Jun 19, 2023 · 5 comments
Assignees
Labels
build Affects the build system or other automation plugins Affects the plugin system
Milestone

Comments

@ppkarwasz
Copy link
Contributor

The generation of the new plugin cache Log4jPlugins.java is non deterministic, which breaks reproducibility of 3.x builds.

As far as I can tell the problem is restricted to the order in which the plugins are declared.

@ppkarwasz ppkarwasz added the build Affects the build system or other automation label Jun 19, 2023
@ppkarwasz ppkarwasz added this to the 3.0.0 milestone Jun 19, 2023
@rgoers
Copy link
Member

rgoers commented Aug 10, 2023

The way it is supposed to work is to find all the plugins in the module and then use the package that they all have in common and then create a plugins package there and add Log4jPlugins.java in that directory. The algorithm should be very deterministic until you add a new plugin that isn't common with the others. I also seem to recall that there is a way to specify the package the file should be placed in.

@jvz
Copy link
Member

jvz commented Oct 15, 2023

Well, this could be fixed fairly easily: alphabetize the entries before writing.

@jvz jvz self-assigned this Oct 15, 2023
@jvz jvz added the plugins Affects the plugin system label Oct 15, 2023
@jvz
Copy link
Member

jvz commented Oct 15, 2023

Seems to be a regression from LOG4J-2735, but I can't see that issue on Jira for some reason.

Edit: oops, that's a typo.

@jvz
Copy link
Member

jvz commented Oct 15, 2023

This is a regression that was otherwise address in 2.x in https://issues.apache.org/jira/browse/LOG4J2-2735

jvz added a commit that referenced this issue Oct 15, 2023
This updates annotation processing to ensure that the output is written in a deterministic order. This ensures that builds involving plugins can be reproducible.

This fixes #1520.

Signed-off-by: Matt Sicker <mattsicker@apache.org>
@jvz
Copy link
Member

jvz commented Oct 15, 2023

Fixed.

@jvz jvz closed this as completed Oct 15, 2023
@ppkarwasz ppkarwasz modified the milestones: 3.0.0, 3.0.0-beta1 Feb 17, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Affects the build system or other automation plugins Affects the plugin system
Projects
None yet
Development

No branches or pull requests

3 participants