From f3125823268c414e7538d440cffe3c8a95294cad Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 28 Aug 2018 20:38:47 +0200 Subject: [PATCH 1/2] BuildSystem: Fix font list We want to add the individual strings to the list and not add a list object to the list. Without this patch, sorting failed because "str < list" is not a valid operation in python. --- editor/SCsub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/SCsub b/editor/SCsub index 4fa287c33b2..75dc188b860 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -76,7 +76,7 @@ if env['tools']: # Fonts flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") - flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf")) + flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf")) env.Depends('#editor/builtin_fonts.gen.h', flist) env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, run_in_subprocess(editor_builders.make_fonts_header)) From 83b856c0465c40ecd9768508f31d3e337e1a64e1 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 28 Aug 2018 20:40:51 +0200 Subject: [PATCH 2/2] BuildSystem: Sort input file lists so that godot package builds reproducibly in spite of indeterministic filesystem readdir order and http://bugs.python.org/issue30461 See https://reproducible-builds.org/ for why this is good. Sort font input file list, so that builtin_fonts.gen.h is created in a reproducible way Sort list of platforms, so that editor/register_exporters.gen.cpp is created in a reproducible way Sort list of source files, so that .a files and resulting godot binaries are created in a reproducible way --- SConstruct | 2 +- editor/SCsub | 1 + methods.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 2cc486fd1b3..3bbe97bfe71 100644 --- a/SConstruct +++ b/SConstruct @@ -23,7 +23,7 @@ platform_exporters = [] platform_apis = [] global_defaults = [] -for x in glob.glob("platform/*"): +for x in sorted(glob.glob("platform/*")): if (not os.path.isdir(x) or not os.path.exists(x + "/detect.py")): continue tmppath = "./" + x diff --git a/editor/SCsub b/editor/SCsub index 75dc188b860..d9bdf42d6fc 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -77,6 +77,7 @@ if env['tools']: # Fonts flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf")) + flist.sort() env.Depends('#editor/builtin_fonts.gen.h', flist) env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, run_in_subprocess(editor_builders.make_fonts_header)) diff --git a/methods.py b/methods.py index 7aa06f04b8b..1bc10954baf 100644 --- a/methods.py +++ b/methods.py @@ -13,7 +13,7 @@ def add_source_files(self, sources, filetype, lib_env=None, shared=False): if isbasestring(filetype): dir_path = self.Dir('.').abspath - filetype = glob.glob(dir_path + "/" + filetype) + filetype = sorted(glob.glob(dir_path + "/" + filetype)) for path in filetype: sources.append(self.Object(path))