dejan2609 commented on PR #19513:
URL: https://github.com/apache/kafka/pull/19513#issuecomment-3370973819

   @chia7712 Related to `preserveFileTimestamps = true` :arrow_double_down: 
   ___
   Prologue (comment from back in August): 
https://github.com/apache/kafka/pull/19513#issuecomment-3217444662 
   
   Related links:
   - Gradle issue: https://github.com/gradle/gradle/issues/34643
   - Gradle DSL: 
https://docs.gradle.org/9.1.0/dsl/org.gradle.api.tasks.bundling.Tar.html#org.gradle.api.tasks.bundling.Tar:preserveFileTimestamps
    
   
   I just tested again, with the following procedure: comment out 
`preserveFileTimestamps = true` for tasks `:core:siteDocsTar` and 
`:core:releaseTarGz` and execute `./gradlew clean releaseTarGz -i`:
   
   ```
   dejan@dejan-HP-ProBook-450-G7:~/kafka$ git log -3 --oneline 
   4278e5621e (HEAD -> KAFKA-19174, origin/KAFKA-19174) KAFKA-19174 Gradle 
version upgrade (8 -->> 9); build logic is refactored
   9318bd3480 KAFKA-19591 solving issues with `gradlew` content: an old 
template version (i.e. file `unixStartScript.txt`) was being referenced
   d76442e5a6 (origin/trunk, origin/HEAD, trunk) MINOR: Fix a minor copy&paste 
typo in comments (#20634)
   dejan@dejan-HP-ProBook-450-G7:~/kafka$ git diff
   diff --git a/build.gradle b/build.gradle
   index c3cc954e4b..8c7f1d19b4 100644
   --- a/build.gradle
   +++ b/build.gradle
   @@ -1222,7 +1222,7 @@ project(':core') {
        from project.file("$rootDir/docs")
        into 'site-docs'
        duplicatesStrategy 'exclude'
   -    preserveFileTimestamps = true
   +    //preserveFileTimestamps = true
      }
    
      tasks.create(name: "releaseTarGz", dependsOn: 
configurations.archives.artifacts, type: Tar) {
   @@ -1268,7 +1268,7 @@ project(':core') {
        from(project(':streams:examples').jar) { into("libs/") }
        from(project(':streams:examples').configurations.runtimeClasspath) { 
into("libs/") }
        duplicatesStrategy 'exclude'
   -    preserveFileTimestamps = true
   +    //preserveFileTimestamps = true
        filePermissions {
            user {
                read = true
   dejan@dejan-HP-ProBook-450-G7:~/kafka$ ./gradlew clean releaseTarGz -q
   Starting build with version 4.2.0-SNAPSHOT (commit id 4278e562) using Gradle 
9.1.0, Java 17 and Scala 2.13.16
   Build properties: ignoreFailures=false, maxParallelForks=8, 
maxScalacThreads=8, maxTestRetries=0
   MessageGenerator: processed 4 Kafka message JSON file(s).
   ...
   ```
   Unpack generated distributions:
   - cd core/build/distributions/
   - tar xvfz kafka_2.13-4.2.0-SNAPSHOT.tgz
   - tar xvfz kafka_2.13-4.2.0-SNAPSHOT-site-docs.tgz
   
   **Folders show the wrong date: 02nd Jan 1970:** (with default 
`preserveFileTimestamps = false`) :arrow_down_small: 
   ```
   dejan@dejan-HP-ProBook-450-G7:~/kafka/core/build/distributions$ ls -la
   total 136280
   drwxrwxr-x 4 dejan dejan      4096 Oct  6 10:09 .
   drwxrwxr-x 9 dejan dejan      4096 Oct  6 10:05 ..
   drwxr-xr-x 7 dejan dejan      4096 Jan  2  1970 kafka_2.13-4.2.0-SNAPSHOT
   -rw-rw-r-- 1 dejan dejan   3754359 Oct  6 10:05 
kafka_2.13-4.2.0-SNAPSHOT-site-docs.tgz
   -rw-rw-r-- 1 dejan dejan 135767889 Oct  6 10:06 kafka_2.13-4.2.0-SNAPSHOT.tgz
   drwxr-xr-x 7 dejan dejan      4096 Jan  2  1970 site-docs
   dejan@dejan-HP-ProBook-450-G7:~/kafka/core/build/distributions$


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to