Bug 443532 - [PATCH] kde_package_app_templates makes tarballs non-reproducible with GNU tar.
Summary: [PATCH] kde_package_app_templates makes tarballs non-reproducible with GNU tar.
Status: RESOLVED FIXED
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.86.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: ecm-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-10 04:11 UTC by Brendan
Modified: 2022-02-01 19:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch to make kde_package_app_templates reproducible. (2.10 KB, patch)
2021-10-10 04:11 UTC, Brendan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan 2021-10-10 04:11:51 UTC
Created attachment 142288 [details]
Patch to make kde_package_app_templates reproducible.

SUMMARY
kde_package_app_templates embeds timestamps and GID's in tarballs with GNU tar. 

The attached patch fixes this in all the cases I observed.
Timestamp embedding should be fixed my the use of --mtime
GID, UID should be set to 0 with --owner=0 --group=0

STEPS TO REPRODUCE
1. Build any of the packages with templates such as below in Guix, or in some build environment where the root GID can differ.
 - kio
 - akonadi
 - plasma-framework
 - krunner
 - kparts
 - ktexteditor
 - kirigami

OBSERVED RESULT
diffoscope output from building kio:


│ │ │ │   --- /gnu/store/j83x88sa4967i4yndf6r7zwm2vz3xvnp-kio-5.86.0/share/kdevappwizard/templates/ioslave.tar.bz2
│ │ │ ├── +++ /gnu/store/j83x88sa4967i4yndf6r7zwm2vz3xvnp-kio-5.86.0-check/share/kdevappwizard/templates/ioslave.tar.bz2
│ │ │ │ ├── ioslave.tar
│ │ │ │ │ ├── file list
│ │ │ │ │ │ @@ -1,16 +1,16 @@
│ │ │ │ │ │ -drwxr-xr-x   0      999    30000        0 2021-10-08 19:25:03.199470 ./
│ │ │ │ │ │ --rw-r--r--   0      999    30000      651 1970-01-01 00:00:01.000000 ./CMakeLists.txt
│ │ │ │ │ │ -drwxr-xr-x   0      999    30000        0 1970-01-01 00:00:01.000000 ./LICENSES/
│ │ │ │ │ │ --rw-r--r--   0      999    30000    25906 1970-01-01 00:00:01.000000 ./LICENSES/LGPL-2.1-or-later.txt
│ │ │ │ │ │ --rwxr-xr-x   0      999    30000      121 1970-01-01 00:00:01.000000 ./Messages.sh
│ │ │ │ │ │ --rw-r--r--   0      999    30000     1498 1970-01-01 00:00:01.000000 ./README.md
│ │ │ │ │ │ --rwxr-xr-x   0      999    30000      487 1970-01-01 00:00:01.000000 ./install.sh
│ │ │ │ │ │ --rw-r--r--   0      999    30000       65 1970-01-01 00:00:01.000000 ./ioslave.kdevtemplate
│ │ │ │ │ │ -drwxr-xr-x   0      999    30000        0 1970-01-01 00:00:01.000000 ./src/
│ │ │ │ │ │ --rw-r--r--   0      999    30000     4630 1970-01-01 00:00:01.000000 ./src/%{APPNAMELC}.cpp
│ │ │ │ │ │ --rw-r--r--   0      999    30000      636 1970-01-01 00:00:01.000000 ./src/%{APPNAMELC}.h
│ │ │ │ │ │ --rw-r--r--   0      999    30000      905 1970-01-01 00:00:01.000000 ./src/CMakeLists.txt
│ │ │ │ │ │ --rw-r--r--   0      999    30000     2025 1970-01-01 00:00:01.000000 ./src/mydatasystem.cpp
│ │ │ │ │ │ --rw-r--r--   0      999    30000     1252 1970-01-01 00:00:01.000000 ./src/mydatasystem.h
│ │ │ │ │ │ --rw-r--r--   0      999    30000      415 1970-01-01 00:00:01.000000 ./src/myproto.json
│ │ │ │ │ │ --rwxr-xr-x   0      999    30000      138 1970-01-01 00:00:01.000000 ./uninstall.sh
│ │ │ │ │ │ +drwxr-xr-x   0      997    30000        0 2021-10-09 02:23:54.861213 ./
│ │ │ │ │ │ +-rw-r--r--   0      997    30000      651 1970-01-01 00:00:01.000000 ./CMakeLists.txt
│ │ │ │ │ │ +drwxr-xr-x   0      997    30000        0 1970-01-01 00:00:01.000000 ./LICENSES/
│ │ │ │ │ │ +-rw-r--r--   0      997    30000    25906 1970-01-01 00:00:01.000000 ./LICENSES/LGPL-2.1-or-later.txt
│ │ │ │ │ │ +-rwxr-xr-x   0      997    30000      121 1970-01-01 00:00:01.000000 ./Messages.sh
│ │ │ │ │ │ +-rw-r--r--   0      997    30000     1498 1970-01-01 00:00:01.000000 ./README.md
│ │ │ │ │ │ +-rwxr-xr-x   0      997    30000      487 1970-01-01 00:00:01.000000 ./install.sh
│ │ │ │ │ │ +-rw-r--r--   0      997    30000       65 1970-01-01 00:00:01.000000 ./ioslave.kdevtemplate
│ │ │ │ │ │ +drwxr-xr-x   0      997    30000        0 1970-01-01 00:00:01.000000 ./src/
│ │ │ │ │ │ +-rw-r--r--   0      997    30000     4630 1970-01-01 00:00:01.000000 ./src/%{APPNAMELC}.cpp
│ │ │ │ │ │ +-rw-r--r--   0      997    30000      636 1970-01-01 00:00:01.000000 ./src/%{APPNAMELC}.h
│ │ │ │ │ │ +-rw-r--r--   0      997    30000      905 1970-01-01 00:00:01.000000 ./src/CMakeLists.txt
│ │ │ │ │ │ +-rw-r--r--   0      997    30000     2025 1970-01-01 00:00:01.000000 ./src/mydatasystem.cpp
│ │ │ │ │ │ +-rw-r--r--   0      997    30000     1252 1970-01-01 00:00:01.000000 ./src/mydatasystem.h
│ │ │ │ │ │ +-rw-r--r--   0      997    30000      415 1970-01-01 00:00:01.000000 ./src/myproto.json
│ │ │ │ │ │ +-rwxr-xr-x   0      997    30000      138 1970-01-01 00:00:01.000000 ./uninstall.sh
│ │ │ │ ├── stat {}
│ │ │ │ │ @@ -1,8 +1,8 @@
│ │ │ │ │  
│ │ │ │ │ -  Size: 13047     	Blocks: 32         IO Block: 4096   regular file
│ │ │ │ │ -Links: 3
│ │ │ │ │ +  Size: 13069     	Blocks: 32         IO Block: 4096   regular file
│ │ │ │ │ +Links: 1
│ │ │ │ │  Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
│ │ │ │ │  
│ │ │ │ │  Modify: 1970-01-01 00:00:01.000000000 +0000


EXPECTED RESULT
Identical tarballs.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Guix
(available in About System)
KDE Plasma Version: 21.08.1
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION