Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aWeaveViolation
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 theWeaveViolation
Helpful reference: https://dzone.com/articles/reproducible-builds-in-java