You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to restore C++ artifacts in some situations #460
It seems actions/cache is not able to restore C++ artifacts in such a way that they can be used from the build.
We're using node.js source code directly as part of our app. Usually, nodejs build takes ~30mins. I want to improve our CI builds using actions/cache and cache whole node.js's source code along with build artifacts. The problem is that the second build throws an error as it is not able to execute one of cached binaries. It seems the binary is getting corrupted and it is no longer recognized.
It seems the problem is related to how actions/cache handles and processes provided input files.
It works if I manually create a zip, upload it to s3 and download it from the build.
changed the title [-]Unable to restore C++ artifacts in such a way that they can be used from the second build[/-][+]Unable to restore C++ artifacts in some situations[/+]on Nov 15, 2020
Hi, this is a weird one. It looks like that executable (mksnapshot) is getting corrupted so it's no longer recognized as an executable file on MacOS. This can be seen by running file <path>/mksnapshot. The original file type is Mach-O 64-bit executable x86_64 but becomes data after restore (which indicates the type isn't recognized).
This seems related to #403 where some .dylib files were being corrupted. That issue was fixed by installing GNU tar and seems to also fix this issue.
Please try adding the following to your workflow file before the cache step. It takes a few minutes to install GNU tar, but that might be worth it if it cuts down the 30 minutes to build nodejs.
- name: Install GNU tar
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
We have an open issue to switch over to using GNU tar - actions/toolkit#610.
Edit: If using a matrix strategy with multiple OS'es, here's a version of the step that will only run on macOS:
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
Actually, the installation of GNU tar takes around 15-25 seconds on my side which is OK having in mind that it saves us more than 30 minutes skipping the native build part.
Activity
[-]Unable to restore C++ artifacts in such a way that they can be used from the second build[/-][+]Unable to restore C++ artifacts in some situations[/+]dhadka commentedon Nov 16, 2020
Hi, this is a weird one. It looks like that executable (
mksnapshot) is getting corrupted so it's no longer recognized as an executable file on MacOS. This can be seen by runningfile <path>/mksnapshot. The original file type isMach-O 64-bit executable x86_64but becomesdataafter restore (which indicates the type isn't recognized).This seems related to #403 where some
.dylibfiles were being corrupted. That issue was fixed by installing GNU tar and seems to also fix this issue.Please try adding the following to your workflow file before the cache step. It takes a few minutes to install GNU tar, but that might be worth it if it cuts down the 30 minutes to build nodejs.
We have an open issue to switch over to using GNU tar - actions/toolkit#610.
Edit: If using a matrix strategy with multiple OS'es, here's a version of the step that will only run on macOS:
Fatme commentedon Nov 17, 2020
Hi @dhadka,
Thank you very much for looking into this!
I tested the provided workaround and it works!
Actually, the installation of GNU tar takes around 15-25 seconds on my side which is OK having in mind that it saves us more than 30 minutes skipping the native build part.
dhadka commentedon Nov 18, 2020
Closing given the workaround. Tracking permanent fix with actions/toolkit#552.