Greg Harris created KAFKA-14767:
-----------------------------------

             Summary: Gradle build fails with missing commitId after git gc
                 Key: KAFKA-14767
                 URL: https://issues.apache.org/jira/browse/KAFKA-14767
             Project: Kafka
          Issue Type: Bug
          Components: build
            Reporter: Greg Harris


Reproduction steps:
1. `git gc`
2. `./gradlew jar`

Expected behavior: build completes successfully (or shows other build errors)
Actual behavior:
{noformat}
Task failed with an exception.
-----------
* What went wrong:
A problem was found with the configuration of task ':storage:createVersionFile' 
(type 'DefaultTask').
  - Property 'commitId' doesn't have a configured value.
    
    Reason: This property isn't marked as optional and no value has been 
configured.
    
    Possible solutions:
      1. Assign a value to 'commitId'.
      2. Mark property 'commitId' as optional.
    
    Please refer to 
https://docs.gradle.org/7.6/userguide/validation_problems.html#value_not_set 
for more details about this problem.{noformat}
This appears to be due to the fact that the build.gradle determineCommitId() 
function is unable to read the git commit hash for the current HEAD. This 
appears to happen after a `git gc` takes place, which causes the 
`.git/refs/heads/*` files to be moved to `.git/packed-refs`.

The determineCommitId() should be patched to also try reading from the 
packed-refs to determine the commit hash.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to