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

Marking command line arguments options as InternalSubpluginOptions #1368

Merged
merged 1 commit into from
May 8, 2023

Conversation

cdsap
Copy link
Contributor

@cdsap cdsap commented Apr 19, 2023

We described in #1359 a cache issue when using Ksp with the Room processor since version 1.8.10-1.0.9.

After reviewing the code, we have noticed that since this version all the values of the internal property options are set as CompilerPluginConfig for the KspTasks.

kspTask.pluginOptions.add(
                project.provider {
                    CompilerPluginConfig().apply {
                        (kspTask as KspTask).options.get().forEach {
                            addPluginArgument(KSP_PLUGIN_ID, it)
                        }
                    }
                }
            )

Later, KGP will populate the inputs arguments like:

result["$subpluginId." + option.key + indexSuffix] = option.value

At this point, KGP doesn't know about the path sensitivity of the argument value producing different build cache keys:
Screenshot 2023-04-18 at 5 36 06 PM
(notice the argument com.google.devtools.ksp.symbol-processing.apoption:room.schemaLocation)

This PR updates the type of subplugin option for the CommandLineArgumentProviders as InternalSubpluginOption because this type of Subplugin does not track these values as inputs and they should instead already be tracked via the CommandLineArgumentProvider.

Tests

Ksp
https://ge.solutions-team.gradle.com/c/jeca5opi7c6lo/cfxcrcoqv7v46/task-inputs?cacheability=cacheable

Using InternalSubpluginOption
https://ge.solutions-team.gradle.com/c/sxmggqn6mwihu/3drfct4q2zqqk/task-inputs?cacheability=cacheable

@neetopia
Copy link
Collaborator

neetopia commented May 8, 2023

Taking a look..

@neetopia
Copy link
Collaborator

neetopia commented May 8, 2023

Thanks for the PR, Looks good to me, will merge after CI is completed!

@neetopia neetopia merged commit a4b3119 into google:main May 8, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants