okay , let's think out loud
# gsoc-2025-improving-cc
n
okay , let's think out loud
by trying to remove what break cc to see how deep is it
Copy code
def activities = project.liquibase.activities
def runList = project.liquibase.runList
those two lines in LiquibaseTask break as it explicitly use project
if we remove project and just call
liquibase .activities
still break cc as it implicitly referring to
project.liquibase
r
But why do we need to do that at execution time?
How are activities and runList initialized?
If they are initialized at configuration time, then there is no reason not to collect them at configuration or serialization (e.g. wrapped into providers) time
n
project.liquibase
is an instance of
LiquibaseExtension
that added to project.extensions
yes,they could be assign to input providers
mainClassName , it could be set at configuration , but i think it still do its logic at exceution time
r
It seems we could project the bits we need uslng providers set as values for most things
Like we did for Nebula Lint
It seems the project instance is not consumed elsewhere
So it should be good
I say we collect our findings and move on to the next plugin (js2d?)
n
in js2d, i think it is easy to fix it but its code hard to understand
the error is getting FileCollection instead of NamedDomainObjectProvider
r
Could you please share a link to the code on github?
(if you are looking at it from IntelliJ, IntelliJ allows you to open a line of code in GitHub via context menu)
Copy code
project.configurations.named()
returns
NamedDomainObjectProvider
but it receive
DefaultFileCollectionFactory$ResolvingFileCollection.
as in the error
how this error related to configuration cache?
what I know that FileCollection is problem to cc
r
Could you show me error you are referring to?
n
What went wrong: Configuration cache problems found in this build. 2 problems were found storing the configuration cache, 1 of which seems unique. - Task
:generateJsonSchema2DataClassConfigExample
of type `org.jsonschema2dataclass.js2p.Js2pGenerationTask`: value 'fixed(class org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection, file collection)' is not assignable to 'org.gradle.api.NamedDomainObjectProvider'
@Rafael Chaves is this gradle issue?
r
Which Gradle version did you see it happening?
n
Gradle 8.13
r
Does capturing the configuration using a local var typed as
FileCollection
avoids the issue? https://github.com/gradle/gradle/issues/17821
n
okay it works
i hate those toolchain java versions ,always take timee
i am going to try their test cases
they don't have test cases , can't find them
@Rafael Chaves should I do a PR?
I am trying to test other plugins and kept getting the same error
WARNING: A restricted method in java.lang.System has been called WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/Users/nouranatef/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/native-platform-0.22-milestone-28.jar) WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module WARNING: Restricted methods will be blocked in a future release unless native access is enabled [Incubating] Problems report is available at: file:///Users/nouranatef/IdeaProjects/license-test/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * Where: Build file '/Users/nouranatef/IdeaProjects/Gradle-License-Report/build.gradle' line: 36 * What went wrong: A problem occurred evaluating project ':Gradle-License-Report'.
Could not create task 'Gradle License Reporttest'.
> Could not create task of type 'Test'. > Could not create an instance of type org.gradle.api.internal.tasks.testing.DefaultTestTaskReports. > Could not create an instance of type org.gradle.api.reporting.internal.DefaultReportContainer. > Type T not present
r
Better start new threads for new plugins, Nouran
n
i tried already and it passed
r
You tried without your fix as well? Do you think your test project would have exposed issues re: file collections being resolved too soon (becoming empty)?
n
yes I tried without any fix
sorry i don't understand
I got this issue when I tried on my test project with enabling cc on
r
Sure, but a common issue with addressing CC issues is to Introduce functional bugs (that do not lead to build failures, but incorrect builds). For file collections, that often means missing files.
n
okay how to confirm this?
so this error happens because test project try to resolve a file collection too early (during configuration time) instead of during task execution, and may get an empty file when enabling cc, so it crashes when cc on but otherwise it didn't
Am I understand it correct?
r
Basically that, except that the failure mode could be an apparent success build, but which does not produce the expected results.
One way to check this is to use a representative project that uses the plugin, and run a task in contributed by the plugin (if that is what the plugin contributes), using the vanilla plugin, and using the patched plugin, then compare the resulting
build
directory contents, and see if the only differences are timestamps.
It helps to keep both
build
directories around. One way to do that is to have two copies of the sample project, one using the vanilla plugin, and the other using the patched plugin.
Does that make sense?
You will need to get some basic understanding of what the plugin tasks mean to achieve in order to validate the are not broken by your changes. Build status (fail or success) is not enough for that.
n
generateJsonSchema2DataClassConfigExample this task what break otherwise if you use gradle build , it didn't break
is this enough to using in the testing?
r
n
ah sorry ignore it that was another plugin
why this happen , the plugin itself break , but when i change anything in the code it restore the saved cache without even check the changes that may effect this saved cache or it check without breaking how?https://drive.google.com/file/d/1uleq3QQDK7mGLERqdIHslmCv1X55gbR3/view?usp=share_link
r
Do you mean the build cache (not the configuration cache)?
(i.e. the "UP-TO-DATE" task outcomes?)
n
i think yes as cc stored everytime
r
You need to be able to distinguish the behavior of the build cache and CC
I am still unsure about which cache's behavior you are confused
n
why when i revert the changes the build didn't fail
r
If you want to know why a CC entry needs to be stored (i.e. a CC cache miss), the reason appears at the top of the build output ("cannot be reused because...")
n
what i want to know why when i use composite build with my changes and without both build successfully
it should without any changes break
r
So you are saying that by just running your sample build against a source version of the plugin brought in via included build (without any changes) does not reproduce the issue that you see when running against the plugin from Plugin Portal?
n
the first time the issue appear then when i made my changes and run it and then revert them again , it didn't get any issue
r
It could be that you made other changes that you are not seeing. Or could be the that the latest release version of the plugin does not contain changes from the mainline that make the problem not happen.
I will try that locally
Could you share your test project?
n
r
There are lot changes since the latest released version (6.0, 2.5 years ago). It seems one of those changes was fixing CC compatibility... https://github.com/jsonschema2dataclass/js2d-gradle/pull/789
Nouran, this plugin does not need a fix, but could you please still include the fixing strategy that was adopted for it in your report? (which should include js2d and liquibase, plusyour next ones)
n
ahh okay
r
A google doc, a Github gist or anything else that allows you to explain the issue/potential fix for each plugin's incompatibility will do.
n
i really don't care about the report
real fix is enough for me
r
It is our goal to understand how plugins are broken and patterns of incompatibilities and potential fixes.
n
he has a fix although he added it to the list 3 weeks ago thats so weird
r
Because it has not been shipped yet, having it in the source code but not released is not enough
n
it breaks bec: 1 problem was found storing the configuration cache. - Plugin 'com.jfrog.artifactory': registration of listener on 'Gradle.addListener' is unsupported
they use old version of jfrog plugin as in the Play framework plugin
thats why it breaks
if they only update this plugin version to the latest "6.0.0" as we did to PF , it will use cc normally
they don't have issues and they don't want contributions , but i can added as PR to them with comment that this simple thing that prevent them from using cc