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

Add Support for Gradle Configuration Cache #3628

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

lkishalmi
Copy link
Contributor

This one is depends on #3620 (that's the first commit in this PR) will be rebased when #3620 is mainlined.
Till then the 2nd commit allows users to use the Gradle Configuration Cache feature which is in incubation phase.

That required the nb-toolig.gradle init script modified not to read the System properties for the NetBeans tooling jar file, so that file is used as a template and NB create a one in the cache dir using the absolute location of the tooling jar.

As this feature is somewhat new, the default setting is disabled.
image

@lkishalmi lkishalmi added do not merge Don't merge this PR, it is not ready or just demonstration purposes. Gradle [ci] enable "build tools" tests labels Feb 17, 2022
@lkishalmi lkishalmi added this to the NB14 milestone Feb 17, 2022
@lkishalmi lkishalmi removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Feb 18, 2022
@sdedic
Copy link
Member

sdedic commented Feb 21, 2022

The cached processed init script will not work as expected if:

  • another installation of NB will use the same userdir, especially when a different NB version does so.
  • NB installation is moved to another directory
  • Gradle module upgrades w/ changed gradle tooling

I would suggest to still read either system property or pass the location as project property. Other scenarios seem more complicated - i.e. incorporate location + tooling .jar + init script digest hash into the cached filename. Or maybe refresh the initscript before each build .... + some precaution if more builds are executed in parallel.

@lkishalmi
Copy link
Contributor Author

Well, the init script is in the cache dir not in the user dir, so it should not considered to be shareable by different instances. Though changed the code to generate the script on the first call/classloader instance so it should work even with runtime module upgrades as well.

If it's possible I'd try to avoid passing extra properties and things to a build.

@sdedic
Copy link
Member

sdedic commented Feb 23, 2022

Well, the init script is in the cache dir not in the user dir, so it should not considered to be shareable by different instances.

Note that if you pass --user-directory (but without an explicit --cachedir) to NetBeans (and I do, as I maintain several sets of configs for several projects), then the cache dir is AFAIK placed in $userdir/var/cache; at least on Linux.

@lkishalmi lkishalmi merged commit aad1b8f into apache:master Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gradle [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants