cache-buildkite-plugin icon indicating copy to clipboard operation
cache-buildkite-plugin copied to clipboard

OS version in cache key

Open Antsiscool opened this issue 8 months ago • 1 comments

I am using runner.os in a cache key for Ruby gems using bundler. Some of the gems have native c components that get compiled during installation.

This works fine when all the servers are running the same version of the OS. However, when upgrading to a new OS, this often causes all jobs to fail as the gems are linked against different versions of libraries.

Would it be possible to have a cache key option to invalidate the cache when running on a different version of the same OS platform

Antsiscool avatar Apr 22 '25 10:04 Antsiscool

Perhaps we should consider adding runner.os-version or runner.os-full (or similar?) Instead of standard runner.os this would hold:

  • Ubuntu-22.04
  • windows-2022
  • ...

instead of just Linux, Mac or Windows. However, this can be a little tricky and needs to be checked on each OS differently. For example, one command to get this version information on linux may not work on other linux distros. This would also increase failed build rates.

We need a function that will work on every different OS and every same OS but different Version without issues.

I've to think about this but if you have any idea right now, feel free to submit a PR.

gencer avatar Apr 23 '25 14:04 gencer