Debian Bug report logs - #1004057
evolution-ews: reproducible-builds: build path embedded in libecalbackendews.so and RPATH

Package: src:evolution-ews; Maintainer for src:evolution-ews is Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>;

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

Date: Thu, 20 Jan 2022 01:09: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 GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#1004057; Package src:evolution-ews. (Thu, 20 Jan 2022 01:09:04 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 GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Thu, 20 Jan 2022 01:09:04 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: evolution-ews: reproducible-builds: build path embedded in libecalbackendews.so and RPATH
Date: Wed, 19 Jan 2022 17:04:05 -0800
[Message part 1 (text/plain, inline)]
Source: evolution-ews
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

Builds in a different source directory trigger reproducibility issues
with libecalbackendews.so and the RPATH of various other binaries also
have different BuildId:

  https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/evolution-ews.html

  /usr/lib/evolution-data-server/calendar-backends/libecalbackendews.so

  /build/1st/evolution-ews-3.42.3/src/EWS/calendar
  vs.
  /build/2/evolution-ews-3.42.3/2nd/src/EWS/calendar

The first patch fixes this by removing the source directory from the
CMakeLists.txt that is used to build libecalbackendews.so.

I have not tested that this is a correct fix, per se, but it seems
unlikely that a transient build directory for an installed .deb package
would be present on any end-user system in any useful way.

The second patch fixes this by passing arguments to configure to use a
relative RPATH instead of embedding the full path.


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


Thanks for maintaining evolution-ews!


live well,
  vagrant
[0001-src-EWS-calendar-CMakeLists.txt-Blank-out-EXCHANGE_E.patch (text/x-diff, inline)]
From 7c50659c1eaa7eab31b887d47f82030ad7dbdba4 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Thu, 20 Jan 2022 00:50:56 +0000
Subject: [PATCH 1/2] src/EWS/calendar/CMakeLists.txt: Blank out
 EXCHANGE_EWS_SRCDIR.

The full path to the source gets embedded in libecalbackendews.so,
which could not usefully be used on the end-user's installed system
when installed from a .deb package.
---
 src/EWS/calendar/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/EWS/calendar/CMakeLists.txt b/src/EWS/calendar/CMakeLists.txt
index 3a6ce02..3530504 100644
--- a/src/EWS/calendar/CMakeLists.txt
+++ b/src/EWS/calendar/CMakeLists.txt
@@ -26,7 +26,7 @@ target_compile_definitions(ecalbackendews PRIVATE
 	-DG_LOG_DOMAIN=\"ecalbackendews\"
 	-DEXCHANGE_EWS_DATADIR=\"${ewsdatadir}\"
 	-DEXCHANGE_EWS_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
-	-DEXCHANGE_EWS_SRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
+	-DEXCHANGE_EWS_SRCDIR=\"\"
 )
 
 target_compile_options(ecalbackendews PUBLIC
-- 
2.34.1

[0002-debian-rules-Pass-DCMAKE_BUILD_RPATH_USE_ORIGIN-ON-v.patch (text/x-diff, inline)]
From 94874050b068f6c156f989622e4ec065a384cded Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Thu, 20 Jan 2022 00:50:11 +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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/rules b/debian/rules
index db3a81a..741f2dc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,6 +16,7 @@ EVO_NEXTVERSION = $(shell pkg-config --modversion evolution-shell-3.0  | awk -F'
 
 override_dh_auto_configure:
 	dh_auto_configure -- \
+		-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
 		-DSYSCONF_INSTALL_DIR=/etc
 
 override_dh_makeshlibs:
-- 
2.34.1

[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 11:02:40 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.