Skip to content

Conversation

@GeertvanHorrik
Copy link
Contributor

@GeertvanHorrik GeertvanHorrik commented May 15, 2025

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
Contributor Author

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

Thanks!

@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
@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
Copy link
Member

@devlead devlead left a comment

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
Copy link
Member

devlead commented May 25, 2025

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

@GeertvanHorrik
Copy link
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
Copy link
Member

devlead commented May 25, 2025

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