-
Notifications
You must be signed in to change notification settings - Fork 87
Switch guava deps from compileOnly to implementation #1530
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
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Build failures may be related to opensearch-project/OpenSearch#17989 CC: @pranu2502 |
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@kumargu @pranu2502 @RajatGupta02 This is something that needs to be considered for the AccessController replacement. Resources on the classpath should be exempt from permissions checks. In java, I believe this is handled in the ClassLoader: https://github.com/openjdk/jdk21u/blob/master/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java#L500-L505 Ref run with failures: https://github.com/opensearch-project/security-analytics/actions/runs/14935397717/job/41961528538 |
CC: @reta putting this on your radar too. |
Signed-off-by: Craig Perkins <[email protected]>
We're going to need a solution to this to support JDK 24 in this repo, because the calls to AccessController.doPrivileged within the JDK have now been removed: openjdk/jdk24u@db7ee3d |
Have you seen the failures related to that? For the limited coverage we have now, it seems like we are fine [1]? In any case, I think we do have a couple of options to consider (java agent should have access to application classpath). |
I haven't tried with JDK24 yet, but I can update this repo to run the same tests with the change in this PR. This was the run where I saw issues reading classpath resources after opensearch-project/OpenSearch#17989 was merged into core: https://github.com/opensearch-project/security-analytics/actions/runs/14935397717/job/41961528538 |
…ect#1530) * Switch guava deps from compileOnly to implementation Signed-off-by: Craig Perkins <[email protected]> * Use AccessController Signed-off-by: Craig Perkins <[email protected]> * Use getResource Signed-off-by: Craig Perkins <[email protected]> * Use getResourceAsStream Signed-off-by: Craig Perkins <[email protected]> * Try removing lead forward slash Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Dennis Toepker <[email protected]>
…ect#1530) * Switch guava deps from compileOnly to implementation Signed-off-by: Craig Perkins <[email protected]> * Use AccessController Signed-off-by: Craig Perkins <[email protected]> * Use getResource Signed-off-by: Craig Perkins <[email protected]> * Use getResourceAsStream Signed-off-by: Craig Perkins <[email protected]> * Try removing lead forward slash Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Dennis Toepker <[email protected]>
…ect#1530) * Switch guava deps from compileOnly to implementation Signed-off-by: Craig Perkins <[email protected]> * Use AccessController Signed-off-by: Craig Perkins <[email protected]> * Use getResource Signed-off-by: Craig Perkins <[email protected]> * Use getResourceAsStream Signed-off-by: Craig Perkins <[email protected]> * Try removing lead forward slash Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Dennis Toepker <[email protected]>
…ect#1530) * Switch guava deps from compileOnly to implementation Signed-off-by: Craig Perkins <[email protected]> * Use AccessController Signed-off-by: Craig Perkins <[email protected]> * Use getResource Signed-off-by: Craig Perkins <[email protected]> * Use getResourceAsStream Signed-off-by: Craig Perkins <[email protected]> * Try removing lead forward slash Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Dennis Toepker <[email protected]>
Description
SAP has its guava dependencies set at compileOnly level which means they are not packaged into the SAP assembly and available at runtime.
SAP uses these deps at runtime, however, the way this works is because of the extending relationship between SAP and JS plugin where the deps of the extended plugin are available to the extending plugin at runtime.
In opensearch-project/job-scheduler#773, guava was removed from JS which means these deps are no longer available to SAP at runtime. I'm creating this PR to change the guava deps from compileOnly to implementation to ensure they are included in the assembly and available at runtime.
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.