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

Cargo mtime issue preventing effective caching on git dependencies #155

Open
0o-de-lally opened this issue Aug 2, 2023 · 0 comments
Open

Comments

@0o-de-lally
Copy link

0o-de-lally commented Aug 2, 2023

Hi all I work on a few repos with hundreds of external dependencies at the root level. Many of those are specified as git paths. @Swatinem pointed out this issue to me related to mtimes.

TL;DR: The cargo caching of GitHub dependencies has a known issue with being cached by timestamp, and not hash. rust-lang/cargo#6529

It's not as simple as saving ~/.cargo/git/checkouts since the timestamp gets updated. See this message for what seems to be happening: the cargo git dependencies appear to be more recent than the checked out code.
rust-lang/cargo#6529 (comment)

The solutions are more convoluted. A number of people have workarounds:
rust-lang/cargo#6529 (comment)

Elsewhere people have tried to reset mtime in the working tree (not deps) with this https://github.com/chetan/git-restore-mtime-action. Though this would set the mtime to the commit date, which if my understanding is correct, this could make matters worse. Though it did produce a slightly shorter compile time, shaving one minute off: without vs with. But a properly cached git dependencies should bring compile time to zero.
paradigmxyz/reth@a22c274

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

No branches or pull requests

1 participant