Commit a7a90d35 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 31538: Make Windows builds reproducible again

Updating CMake to the latest stable version as done in the previous
commit solves the reproducibility issue only partly. We need to patch
the code that merges libc++abi.a into libc++.a to get the order in the
merged archive deterministic. The code doing the merging is:

`files = glob.glob(os.path.join(temp_directory_root, '*.o*'))`

Regarding `glob` there is following in the Python docs:

"The glob module finds all the pathnames matching a specified pattern
 according to the rules used by the Unix shell, although results are
 returned in *arbitrary* order." (emphasis mine)

(https://docs.python.org/2/library/glob.html)
parent cd111df4
...@@ -173,6 +173,7 @@ make -j[% c("buildconf/num_procs") %] VERBOSE=1 ...@@ -173,6 +173,7 @@ make -j[% c("buildconf/num_procs") %] VERBOSE=1
# libcxx # libcxx
cd $builddir/libcxx cd $builddir/libcxx
patch -p1 < $rootdir/sort.patch
mkdir build && cd build mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$distdir/[% c("arch") %]-w64-mingw32 \ -DCMAKE_INSTALL_PREFIX=$distdir/[% c("arch") %]-w64-mingw32 \
......
...@@ -36,3 +36,4 @@ input_files: ...@@ -36,3 +36,4 @@ input_files:
- project: llvm-mingw - project: llvm-mingw
name: llvm-mingw name: llvm-mingw
- filename: mingw-winrt.patch - filename: mingw-winrt.patch
- filename: sort.patch
From 9eeb3b9ea13b25591c9081a5f05a1904d367d523 Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Wed, 11 Sep 2019 13:25:54 +0000
Subject: [PATCH] sorted
diff --git a/utils/merge_archives.py b/utils/merge_archives.py
index 58d92f0e2..597ca2471 100755
--- a/utils/merge_archives.py
+++ b/utils/merge_archives.py
@@ -124,7 +124,7 @@ def main():
execute_command_verbose([ar_exe, 'x', arc], cwd=temp_directory_root,
verbose=args.verbose)
- files = glob.glob(os.path.join(temp_directory_root, '*.o*'))
+ files = sorted(glob.glob(os.path.join(temp_directory_root, '*.o*')))
if not files:
print_and_exit('Failed to glob for %s' % temp_directory_root)
cmd = [ar_exe, 'qcs', args.output] + files
--
2.23.0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment