Skip to content

Fetch shared archive sources without checkums#6627

Merged
kit-ty-kate merged 3 commits intoocaml:masterfrom
psafont:dev/psafont/cachecache
Aug 22, 2025
Merged

Fetch shared archive sources without checkums#6627
kit-ty-kate merged 3 commits intoocaml:masterfrom
psafont:dev/psafont/cachecache

Conversation

@psafont
Copy link
Copy Markdown
Contributor

@psafont psafont commented Aug 5, 2025

These are not cached between runs, but they can be downloaded only once per run instead of once per package.

Closes #5638

I'm drafting this because I want to run the CI: some tests fails in strange ways and don't know whether this change is the cause or my dev environment

Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

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

That looks fine at a glance, but i'm not that familiar yet with the code so i'll wait for @rjbou to make her assessment.

We'll need to add new reftests showing the new behaviour at least before we're able to merge this. I'll do that later whenever i have some time (unless you want to do it)

(match url.OpamUrl.backend, checksums with
| (`http | `rsync ) , _::_
(match url.OpamUrl.backend with
| (`http | `rsync )
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if this is the only thing needed for this to work then we could even just allow it for every backends not just http/rsync.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shared fetch current implementation is only working for archives. Git sharing is done via the git cache.

@kit-ty-kate kit-ty-kate requested a review from rjbou August 5, 2025 13:27
@psafont
Copy link
Copy Markdown
Contributor Author

psafont commented Aug 5, 2025

The tests issues did not happen on these runs, glad to see that

@psafont psafont marked this pull request as ready for review August 8, 2025 13:21
@lindig
Copy link
Copy Markdown

lindig commented Aug 8, 2025

What is the implication that no checksum is required? Some context in the commit message would help me what changes and why this leads to fewer downloads.

@psafont psafont force-pushed the dev/psafont/cachecache branch from d5cbe36 to fd48407 Compare August 8, 2025 15:45
@lindig
Copy link
Copy Markdown

lindig commented Aug 11, 2025

Small typo in the the commit message ("time"). A more descriptive title could be: "Download and cache archives w/o checksum per run"

@psafont psafont force-pushed the dev/psafont/cachecache branch 2 times, most recently from 4cfaec3 to 2bb5834 Compare August 11, 2025 15:52
@lindig
Copy link
Copy Markdown

lindig commented Aug 12, 2025

It's good for the environment ♻️, too - so would like to see this reviewed and merged. @rjbou

@lindig
Copy link
Copy Markdown

lindig commented Aug 18, 2025

@kit-ty-kate do you happen to know the maintainers and could help us to get this reviewed? If there is a reason to not merge this we can address it.

@kit-ty-kate
Copy link
Copy Markdown
Member

kit-ty-kate commented Aug 18, 2025

@lindig I'm waiting on @rjbou who's currently on vacation (it is August after all). I don't personally see a reason to speedup the merge of this since the opam 2.5 freeze is planned for October anyway so we have plenty of time to review this.

Is there a specific reason why you want to have this merged in master before the first 2.5 alpha release?

Copy link
Copy Markdown
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, lgtm!
I've added some test to follow this.

What is the implication that no checksum is required? Some context in the commit message would help me what changes and why this leads to fewer downloads.

I think the original idea was to have the checksums to check against in the first draft, but in the end the check of all checksums is done in another part of the code. I don't remember well.

(match url.OpamUrl.backend, checksums with
| (`http | `rsync ) , _::_
(match url.OpamUrl.backend with
| (`http | `rsync )
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shared fetch current implementation is only working for archives. Git sharing is done via the git cache.

@rjbou rjbou requested a review from kit-ty-kate August 22, 2025 14:40
Without this change, sources that more than one pacakge share, but don't have
any specified checksum are not cached and hence downloaded once per package.
These can be downloaded only once per run instead of once per package,
this change enabled the per-run cache to make this happen.

For project like xapi, it means downloading a single tarball for 59
packages that are present in a single repository, every time it needs to
be built, saving time.

Closes ocaml#5638
@rjbou rjbou force-pushed the dev/psafont/cachecache branch from 2bb5834 to b08f15b Compare August 22, 2025 15:21
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

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

lgtm. I'll amend the last commit and merge before tomorrow.

@kit-ty-kate kit-ty-kate force-pushed the dev/psafont/cachecache branch from 12dad48 to 9e19aad Compare August 22, 2025 16:09
@kit-ty-kate
Copy link
Copy Markdown
Member

Thanks a lot!

@kit-ty-kate kit-ty-kate merged commit d3982d9 into ocaml:master Aug 22, 2025
44 checks passed
@psafont psafont deleted the dev/psafont/cachecache branch August 23, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared archive sources are not cached when checksum is missing

4 participants