Coder Social home page Coder Social logo

Comments (15)

gmazzo avatar gmazzo commented on June 7, 2024 2

@gmazzo maybe you can provide a simple project to reproduce the error?

Here is it:
https://github.com/gmazzo/gradle-git-versioning-plugin-cc-issue

Run ./gradlew --stop && ./gradlew build to get the issue.

Here is a scan of it also:
https://scans.gradle.com/s/bs5gyy43tlebc

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024 1

Hey, I got corona :-/ so probably I'll look a this next week.

from gradle-git-versioning-plugin.

aSemy avatar aSemy commented on June 7, 2024 1

I hope you feel better soon @qoomon!

I think what might work is putting every JGit calls inside a ValueSource, to be computed lazily. That should allow Gradle to fingerprint the property.

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024 1

Unfortunately I am not able to reproduce the issue :-/

I run ./gradlew --configuration-cache version multiple times, without any error

Gradle Version: 8.1.1
Plugin Version: 6.4.2

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024 1

@gmazzo thanks a lot that works or actually it doesn't :-D

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024 1

I don't know how to reset it after it work once.

Kill the daemon, that worked to me every time: ./gradlew --stop && ./gradlew xxx

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024

Researching a bit deeper, it seems this is actually caused by JGIT implementation, I am right? I thought JGIT was a pure java implementation, why is running the host git command? 🤔

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024

I'd say this issue is caused by JGit and every plugin that relies on it will face the same. It seems it's accessing .gitconfig on ins initialization by a couple of git commands and that is causing to Gradle's Configuration Cache to fail:
image

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024

Yeah no hurries. I was talking a look and it seems there is no way no hook on jgit to delegate the process creation to Gradle's exec.

So one option will be to ask for it, or open a PR, but probably is going to be a long process.

Another one will be to check if you can not depend on it at all, and just make raw git commands with exec.

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024

Felling better right? Sorry I missed that comment 😅

Unfortunately I am not able to reproduce the issue :-/

That's strange 🤔, maybe it's not done all the time? I think it's worth wrapping it in a provider anyway, as the GIT case is actually their main example of it

I have too much on my plate right now (between work, personal plugins, and other contributions) but I'll keep it in the agenda for later if no one else can do it.

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024

@gmazzo maybe you can provide a simple project to reproduce the error?

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024

It's totally strange to me, it fails the first time i run ./gradlew version the second time it works just as expected.
Even if I remove the ./gradle folder it still works.

from gradle-git-versioning-plugin.

gmazzo avatar gmazzo commented on June 7, 2024

Same here, I think it should be caused by some static initialization of jgit.

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024

I don't know how to reset it after it work once.

from gradle-git-versioning-plugin.

qoomon avatar qoomon commented on June 7, 2024

even after removing .git and .gradle dir it still works

from gradle-git-versioning-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.