Skip to content

GH4471: Improve script cache hash generation algorithm#4472

Merged
devlead merged 1 commit into
cake-build:developfrom
GeertvanHorrik:pr/script-cache-improvements
May 25, 2025
Merged

GH4471: Improve script cache hash generation algorithm#4472
devlead merged 1 commit into
cake-build:developfrom
GeertvanHorrik:pr/script-cache-improvements

Conversation

@GeertvanHorrik

@GeertvanHorrik GeertvanHorrik commented May 15, 2025

Copy link
Copy Markdown
Contributor

This fixes an issue we are seeing when running on a build agent that uses random folder names for each build. This PR allows cache re-usage by replacing the working directory inside the script lines before generating the hash.

Also added unit tests for:

  • hash inequality in the same directory
  • hash equality in different directories

For reference: #4471

@GeertvanHorrik GeertvanHorrik changed the title (GH-4471) Improve script cache hash generation algorithm Improve script cache hash generation algorithm May 15, 2025
@GeertvanHorrik

Copy link
Copy Markdown
Contributor Author

@devlead I know you initially worked on this feature, would you care doing a review?

Thanks!

Comment thread src/Cake/Infrastructure/Scripting/RoslynScriptSession.cs Outdated
@GeertvanHorrik GeertvanHorrik requested a review from gep13 May 20, 2025 14:05
@devlead devlead changed the title Improve script cache hash generation algorithm GH4471: Improve script cache hash generation algorithm May 24, 2025
@devlead devlead linked an issue May 24, 2025 that may be closed by this pull request
2 tasks
Comment thread src/Cake/Infrastructure/Scripting/RoslynScriptSession.cs
@devlead devlead force-pushed the pr/script-cache-improvements branch from 5098ca6 to 6c6609b Compare May 25, 2025 09:15
@devlead devlead enabled auto-merge May 25, 2025 09:28

@devlead devlead left a comment

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.

LGTM 👍

@devlead devlead merged commit f2a316d into cake-build:develop May 25, 2025
14 of 16 checks passed
@devlead

devlead commented May 25, 2025

Copy link
Copy Markdown
Member

@GeertvanHorrik your changes have been merged, thanks for your contribution 👍

@GeertvanHorrik

Copy link
Copy Markdown
Contributor Author

Thank you very much! Is there an estimate on when a new version of cake will be released (not a hard deadline, just want to have an idea when we might start using this ☺️)

@devlead

devlead commented May 25, 2025

Copy link
Copy Markdown
Member

No firm dates yet, there are a couple of things we want to sort out first, after that find some time to do some testing and the release.

There's a preview package available from our preview feed you could try out already today
https://dev.azure.com/cake-build/Cake/_artifacts/feed/cake/NuGet/Cake.Tool/overview/5.1.0-alpha0060

<add key="cake" value="https://pkgs.dev.azure.com/cake-build/Cake/_packaging/cake/nuget/v3/index.json" />

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

Successfully merging this pull request may close these issues.

Improve script caching behavior

3 participants