-
Notifications
You must be signed in to change notification settings - Fork 180
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
Portable cache files #914
Comments
Regarding the solution with |
@mdjermanovic - thanks. relative pathing should work and I will add in more tests around it but you can use it no problem and it should just work. Is there a scenario where the new version doesnt? |
@mdjermanovic - I added more tests around this but you should be ok using relative or absolute paths. I am going to make it even easier in the next big update that should be out this week where you will not be required to set the current working directory or the property using relative paths. |
👋 I'm also interested in this, I've tried to hack my way around the absolute path requirement for the cache in ESLint v8 with little luck. If I manually update the path to resolve to the correct path in CI, I still get cache misses which I think are related to the use of mtime by this library (https://github.com/jaredwray/cacheable/blob/main/packages/file-entry-cache/src/index.ts#L299-L301). It looks like that reflects git clone time and not file touch time, https://stackoverflow.com/questions/21735435/git-clone-changes-file-modification-time. Would that also make sense to disable for the portable cache files? |
Is your feature request related to a problem? Please describe.
We would like to make ESLint cache files portable.
Use case 1: The cache file is created/updated in CI. The goal is to make the cache file reusable for CI runs, but different CI runs may have different directory structures.
Use case 2: The cache file is checked in the source control and shared among developers who can update it and commit the changes. Developers typically have different directory structures on local machines.
By "directory structures" I mean the location where the project is stored locally. For example, on one machine it can be
/projects/my-app
, on another one/work/my-app
,/projects/work-my-app
orC:\projects\my-app
.References:
Describe the solution you'd like
I think the best solution would be to store file paths relative to the location of the cache file. I see the latest file-entry-cache v10.0.4 can store relative paths in the cache file, but not sure if and how it would be possible to make them relative to the location of the cache file.
The text was updated successfully, but these errors were encountered: