As mentioned in comment:20:ticket:28238 we have files that are not built reproducibly with the new mingw-w64-clang toolchain. It affects not all binaries, though, only firefox.exe, libGLESv2.dll, mozglue.dll, plugin-container.exe, plugin-hang-ui.exe, and xul.dll.
This is still an issue after switching to clang, lld etc. 8.0.0.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
After building the current nightly for windows x86_64 twice on the same machine, I am getting the same bundles. Is it an issue that mostly happen when building on different machines?
After building the current nightly for windows x86_64 twice on the same machine, I am getting the same bundles. Is it an issue that mostly happen when building on different machines?
Yeah, that's part of the mystery: it only happens on different machines it seems.
The libc++.a files have the same content fwiw (even though the archive is not assembled reproducibly).
That's probably the issue here as the linker is taking input from libc++.a as it appears in the .a file (thanks Martin).
Now, we do two things with libc++.a: 1) we build the archive and 2) we have the merge_libs() function. I guess as a next step we try to pin down where exactly the problem occurs (maybe it's just 2) that is problematic here).
Responsible for that is CMake which saves the command to use in a link.txt file
cd /var/tmp/build/libcxx/build/lib && /var/tmp/dist/cmake/bin/cmake -E cmake_link_script CMakeFiles/cxx_static.dir/link.txt --verbose=1
I am not sure yet where sorting that part differently got solved but updating CMake to the latest stable version, 3.15.3, (we are currently using 3.4.3) seems to solve that part of the puzzle. However, other object files are still included non-deterministically after that part. I am not sure yet where they are coming from...
However, other object files are still included non-deterministically after that part. I am not sure yet where they are coming from...
Okay, I think I am at the bottom of that rabbit hole. Thre reason for that issue is that libc++.a is getting merged with the contents of libc++abi.a (which, by the way, itself is reproducible at least after switching to CMake's 3.5.13). Now, that merging gets done in libc++'s merge_archives.py (https://github.com/llvm/llvm-project/blob/release/8.x/libcxx/utils/merge_archives.py). The problem here is:
"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."
gets us finally a reproducible libc++.a and a reproducible 64-bit .exe. I am currently testing the 32-bit version as well and will prepare a proper patch for review tomorrow.
I don't know if ours is reproducible. But Martin can probably upstream that clang change fairly easily. And I should - if not copy your approach - add a comment about it in our build.
No, that's a different piece. It merges libc++ with libunwind which is actually okay. The problematic one, which you hit as well, is within the libc++ build step where libc++ and libc++abi are getting merged into libc++.
I don't know if ours is reproducible. But Martin can probably upstream that clang change fairly easily. And I should - if not copy your approach - add a comment about it in our build.
Upstream changed meanwhile, so the patch in question is only usable for clang 8-based toolchains. However, it seems the new changes still have the same issue potentially. I'll get back to Martin with that once this patch lands and we are good on our side.
Heh. I just realized that commit fc1ec361d39c403915c3c3c2c74468451fade20f in the libcxx repo wants to address the same problem. (But that did not make it into 8.0) I have not tested it whether it really solves the problem and it is larger then just sorting as we do right now. So, we should be good for now with what we have.