utils/genrandconfig: only do reproducible builds with diffoscope
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 4 Aug 2019 09:13:19 +0000 (11:13 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 7 Aug 2019 14:34:44 +0000 (16:34 +0200)
After a few weeks of running reproducible builds in the autobuilders,
we found out that such builds without a diffoscope analysis are pretty
useless: the cmp on the tarballs doesn't help us fix the
reproducibility issue.

So, let's only do reproducible builds when diffoscope is available.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Atharva Lele <itsatharva@gmail.com>
Acked-by: Atharva Lele <itsatharva@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/genrandconfig

index 859996cfd5bf12f68b69e5a6cf28fbfe511d5ca3..d6b7fd56b7318f27f148b0f753c9960ce5485222 100755 (executable)
@@ -49,7 +49,7 @@ else:
 
 class SystemInfo:
     DEFAULT_NEEDED_PROGS = ["make", "git", "gcc", "timeout"]
-    DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar"]
+    DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar", "diffoscope"]
 
     def __init__(self):
         self.needed_progs = list(self.__class__.DEFAULT_NEEDED_PROGS)
@@ -369,7 +369,7 @@ def gen_config(args):
 
     # Randomly enable BR2_REPRODUCIBLE 10% of times
     # also enable tar filesystem images for testing
-    if randint(0, 10) == 0:
+    if sysinfo.has("diffoscope") and randint(0, 10) == 0:
         configlines.append("BR2_REPRODUCIBLE=y\n")
         configlines.append("BR2_TARGET_ROOTFS_TAR=y\n")