Cached executables are not executable
See original GitHub issueThanks a lot for the action, it’s been a pleasure to use!
We’re using the cache to store some precompiled Haskell artifacts, which include executable files. On Linux everything seems to be running smoothly, but from time to time the macOS build cache seems to get corrupted. Here’s an example:
- A new PR triggers a CI run. For some reason the cache didn’t work out (not a big deal), so the artifacts get recompiled. The executables get used in the later stages of the run, so they had to be built correctly.
- An update to PR is pushed, triggering another run. This one no longer rebuilds from scratch, but it almost immediately fails with the following error (
~/.stack
is part of the cache):
/Users/runner/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5: /Users/runner/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5: cannot execute binary file
I’ve been trying to debug this issue, but I’m running out of ideas for what might be going wrong. Is it possible that the macOS runners are using different CPU architectures? Is executable caching supported?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8 (1 by maintainers)
Top Results From Across the Web
How does cached memory work for executables?
It seems that both executables (e.g., a program like thunderbird) and data (e.g., the content of a log file) can be cached. In...
Read more >Are processes in Windows 7 cached? - Super User
Not only are the executable files themselves cached, ... conhost.exe is the console-hosting process, that is launched by the Command Prompt ...
Read more >Caching executables from network share - TechNet - Microsoft
Some application with a .exe on that share (call it test.exe) - So the application can be reached under \\SRV1\File_share$\test.exe
Read more >[SOLVED] How To Fix Fc-cache.exe Errors - Solvusoft
In most cases, fc-cache.exe file problems are due to the file missing or being corrupted (malware / virus) and often seen at Wiki...
Read more >Windows OS seems to cache .exe file and not run a new one ...
This is a routine occurance that is done for performance reasons. All modern operating systems do this and have for a long time....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It sounds like this might be related to a few other reported issues of corrupted executables on MacOS. As far as I an tell, the corruption is caused by BSD tar. No idea why, but the problem seems to go away when switching to GNU tar. See https://github.com/actions/cache/issues/460#issuecomment-728366594 for the workaround.
@Martinsos we’re doing the same thing in our repo. Fortunately in this case it doesn’t cost us much because the setup executables are small, but I’m afraid that it might hint at a larger problem with this action.