[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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
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

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

Attachment: signature.asc
Description: PGP signature


Reply to: