New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: make utils.SearchFiles deterministic #44496
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nodejs/build
@brjsp Would you mind force-pushing the same commit with an amended commit message that adheres to the commit message guidelines? |
`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
@tniessen done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the function used guaranteed to be deterministic or can it be influenced by the locale setting on the machine? Either way, this will at least allow a build environment with a documented, fixed, locale to produce deterministic output, so I'm happy to approve, although there could be a small performance overhead by doing this frequently on larger directories.
Landed in e2ca29f |
@sxa the default string comparator in Python sorts by codepoint value, ignoring any locale settings. |
`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: #44496 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Stewart X Addison <sxa@redhat.com>
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