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

Automatically append the OS architecture to the cache key #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mitesch
Copy link

@mitesch mitesch commented Feb 19, 2025

We had a user report as part of our Ubuntu arm64 rollout that tracked back to the apt package cache accidentally being shared between the x64 runners and arm64 runners. This resulted in some odd errors.

https://github.com/community/maintainers/discussions/480#discussioncomment-12206804

This change will add the CPU architecture to the key to be hashed.

I am not adding it if it is current "normal" case of x86_64 for ubuntu-latest, ubuntu-24.04, and ubuntu-22.04 in an effort to not needlessly invalidate caches.

Logs from ubuntu-latest

Normalizing package list...
done
Validating action arguments (version='', packages='libfuse2=2.9.9-5ubuntu3 libqcustomplot-dev=2.0.1+dfsg1-5 libqscintilla2-qt5-dev=2.11.6+dfsg-4 libqt5svg5=5.15.3-1 ninja-build=1.10.1-1 qttools5-dev=5.15.3-1')...
done
Creating cache key...
- CPU architecture is 'x86_64'.
- Value to hash is 'libfuse2=2.9.9-5ubuntu3 libqcustomplot-dev=2.0.1+dfsg1-5 libqscintilla2-qt5-dev=2.11.6+dfsg-4 libqt5svg5=5.15.3-1 ninja-build=1.10.1-1 qttools5-dev=5.15.3-1 @  3'.
- Value hashed as '7249e230c6406f49de3a7775bbe7ded2'.
done
Hash value written to /home/runner/cache-apt-pkgs/cache_key.md5
Run actions/cache/restore@v4
  
Cache not found for input keys: cache-apt-pkgs_7249e230c6406f49de3a7775bbe7ded2
Run ${GITHUB_ACTION_PATH}/post_cache_action.sh \
  
Updating APT package list...
done

Logs from ubuntu-24.04-arm

Normalizing package list...
done
Validating action arguments (version='', packages='libfuse2=2.9.9-5ubuntu3 libqcustomplot-dev=2.0.1+dfsg1-5 libqscintilla2-qt5-dev=2.11.6+dfsg-4 libqt5svg5=5.15.3-1 ninja-build=1.10.1-1 qttools5-dev=5.15.3-1')...
done
Creating cache key...
- CPU architecture is 'aarch64'.
- Architecture 'aarch64' added to value.
- Value to hash is 'libfuse2=2.9.9-5ubuntu3 libqcustomplot-dev=2.0.1+dfsg1-5 libqscintilla2-qt5-dev=2.11.6+dfsg-4 libqt5svg5=5.15.3-1 ninja-build=1.10.1-1 qttools5-dev=5.15.3-1 @  3 aarch64'.
- Value hashed as '62b41aa5465640843bc389516657d8f0'.
done
Hash value written to /home/runner/cache-apt-pkgs/cache_key.md5
Run actions/cache/restore@v4
Cache not found for input keys: cache-apt-pkgs_62b41aa5465640843bc389516657d8f0
Run ${GITHUB_ACTION_PATH}/post_cache_action.sh \
Updating APT package list...
done

@mitesch
Copy link
Author

mitesch commented Feb 19, 2025

https://github.com/mitesch/sqlitebrowser/actions/runs/13419146946

Here's an example run using my branch

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