Repository navigation
Conversation
fs::read_dir returns entries in an order that depends on the file system (on ext4 with dir_index, a per-volume filename hash), so the objects in the built archive, and the layout of binaries linking it, differ from one machine to another. Sorting the files makes the build reproducible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GkmLQ5nvNrfRpnUjryR3hR
Member
|
Thanks for the PR, but I don't accept commits authored by LLM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_files_by_extpasses Lua's.cfiles toccinfs::read_dirorder. That order depends on the file system: on ext4 withdir_indexit follows a per-volume filename hash, so two machines (or two CI runners) build the same objects in a different order. The archive's member order changes, and so does the layout of any binary that links it (section offsets, jump tables, the order of dynamic imports). Byte-for-byte reproducible builds of crates usinglua-srcthen fail.This sorts the files by path before adding them. Flags and defines are unchanged, so the compiled code is the same, only in a fixed order.
Found while making a downstream project's Linux release builds reproducible: two rebuilds of the same commit differed only in where Lua's objects landed. With the files sorted,
ar t liblua5.4.alistslapi.o … lzio.oon every machine.Tested:
testcratewith each oflua51,lua52,lua53,lua54,lua55.