summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2025-11-20 13:14:04 +0800
committerKhem Raj <raj.khem@gmail.com>2025-11-19 21:20:52 -0800
commit0e583d2830ff8a8340b7bd0050ced614fbb91e3f (patch)
tree568fb637fba97bedfe8787a4ff703491d699bccb
parent204b8f1a3435c3476b9132247ac423354676fb7e (diff)
downloadmeta-openembedded-0e583d2830ff8a8340b7bd0050ced614fbb91e3f.tar.gz
thrift: support reproducible builds
In order to support reproducible builds [1], while using bison to generate source code, add COMPILE_FLAGS --file-prefix-map [2] to remove build path prefix and source path prefix in the generated header file. [1] https://reproducible-builds.org/ [2] https://cgit.git.savannah.gnu.org/cgit/bison.git/commit/?id=dd878d18519689c7bbcd72de4c9f9e53085a3cbf Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/conf/layer.conf1
-rw-r--r--meta-oe/recipes-connectivity/thrift/thrift/0001-support-reproducible-builds.patch49
-rw-r--r--meta-oe/recipes-connectivity/thrift/thrift_0.22.0.bb1
3 files changed, 50 insertions, 1 deletions
diff --git a/meta-oe/conf/layer.conf b/meta-oe/conf/layer.conf
index 1f55f5bee1..186ff9a488 100644
--- a/meta-oe/conf/layer.conf
+++ b/meta-oe/conf/layer.conf
@@ -200,7 +200,6 @@ OEQA_REPRODUCIBLE_EXCLUDED_PACKAGES += " \
200 libsource-highlight-dbg \ 200 libsource-highlight-dbg \
201 libsource-highlight-dev \ 201 libsource-highlight-dev \
202 libsource-highlight-src \ 202 libsource-highlight-src \
203 libthrift-c-glib-zlib-src \
204 libvncserver-dev \ 203 libvncserver-dev \
205 libwebsockets-testapps \ 204 libwebsockets-testapps \
206 libwmf \ 205 libwmf \
diff --git a/meta-oe/recipes-connectivity/thrift/thrift/0001-support-reproducible-builds.patch b/meta-oe/recipes-connectivity/thrift/thrift/0001-support-reproducible-builds.patch
new file mode 100644
index 0000000000..7fad4ddaa6
--- /dev/null
+++ b/meta-oe/recipes-connectivity/thrift/thrift/0001-support-reproducible-builds.patch
@@ -0,0 +1,49 @@
1From d4c19c3c88200c49d48c9d47971977627f98f51b Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 20 Nov 2025 11:43:45 +0800
4Subject: [PATCH] support reproducible builds
5
6In order to support reproducible builds [1], while using bison to generate
7source code, add COMPILE_FLAGS --file-prefix-map [2] to remove build path
8prefix and source path prefix in the generated header file.
9
10[1] https://reproducible-builds.org/
11[2] https://cgit.git.savannah.gnu.org/cgit/bison.git/commit/?id=dd878d18519689c7bbcd72de4c9f9e53085a3cbf
12
13Upstream-Status: Submitted [https://github.com/apache/thrift/pull/3246]
14
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
16---
17 compiler/cpp/CMakeLists.txt | 2 +-
18 compiler/cpp/tests/CMakeLists.txt | 2 +-
19 2 files changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
22index 4c1c2c5..a1a8fcb 100644
23--- a/compiler/cpp/CMakeLists.txt
24+++ b/compiler/cpp/CMakeLists.txt
25@@ -30,7 +30,7 @@ find_package(BISON REQUIRED)
26 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
27
28 # Create flex and bison files and build the lib parse static library
29-BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc)
30+BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc COMPILE_FLAGS "--file-prefix-map=${CMAKE_BINARY_DIR}='' --file-prefix-map=${CMAKE_SOURCE_DIR}=''")
31 FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc)
32 ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
33
34diff --git a/compiler/cpp/tests/CMakeLists.txt b/compiler/cpp/tests/CMakeLists.txt
35index 6a078ec..39f5bb2 100644
36--- a/compiler/cpp/tests/CMakeLists.txt
37+++ b/compiler/cpp/tests/CMakeLists.txt
38@@ -45,7 +45,7 @@ find_package(BISON REQUIRED)
39 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
40
41 # Create flex and bison files and build the lib parse static library
42-BISON_TARGET(thrifty ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc)
43+BISON_TARGET(thrifty ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc COMPILE_FLAGS "--file-prefix-map=${CMAKE_BINARY_DIR}='' --file-prefix-map=${CMAKE_SOURCE_DIR}=''")
44 FLEX_TARGET(thriftl ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc)
45 ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
46
47--
482.34.1
49
diff --git a/meta-oe/recipes-connectivity/thrift/thrift_0.22.0.bb b/meta-oe/recipes-connectivity/thrift/thrift_0.22.0.bb
index 9c50317eff..8ca1d0085e 100644
--- a/meta-oe/recipes-connectivity/thrift/thrift_0.22.0.bb
+++ b/meta-oe/recipes-connectivity/thrift/thrift_0.22.0.bb
@@ -10,6 +10,7 @@ DEPENDS = "thrift-native boost flex-native bison-native openssl zlib"
10 10
11SRC_URI = "https://downloads.apache.org/${BPN}/${PV}/${BP}.tar.gz \ 11SRC_URI = "https://downloads.apache.org/${BPN}/${PV}/${BP}.tar.gz \
12 file://0001-DefineInstallationPaths.cmake-Define-libdir-in-terms.patch \ 12 file://0001-DefineInstallationPaths.cmake-Define-libdir-in-terms.patch \
13 file://0001-support-reproducible-builds.patch \
13 " 14 "
14SRC_URI[sha256sum] = "794a0e455787960d9f27ab92c38e34da27e8deeda7a5db0e59dc64a00df8a1e5" 15SRC_URI[sha256sum] = "794a0e455787960d9f27ab92c38e34da27e8deeda7a5db0e59dc64a00df8a1e5"
15 16