Skip to content
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

Merged
merged 8 commits into from
May 24, 2024

Conversation

trflynn89
Copy link
Member

@trflynn89 trflynn89 commented May 21, 2024

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.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 21, 2024
@trflynn89 trflynn89 force-pushed the cache_sha256 branch 3 times, most recently from 14c7458 to 889735e Compare May 22, 2024 19:14
Copy link
Contributor

@nico nico left a 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 🙂

Meta/CMake/utils.cmake Outdated Show resolved Hide resolved
@trflynn89 trflynn89 changed the title Meta: Validate (most) downloaded files with their SHA-256 hash Meta: Atomically download files at configure time, and validate with their SHA-256 hash May 23, 2024
Copy link
Contributor

@nico nico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer, thanks!

@trflynn89 trflynn89 merged commit 398c99e into SerenityOS:master May 24, 2024
15 checks passed
@trflynn89 trflynn89 deleted the cache_sha256 branch May 24, 2024 12:47
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 24, 2024
@ADKaster
Copy link
Member

ADKaster commented May 24, 2024

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"
            
        }
    ]
}

@nico
Copy link
Contributor

nico commented May 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnicodeData.txt Missing from Archive
3 participants