summaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-gnome/tracker/tinysparql/0001-fix-reproducibility.patch
blob: 23da5bb97eff9828f97cf035b2e7d5e60a5c9567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From 1eec06fc1ef26e4954507001c1c2f981eab8d77d Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Mon, 18 Sep 2023 02:47:55 +0200
Subject: [PATCH] tracker: fix reproducibility issue

Tracker's design seems to be strictly for non-cross builds and leaks buildpaths into the
binaries at various places. Avoid this to improve binary reproducibility.

todo: Some of these paths may need to be adjusted to make the test environment work

Upstream-Status: Inappropriate [oe-specific]

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meson.build                        | 6 +++---
 src/libtracker-common/meson.build  | 4 ++--
 src/libtracker-http/meson.build    | 8 ++++----
 src/libtracker-http/tracker-http.c | 4 ++--
 src/libtracker-sparql/meson.build  | 4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/meson.build b/meson.build
index 41c00fafc..6e7282cb7 100644
--- a/meson.build
+++ b/meson.build
@@ -333,7 +333,7 @@ have_rtld_noload = cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD')
 conf.set('HAVE_RTLD_NOLOAD', have_rtld_noload)
 
 # Config that goes in some other generated files (.desktop, .service, etc)
-conf.set('abs_top_builddir', meson.current_build_dir())
+conf.set('abs_top_builddir', '/usr/src/debug/tracker')
 conf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
 
 configure_file(input: 'config.h.meson.in',
@@ -372,8 +372,8 @@ subdir('docs')
 subdir('utils')
 
 test_c_args = tracker_c_args + [
-    '-DTOP_BUILDDIR="@0@"'.format(build_root),
-    '-DTOP_SRCDIR="@0@"'.format(source_root),
+    '-DTOP_BUILDDIR="@0@/"'.format('/usr/src/debug/tracker'),
+    '-DTOP_SRCDIR="@0@/"'.format('/usr/src/debug/tracker'),
 ]
 
 tracker_uninstalled_cli_dir = join_paths(meson.current_build_dir(), 'src', 'tracker')
diff --git a/src/libtracker-common/meson.build b/src/libtracker-common/meson.build
index 72c2ae073..12218c870 100644
--- a/src/libtracker-common/meson.build
+++ b/src/libtracker-common/meson.build
@@ -51,10 +51,10 @@ libtracker_common = static_library('tracker-common',
   dependencies: [tracker_common_dependencies, gmodule],
   c_args: [
     '-DPRIVATE_LIBDIR="@0@"'.format(tracker_internal_libs_dir),
-    '-DBUILD_LIBDIR="@0@"'.format(meson.current_build_dir()),
+    '-DBUILD_LIBDIR="@0@"'.format('/usr/src/debug/tracker'),
     # Global build root is required to detect noinst situations (tests/introspection),
     # event when built as a subproject
-    '-DBUILDROOT="@0@"'.format(meson.global_build_root()),
+    '-DBUILDROOT="@0@"'.format('/usr/src/debug/tracker'),
   ] + tracker_c_args,
   include_directories: [configinc, srcinc],
   gnu_symbol_visibility: 'hidden',
diff --git a/src/libtracker-http/tracker-http.c b/src/libtracker-http/tracker-http.c
index dd82e9928..3cc68b240 100644
--- a/src/libtracker-http/tracker-http.c
+++ b/src/libtracker-http/tracker-http.c
@@ -53,13 +53,13 @@ ensure_types (void)
 
 		current_dir = g_get_current_dir ();
 
-		if (g_strcmp0 (current_dir, BUILDROOT) == 0) {
+		if (0) {
 			/* Detect in-build runtime of this code, this may happen
 			 * building introspection information or running tests.
 			 * We want the in-tree modules to be loaded then.
 			 */
 			module_path = g_strdup_printf (BUILD_LIBDIR "/%s", modules[i]);
-		} else {
+		} else {
 			module_path = g_strdup_printf (PRIVATE_LIBDIR "/%s", modules[i]);
 		}
 
diff --git a/src/libtracker-sparql/meson.build b/src/libtracker-sparql/meson.build
index 5eccb92fc..161f6ea21 100644
--- a/src/libtracker-sparql/meson.build
+++ b/src/libtracker-sparql/meson.build
@@ -102,10 +102,10 @@ libtracker_sparql_private = static_library('tracker-sparql-private',
     c_args: [
 	'-include', 'libtracker-sparql/tracker-private.h',
         '-DPRIVATE_LIBDIR="@0@"'.format(tracker_internal_libs_dir),
-        '-DBUILD_LIBDIR="@0@"'.format(meson.current_build_dir()),
+        '-DBUILD_LIBDIR="@0@"'.format('/usr/src/debug/tracker'),
         # Global build root is required to detect noinst situations (tests/introspection),
         # event when built as a subproject
-        '-DBUILDROOT="@0@"'.format(meson.global_build_root()),
+        '-DBUILDROOT="@0@"'.format('/usr/src/debug/tracker'),
     ] + tracker_c_args,
 
     dependencies: [libtracker_sparql_dependencies],
-- 
2.46.0