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

Improve build cache expiration logic #267

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

joshwlewis
Copy link
Member

The build cache (which includes intermediate compilation artifacts) should be invalidated when the target arch, distro, or distro version changes. These assets are unlikely to be valid after a major change to the OS, especially if any C bindings are involved. We were already supporting expiration based on architecture changes, but not distro details.

Conversely, the build cache artifacts may be valid after a minor go version change (patch level change in semver parlance). We were previously expiring these assets on any go version change, which meant frequent, perhaps unnecessary invalidation.

This PR introduces build cache invalidation based on distro changes, and prevents build cache invalidation for minor go version changes.

Signed-off-by: Josh W Lewis <josh.lewis@salesforce.com>
@joshwlewis joshwlewis marked this pull request as ready for review May 16, 2024 23:36
@joshwlewis joshwlewis requested a review from a team as a code owner May 16, 2024 23:36
@joshwlewis joshwlewis merged commit db17d88 into main May 21, 2024
7 checks passed
@joshwlewis joshwlewis deleted the jwl/expire-cache-arch branch May 21, 2024 19:27
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Jun 4, 2024
## heroku/go

### Added

- Added go1.21.11 (linux-amd64), go1.21.11 (linux-arm64).
- Added go1.22.4 (linux-arm64), go1.22.4 (linux-amd64).

### Changed

- The build cache is now invalidated when the target distribution changes. ([#267](heroku/buildpacks-go#267))
- The build cache is no longer invalidated on minor go version changes. ([#267](heroku/buildpacks-go#267))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
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.

None yet

2 participants