Source: gradle-kotlin-dsl
Severity: normal
Tags: patch
User: [email protected]
Usertags: shell
X-Debbugs-Cc: [email protected]

When /bin/sh points to bash vs. dash, two classpath files get generated
different with different content.

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

  runtime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar ...
  vs.
  projects=\nruntime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar 
...

The attached patch fixes this in debian/rules by using printf instead of
echo, as echo implementations vary in the handling of "\n" in different
shells.

According to my local tests, applying this patch should make
gradle-jotlin-dsl build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining gradle-kotlin-dsl!

live well,
  vagrant
From 6d6af7fa4775f07170dfb9659c46309c288d14c8 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <[email protected]>
Date: Thu, 8 Jun 2023 15:36:41 -0700
Subject: [PATCH] debian/rules: Fix generation of classpath files to be
 independent of shell implementation.

Use printf instead of echo, as echo implementations vary in the
handling of "\n" in different shells.

https://tests.reproducible-builds.org/debian/issues/unstable/bin_sh_is_bash_issue.html
---
 debian/rules | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 312ca0b..4311749 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,7 +42,7 @@ override_dh_auto_build:
 	cp -Rp provider/src/main/kotlin/*    provider/target/classes
 	cp -Rp provider/src/main/resources/* provider/target/classes
 
-	echo 'projects=\nruntime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,kotlin-script-runtime.jar,trove4j.jar' \
+	printf 'projects=\nruntime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,kotlin-script-runtime.jar,trove4j.jar' \
 	    > provider/target/classes/gradle-kotlin-dsl-classpath.properties
 
 	jar cf provider/target/gradle-kotlin-dsl.jar -C provider/target/classes/ .
@@ -67,7 +67,7 @@ override_dh_auto_build:
 
 	cp -Rp tooling-builders/src/main/kotlin/* tooling-builders/target/classes
 
-	echo 'projects=\nruntime=gradle-kotlin-dsl.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,annotations-13.0.jar' \
+	printf 'projects=\nruntime=gradle-kotlin-dsl.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,annotations-13.0.jar' \
 	    > tooling-builders/target/classes/gradle-kotlin-dsl-tooling-builders-classpath.properties
 
 	jar cf tooling-builders/target/gradle-kotlin-dsl-tooling-builders.jar -C tooling-builders/target/classes .
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature

Reply via email to