From fd99b17a4de959ab10f85d0901605dcf74c8706f Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Tue, 4 Oct 2022 17:08:36 +0200 Subject: [PATCH] tools: make `utils.SearchFiles` deterministic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `glob.glob` on Linux returns files in the order returned by the filesystem driver, and the output from this function is stuffed by the Electron build process straight into the `config.gypi` header, causing non-reproducible builds. See this log for an example of the nondeterminism: https://rb.zq1.de/compare.factory-20220901/diffs/nodejs-electron-compare.out PR-URL: https://github.com/nodejs/node/pull/44496 Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: Richard Lau Reviewed-By: Stewart X Addison --- tools/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/utils.py b/tools/utils.py index 9d53bd56bd1036..d6dce5f7a52137 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -112,4 +112,4 @@ def SearchFiles(dir, ext): list = glob.glob(dir+ '/**/*.' + ext, recursive=True) if sys.platform == 'win32': list = [ x.replace('\\', '/')for x in list] - return list + return sorted(list)