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

Unable to use this plugin with Gradle 8.1 #713

Open
dant3 opened this issue May 5, 2023 · 8 comments
Open

Unable to use this plugin with Gradle 8.1 #713

dant3 opened this issue May 5, 2023 · 8 comments

Comments

@dant3
Copy link

dant3 commented May 5, 2023

What happened?

Recently upgraded my project to Gradle 8.1 and now it crashes on configuration stage:

* What went wrong:
Configuration cache problems found in this build.

3 problems were found storing the configuration cache, 2 of which seem unique.
- Build file 'app/build.gradle': external process started 'git describe --tags --always --first-parent --abbrev=7 --match=* HEAD'
  See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:external_processes
- Build file 'app/build.gradle': external process started 'git version'
  See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:external_processes

It seems that new gradle does not like then plugins run process at the configuration stage. I'm currently use this plugin to get a version details so that I can then use it in extensions to configure other things and obviously this has to be known at configuration stage.

@dant3 dant3 changed the title Unable to use this plugin with Gradle 8 Unable to use this plugin with Gradle 8.1 May 5, 2023
@dant3
Copy link
Author

dant3 commented May 5, 2023

As a workaround I implemented the same functionality I was using in this plugin by using jgit, which solves the probem.

@dant3
Copy link
Author

dant3 commented May 11, 2023

Seems like this section of gradle documentation contains details on how to proceed with migration:
https://docs.gradle.org/8.0/userguide/configuration_cache.html#config_cache:requirements:external_processes

@mandrachek
Copy link

The best workaround for now appears to be to disable the configuration cache, which is not ideal.
https://docs.gradle.org/8.0/userguide/configuration_cache.html#config_cache:usage:enable

This has been broken for a relatively long time now.
Is this plugin no longer being maintained?

@xenoterracide
Copy link

@dant3 did you happen to make a plugin to replace this one?

@xenoterracide
Copy link

xenoterracide commented Feb 16, 2024

I have an old plugin that was abandon-ware... it doesn't work right now, but I've decided to resurrect it, since it didn't fork, instead preferrring jgit (which I think won't). Hopeful that I'll get it working by the end of the day.

https://github.com/xenoterracide/gradle-semver

@dant3
Copy link
Author

dant3 commented Feb 23, 2024

@dant3 did you happen to make a plugin to replace this one?

I've replaced all usages of this plugin with jgit tasks. Not really a plugin, but it could be extracted to become one I suppose. Howerver it does not resolve the issue because jgit also does Process.exec under the hood in certain situations. I also set those gradle properties

org.gradle.unsafe.configuration-cache=true
org.gradle.configuration-cache.problems=warn

So that it only gives warnings instead of errors. I sometimes see this warning that jgit did called git (to resolve git configuration) but it doesn't happen every time.

@xenoterracide
Copy link

xenoterracide commented Feb 23, 2024

those are caused by eclipse-jgit/jgit#24 people can feel free to weigh in there. Mine is making reasonable progress, would love feedback, I've been messing around with the api quite a bit. I'll probably make some final decisions for 0.9.0 today.

@xenoterracide
Copy link

I think I'm personally generally happy with my API, although at least one person mentioned maybe wanting a provider so if anyone has any opinions on that. Checkout https://github.com/xenoterracide/gradle-semver and give me feedback. I'm not certain 0.9.x will be the final API before 1.0. I'm going to work on a publish to the plugin portal now, and then dogfooding.

I'm going to stop commenting on here now, I feel like I'm now spamming someone else's project about my own.

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

No branches or pull requests

3 participants