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

Reproducible build #232

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Reproducible build #232

merged 1 commit into from
Mar 4, 2021

Conversation

jasonjkeller
Copy link
Contributor

@jasonjkeller jasonjkeller commented Feb 27, 2021

The weaver loads & caches each instrumentation module by locating the instrumentation module jar and reading in the bytes for the all of the classes contained in the module.

However it appears that the weaver depends on the classes being read in from the JarInputStream in a specific and predictable order, meaning that the instrumentation module jar files need to be generated in a deterministic manner.

This PR modifies the build task for the instrumentation modules so that the resulting jar file always adds files in a reproducible order.


One notable example is the jax-rs-1.0 instrumentation, which could fail with a WeaveViolation if the classes weren't read in from the jar (newrelic.jar!/instrumentation/jax-rs-1.0-1.0.jar) in the correct order.

The changes in this PR resulted in the jax-rs-1.0-1.0.jar being consistent between local builds and those published via the github build pipeline and in a manner that resolves the WeaveViolation


Helpful reference: https://dzone.com/articles/reproducible-builds-in-java

@jasonjkeller
Copy link
Contributor Author

@jasonjkeller jasonjkeller merged commit 7a28fd9 into main Mar 4, 2021
@jasonjkeller jasonjkeller deleted the reproducible-build branch March 4, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants