-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Meta: Atomically download files at configure time, and validate with their SHA-256 hash #24407
Conversation
14c7458
to
889735e
Compare
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.
Eh, downloading to a temp location and then renaming would get us virtually all of the benefit without the cost.
Or maybe I'm misunderstanding how this works 🙂
This isn't always a "version file".
Download files to a temporary location, then only move the downloaded file to the real location once the download is complete. This prevents CMake from being confused about partially-downloaded files, e.g. if someone presses ctrl+c in the middle of a download. Note the GN build already behaves this way.
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.
Much nicer, thanks!
The duplication of information is a bit sad between the build systems. is there room for some kind of JSON file or other metadata that holds the info of what we need to download? Could even be run through a pre-build script to download the files all at once, if desired. {
"files": [
{
"name": "CLDR",
"version": "44.1",
"sha256": "abcdef...."
"url": "unicode.org/blah/.zip"
}
]
} |
Is that more sad than duplicating the input files? And the set of downloaded files changes less frequently than the set of source files. Or do you mostly mean the duplicated sha? (That also changes less frequently than the source files though.) If you put this into a file, then now you have to read that file when it changes, etc, and it has a taste of metametabuildsystem. |
Fixes #24401
This atomically downloads files to prevent CMake from being confused about partially-downloaded files, e.g. if someone presses ctrl+c in the middle of a download. And it adds SHA-256 verification for files that we currently have versioned downloads of.