Debian Bug report logs - #1006385
krita: reproducible-builds: build path embedded in binaries

Package: src:krita; Maintainer for src:krita is Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Thu, 24 Feb 2022 19:15:01 UTC

Severity: normal

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>:
Bug#1006385; Package src:krita. (Thu, 24 Feb 2022 19:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>. (Thu, 24 Feb 2022 19:15:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: krita: reproducible-builds: build path embedded in binaries
Date: Thu, 24 Feb 2022 11:12:00 -0800
[Message part 1 (text/plain, inline)]
Source: krita
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The build path is embedded in krita in two different ways, notably
directly into the /usr/bin/krita binary, and the RPATH contains the
build path resulting in different buildid.

The attached patches fix this by removing the explicitly embedded build
path in krita/main.cc, and passing -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON via
a dh_auto_configure override, which should use a relative path for
RPATH.


With these patches applied, krita should build reproducibly on
tests.reproducible-builds.org!


Thanks for maintaining krita!


live well,
  vagrant
[0001-krita-main.cc-Remove-reference-to-build-directory.patch (text/x-diff, inline)]
From efc7ddd2ef4682afdf427222c6f85c7865ce9fcf Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Thu, 24 Feb 2022 19:01:05 +0000
Subject: [PATCH 1/2] krita/main.cc: Remove reference to build directory.

The debian package of krita will not be running from the build
location, so remove the check which causes reproducibility issues by
embedding the build directory in the binary.

https://reproducible-builds.org/docs/build-path/
---
 krita/main.cc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/krita/main.cc b/krita/main.cc
index a356b15..2f6f604 100644
--- a/krita/main.cc
+++ b/krita/main.cc
@@ -555,11 +555,6 @@ extern "C" MAIN_EXPORT int MAIN_FN(int argc, char **argv)
     dbgKrita << "PATH" << qgetenv("PATH");
 #endif
 
-    if (qApp->applicationDirPath().contains(KRITA_BUILD_DIR)) {
-        qFatal("FATAL: You're trying to run krita from the build location. You can only run Krita from the installation location.");
-    }
-
-
 #if defined HAVE_KCRASH
     KCrash::initialize();
 #elif defined USE_DRMINGW
-- 
2.30.2

[0002-debian-rules-Pass-DCMAKE_BUILD_RPATH_USE_ORIGIN-ON-v.patch (text/x-diff, inline)]
From 4014c689f8876c3aad54e8ecad9d2db20692f0c1 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Thu, 24 Feb 2022 19:03:13 +0000
Subject: [PATCH 2/2] debian/rules: Pass -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON via
 dh_auto_configure override.

This avoids embedding the full path in RPATH, which triggers BuildId
differences.

https://tests.reproducible-builds.org/debian/issues/unstable/cmake_rpath_contains_build_path_issue.html
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 4db82ab..19e8c44 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,7 +15,7 @@ endif
 	dh $@ --with kf5
 
 override_dh_auto_configure:
-	dh_auto_configure -Skf5 -- -DFOUNDATION_BUILD=OFF -DBUILD_TESTING=OFF -DENABLE_UPDATERS=OFF
+	dh_auto_configure -Skf5 -- -DFOUNDATION_BUILD=OFF -DBUILD_TESTING=OFF -DENABLE_UPDATERS=OFF -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
 
 execute_after_dh_auto_install:
 	# remove symlinks of private libraries
-- 
2.30.2

[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 10:18:31 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.