-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix configuration cache compatibility issues #124073
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,13 +46,12 @@ esplugin.bundleSpec.from('config/discovery-ec2') { | |
| } | ||
|
|
||
| tasks.register("writeTestJavaPolicy") { | ||
| boolean inFips = buildParams.inFipsJvm | ||
| inputs.property("inFipsJvm", inFips) | ||
| final File javaPolicy = new File(layout.buildDirectory.asFile.get(), "tmp/java.policy") | ||
| outputs.file(javaPolicy) | ||
| doLast { | ||
| final File tmp = file("${buildDir}/tmp") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the We moved declaring the output file and the inFips boolean into the configuration phase and also declared them as proper inputs/outputs for the Some background on this: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements |
||
| if (tmp.exists() == false && tmp.mkdirs() == false) { | ||
| throw new GradleException("failed to create temporary directory [${tmp}]") | ||
| } | ||
| final File javaPolicy = file("${tmp}/java.policy") | ||
| if (buildParams.inFipsJvm) { | ||
| if (inFips) { | ||
| javaPolicy.write( | ||
| [ | ||
| "grant {", | ||
|
|
@@ -95,9 +94,9 @@ tasks.withType(Test).configureEach { | |
| // this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property | ||
| // it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'` | ||
| if (buildParams.inFipsJvm){ | ||
| nonInputProperties.systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| nonInputProperties.systemProperty 'java.security.policy', "=file://${layout.buildDirectory.asFile.get()}/tmp/java.policy" | ||
| } else { | ||
| nonInputProperties.systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy" | ||
| nonInputProperties.systemProperty 'java.security.policy', "file://${layout.buildDirectory.asFile.get()}/tmp/java.policy" | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when running with configuration cache enabled, Project#providers is not available from a build scan background action. we can fall back to normal System.getProperty check instead as gradle instruments System.getProperty calls automatically to take into account for configuration caching.