Skip to content

fix: include platform and arch in binary cache key#10

Merged
elrrrrrrr merged 1 commit into
mainfrom
fix/cache-key-platform
Mar 24, 2026
Merged

fix: include platform and arch in binary cache key#10
elrrrrrrr merged 1 commit into
mainfrom
fix/cache-key-platform

Conversation

@elrrrrrrr
Copy link
Copy Markdown
Contributor

Summary

  • Cache key was utoo-binary-{version} which caused x86_64 binaries to be restored on aarch64 runners → Exec format error
  • Now uses utoo-binary-{version}-{platform}-{arch} to ensure each platform gets its own cached binary
  • Fix applied in both action.ts (restore) and cache-save.ts (save)

Test plan

  • Verify aarch64-unknown-linux-gnu CI job passes after merge
  • Verify x86_64 jobs still cache/restore correctly

🤖 Generated with Claude Code

Cache key was `utoo-binary-{version}` which caused x86_64 binaries
to be restored on aarch64 runners, resulting in "Exec format error".

Now uses `utoo-binary-{version}-{platform}-{arch}` to ensure each
platform gets its own cached binary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical caching bug that led to execution failures when binaries compiled for one architecture were restored on a different one. By integrating platform and architecture details into the cache key, the system now correctly isolates cached binaries, preventing cross-architecture conflicts and ensuring reliable operation across diverse environments.

Highlights

  • Cache Key Enhancement: The Utoo binary cache key was updated to incorporate platform and arch alongside the version. This change addresses an issue where x86_64 binaries were being restored on aarch64 runners, causing Exec format error, by ensuring each platform/architecture combination has a unique cache.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a bug in the binary caching by including the platform and architecture in the cache key, preventing Exec format error across different machine architectures. The fix is applied consistently for both cache restoration and saving. I've included one suggestion to refactor the cache key generation logic to improve maintainability by avoiding code duplication.

Comment thread src/action.ts
// Handle Utoo binary cache
if (utooCacheEnabled) {
const utooCacheKey = `utoo-binary-${resolvedVersion}`;
const utooCacheKey = `utoo-binary-${resolvedVersion}-${process.platform}-${process.arch}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for generating the cache key is duplicated in src/cache-save.ts on line 17. To improve maintainability and follow the DRY (Don't Repeat Yourself) principle, consider extracting this logic into a shared utility function, for example in src/utils.ts.

For example:

// in src/utils.ts
export function getUtooCacheKey(version: string): string {
  return `utoo-binary-${version}-${process.platform}-${process.arch}`;
}

This would centralize the key generation, making future updates easier and less error-prone.

@elrrrrrrr elrrrrrrr marked this pull request as ready for review March 24, 2026 14:39
@elrrrrrrr elrrrrrrr merged commit ab4a0bd into main Mar 24, 2026
16 checks passed
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.

1 participant