Replies: 4 comments 7 replies
-
|
Thanks for looking into this @cdsap
FWIW, I don't see for what |
Beta Was this translation helpful? Give feedback.
-
|
hi @aloubyansky, Even though this method is not explicitly referenced from build logic like This means the set of inputs is dynamically computed based on packaging mode. For example, when jarType is FAST_JAR, the inputs include genBuildDir and the outputDirectory under appBuildDir. When it is LEGACY_JAR, the task also includes the lib directories under both depBuildDir and appBuildDir. So the task inputs depend on runtime configuration decisions, and those decisions require reading configuration values during configuration time. If we rework this, we can establish clearer boundaries for QuarkusBuild inputs and reduce configuration time reads. I considered using only QUARKUS_BUILD_APP_DIR as a single input, but given the conditional logic above, we would need to confirm that it always covers all relevant directories (especially the lib directories for LEGACY_JAR, and any runner/artifacts inputs added by runnerAndArtifactsInputs). |
Beta Was this translation helpful? Give feedback.
-
@radcortez do we need a system property config source under Maven and Gradle? Aren't we bringing in the build system properties later, which serve the same purpose? Another thought is that maybe we can filter down the system properties source to exclude anything outside of |
Beta Was this translation helpful? Give feedback.
-
|
@radcortez would reading systems properties lazily be an option during the config initialization? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some of the Quarkus Gradle plugin tasks in this repository are configuration-cache compatible, and we are seeing cache hits for tasks like
quarkusBuild. However, we have noticed that the configuration cache is invalidated when unrelated system properties change, even when those properties do not affect the Quarkus build (issue #52464).In other words, the task outcomes do not change because these system properties are not actual inputs to the build, but the mere fact that they are read during configuration causes configuration-cache misses. Ideally, we should avoid reading system properties during configuration, and instead read them during task execution. If some system properties are actually influential, we should explicitly model them as inputs (similar to what we do for environment variables and Quarkus properties).
Where the system properties are being read
The first thing to understand is who is resolving the system properties that trigger invalidation. After some investigation, we observed this happens when instantiating
SmallRyeConfigBuilderinConfigUtils. During builder initialization, we calladdDefaultSources()from SmallRye, and that’s where system properties are read:This
SmallRyeConfigBuilderis used to instantiate the effective configuration in the Quarkus Gradle plugin. Now that we know when the system-property read occurs, the remaining question is where in the plugin we are referencing configuration during Gradle configuration time.Places where we found configuration-time reads
So far, we have identified the following locations:
QuarkusBuild: This task defines an@InputFilesproperty,getBuildInputFiles, which represents the “codegen output files” inputs forQuarkusBuild. The problem is that these inputs are currently computed during configuration and depend on general/package settings from the Quarkus extension. When we made this task configuration-cache compatible, we had to remove direct extension references and instead define explicit inputs, but some paths still trigger config resolution early. Also this fact could be related to issues like 9400d90QuarkusGenerateCode,QuarkusBuild, etc.) Some configuration blocks call methods that resolve the effective config to compute values, which triggers system property reads during configuration. This is caused the previous point.QuarkusExtensionView:Reading values like ignoreEntries from the extension inside the constructor forces a new instantiation of the build config, which again triggers effective config creation.Potential solutions
This would mean restructuring those parts of the plugin so that effective config is only instantiated during execution, and any required values are either:
If we proceed with option 2, we will likely need to redefine QuarkusBuild#getBuildInputFiles. This code is old, but it is critical because it directly affects the task inputs of the Quarkus build. I think this needs an open discussion before changing it.
Side note
Because these configuration-cache misses are impacting us, I prepared a PR that introduces an experimental mode which disables using BuildConfig during configuration time. This allows full configuration-cache compatibility in cases where the cache would otherwise miss due to unrelated system property changes.
Beta Was this translation helpful? Give feedback.
All reactions