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

use checksum instead of mtime for caching to enable CI caching #11319

Closed
ashanbrown opened this issue Jan 28, 2019 · 5 comments
Closed

use checksum instead of mtime for caching to enable CI caching #11319

ashanbrown opened this issue Jan 28, 2019 · 5 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@ashanbrown
Copy link

ashanbrown commented Jan 28, 2019

The version of ESLint you are using.
Latest.

The problem you want to solve.
I want to be able to restore an eslint cache file from a cache on CI and speed up my build.

Your take on the correct solution to problem.
By storing the checksum of a file instead of the mtime in the cache file, I can restore the eslint cache file from a cache in CI and use it shave about 30 seconds off my build time in a repo I'm currently working with. My understanding is that mtime is not set to anything meaningful during a git checkout and that the processing effort required to restore mtime to the git modification time would defeat much if not all of the value of a cached eslint cache file. This could be an optional step, where we continue to allow mtime for faster local caching but have an option to store a chksum for use with CI (and let that chksum take precedence over mtime).

Are you willing to submit a pull request to implement this change?
If I have to, I guess. ;) Sure, why not.

@ashanbrown ashanbrown added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Jan 28, 2019
@nzakas
Copy link
Member

nzakas commented Jan 28, 2019

@aladdin-add it looks like you're saying that the new version of file-entry-cache already uses a checksum?

@nzakas nzakas added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jan 28, 2019
@aladdin-add
Copy link
Member

aladdin-add commented Jan 28, 2019

yes, file-entry-cache>=3.0.0 has made the change.

file-entry-cache@5.0.1 reverted the change, and made it as optional.

@ashanbrown
Copy link
Author

Thought I'd share my workaround for this, which is a script that sets mtime to the md5 chksum:

find -name \*.js | parallel 'touch {} -d "$(date -d \@$((0x$(md5sum {} | cut -b 1-7))))"'

montmanu added a commit to montmanu/eslint that referenced this issue Mar 7, 2019
@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Mar 11, 2019
@eslint-deprecated
Copy link

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 8, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

3 participants