Source: vart
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The build time is embedded in various binaries:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/vart.html

  /usr/lib/x86_64-linux-gnu/libvart-buffer-object.so.2.5.0

  Xilinx·vart-buffer-object·Version:·2.5.0-··2023-11-14-01:55:35·
  vs.
  Xilinx·vart-buffer-object·Version:·2.5.0-··2022-10-12-21:36:55·

The attached patch to the two upstream cmake files fixes this by using
the TIMESTAMP function of cmake rather than calling date directly.

According to my local tests, with this patch applied, vart should build
reproducibly on tests.reproducible-builds.org once it migrates to
bookworm/testing! Differing build paths trigger additional issues, which
are only tested in unstable and experimental.

Thanks for maintaining vart!

live well,
  vagrant
From 1c216f4f812bbbaa6af1b624191fa2c6813c72df Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Fri, 14 Oct 2022 19:31:36 +0000
Subject: [PATCH 1/2] Use cmake TIMESTAMP feature instead of calling "date"
 directly.

The cmake TIMESTAMP function respects SOURCE_DATE_EPOCH, allowing
reproducible timestamps when specified.
---
 cmake/VitisVersion.cmake      | 6 ++----
 trace/vaitrace/CMakeLists.txt | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/cmake/VitisVersion.cmake b/cmake/VitisVersion.cmake
index 9801037..4969018 100644
--- a/cmake/VitisVersion.cmake
+++ b/cmake/VitisVersion.cmake
@@ -14,10 +14,8 @@
 # limitations under the License.
 #
 #
-execute_process(
-  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-  COMMAND date +%F-%T
-  OUTPUT_VARIABLE BUILD_DATE)
+
+string(TIMESTAMP BUILD_DATE "+%F-%T" UTC)
 string(STRIP "${BUILD_DATE}" BUILD_DATE)
 if ("${GIT_VERSION}" STREQUAL "")
   execute_process(
diff --git a/trace/vaitrace/CMakeLists.txt b/trace/vaitrace/CMakeLists.txt
index 57b7482..de930d7 100644
--- a/trace/vaitrace/CMakeLists.txt
+++ b/trace/vaitrace/CMakeLists.txt
@@ -19,7 +19,7 @@ project(vaitrace VERSION 2.5.20221)
 set(VAITRACE_DEST_PATH bin/xlnx/${PROJECT_NAME})
 
 # Generate Version Flags
-execute_process(COMMAND date +%F-%T OUTPUT_VARIABLE VAITRACE_BUILD_DATE)
+string(TIMESTAMP VAITRACE_BUILD_DATE "+%F-%T" UTC)
 string(STRIP "${VAITRACE_BUILD_DATE}" VAITRACE_BUILD_DATE)
 execute_process(
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-- 
2.37.2

Attachment: signature.asc
Description: PGP signature

Reply via email to