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

Better support global script cache #3880

Closed
devlead opened this issue Apr 29, 2022 · 1 comment · Fixed by #3881
Closed

Better support global script cache #3880

devlead opened this issue Apr 29, 2022 · 1 comment · Fixed by #3881
Assignees
Milestone

Comments

@devlead
Copy link
Member

devlead commented Apr 29, 2022

Many builds have the same relative file names, when global script cache is used that can create conflicts and undesired, this can be avoided by skipping the hash file and instead including the hash in the file name.

Also solves the original feedback below from @GeertvanHorrik

Thanks for the fast reply. We even templated our cake.config. Would it be possible to use > variables or how does it determine the final subfolder inside the cache.

For example (and I am happy to contribute), something like this:

  • Cache path is set to %temp%\cake-scripts-cache\
  • Subdirectory is a hash of all the script files to be compiled, so ends up in

%temp%\cake-scripts-cache[some-unique-hash]

I see 2 things that would be needed here:

  1. a lock file, so if 2 builds are running at the same time, cake knows not to use the > directory (yet). If the lock file is older than 5 minutes, assume it's broken and restart
  2. a hash calculation (fastest possible, but it should be fairly fast since I don't expect more than 50 files to be used for a script)

Originally posted by @GeertvanHorrik in #2650 (comment)

@devlead devlead self-assigned this Apr 29, 2022
@devlead devlead added this to the v2.3.0 milestone Apr 29, 2022
devlead added a commit to devlead/cake that referenced this issue Apr 29, 2022
* Include script host in filename
* Move hash from file to filename
* fixes cake-build#3879
* fixes cake-build#3880
devlead added a commit to devlead/cake that referenced this issue Apr 29, 2022
* Include script host in the cache filename
* Move hash from file to the cache filename
* fixes cake-build#3879
* fixes cake-build#3880
devlead added a commit to devlead/cake that referenced this issue Apr 29, 2022
* Include script host in the cache filename
* Move hash from file to the cache filename
* fixes cake-build#3879
* fixes cake-build#3880
devlead added a commit to devlead/cake that referenced this issue Apr 29, 2022
* Include script host in the cache filename
* Move hash from file to the cache filename
* fixes cake-build#3879
* fixes cake-build#3880
devlead added a commit that referenced this issue Apr 29, 2022
GH3879/3880: Scope cache per script host
@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.3.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants