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

When /bin/sh points to bash (instead of dash), the behavior of "echo"
differs in the rendering of "\n":

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

  /usr/bin/glslc

  shaderc·2023.2-1\nspirv-tools·2023.1-2
  vs.
  shaderc·2023.2-1       
  spirv-tools·2023.1-2

The attached patch to debian/rules fixes this by switching to use
printf, which appears to behave consistently regardless of the shell (at
least with my quick testing).

Thanks for maintaining shaderc!

live well,
  vagrant
From 2cc141000791790054677b339e675c2cef150ac0 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Sun, 30 Apr 2023 13:51:49 -0700
Subject: [PATCH] debian/rules: Use "printf" instead of "echo" for reproducible
 builds.

The echo implementations of bash and dash may differ, using printf
works around this.
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 4424963..5051e82 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,7 +16,7 @@ override_dh_auto_configure:
 		-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
 
 override_dh_auto_build:
-	echo "\"shaderc $(DEB_VERSION)\\\n\"" > obj-${DEB_HOST_GNU_TYPE}/build-version.inc
+	printf "\"shaderc $(DEB_VERSION)\\\n\"" > obj-${DEB_HOST_GNU_TYPE}/build-version.inc
 	dpkg-query -f '"spirv-tools $${Version}\\n"\n' -W spirv-tools >> obj-${DEB_HOST_GNU_TYPE}/build-version.inc
 	dpkg-query -f '"glslang $${Version}\\n"' -W glslang-dev >> obj-${DEB_HOST_GNU_TYPE}/build-version.inc
 	dh_auto_build
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature

Reply via email to