question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cached executables are not executable

See original GitHub issue

Thanks 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:

  1. 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.
  2. 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:open
  • Created 3 years ago
  • Reactions:9
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
dhadkacommented, Nov 20, 2020

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.

2reactions
apaszkecommented, Nov 20, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found