chocobo1 / setup-ccache-action Goto Github PK
View Code? Open in Web Editor NEWSetup ccache easily in your workflow, with all the tuning knobs you need!
License: MIT License
Setup ccache easily in your workflow, with all the tuning knobs you need!
License: MIT License
Hi @Chocobo1, thx for the great GH action.
This line:
setup-ccache-action/src/utils.ts
Line 72 in 8856534
should be? MINGW_PREFIX
or MSYSTEM_PREFIX
:
return ${Process.env.MINGW_PREFIX}/lib/ccache/bin;
Currently, it is ${Process.env.MSYSTEM}
, so the path will be /UCRT64/lib/ccache/bin
.
With MSYSTEM_PREFIX
it will be /ucrt64/lib/ccache/bin
.
I think that the MSYSTEM
env. variable is not supposed to be used in paths, that is why MSYSTEM_PREFIX
exists.
Here is source where it is defined and link to all occurrences.
Later: Also when I looked at GHA output log I have found two more cases where this upper-case UCRT64
is used:
Clear ccache statistics
Prepend ccache symlinks path to $PATH
ccache symlinks path (msys): "/UCRT64/lib/ccache/bin"
(msys) PATH=/UCRT64/lib/ccache/bin:/ucrt64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Create environment variables
${{ env.ccache_symlinks_path }} = /UCRT64/lib/ccache/bin
So it should be changed for env.ccache_symlinks_path
output variable and in prepend path too.
I'm not sure what is the difference between MSYSTEM_PREFIX
and MINGW_PREFIX
, or which one should be used when ๐, if you want I can ask at the msys2 issue tracker.
Hi,
I tried to also make use of this action in combination with cygwin.
First the good news: The binary is found (thanks to that cygwin is added to the path).
And now the bad news: First thing I saw was the version check. It finds the binary from cygwin and the one from choco and doesn't seem to b able to handle this. It calls "bin1 bin2 --version" which just can't work. I was able to work around this by deleting the choco ccache.exe (Uninstalling didn't work as choco claims it didn't install it).
Second problem: cygwin ships ccache 3.1.9 which doesn't have --get-config and also doesn't have -p option:
c:\cygwin64\bin\ccache.exe -h
Usage:
ccache [options]
ccache compiler [compiler options]
compiler [compiler options] (via symbolic link)
Options:
-c, --cleanup delete old files and recalculate size counters
(normally not needed as this is done automatically)
-C, --clear clear the cache completely
-F, --max-files=N set maximum number of files in cache to N (use 0 for
no limit)
-M, --max-size=SIZE set maximum size of cache to SIZE (use 0 for no
limit; available suffixes: G, M and K; default
suffix: G)
-s, --show-stats show statistics summary
-z, --zero-stats zero statistics counters
-h, --help print this help text
-V, --version print version and copyright information
Cache-dir could be parsed from -s output:
c:\cygwin64\bin\ccache.exe -s
cache directory /home/micro/.ccache
cache hit (direct) 171
cache hit (preprocessed) 0
cache miss 172
files in cache 516
cache size 79.2 Mbytes
max cache size 1.0 Gbytes
Would be great if you could add cygwin, as it seems to be the only plattfrom that's missing. If you need some additional info, just let me know.
Hi, after paying more attention at the annotations because of the 1.14 update (nice fix, works, thanks), I've seen one more. When giving just the make version and laving all other opts at default I get this output:
==> Installing ccache dependency: hiredis
==> Pouring hiredis--1.1.0.monterey.bottle.tar.gz
Warning: The post-install step did not complete successfully
You can try again using:
brew postinstall hiredis
==> Summary
๐บ /usr/local/Cellar/hiredis/1.1.0: 41 files, 365.1KB
==> Installing ccache
==> Pouring ccache--4.8.monterey.bottle.tar.gz
Warning: The post-install step did not complete successfully
Warning: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set: not checking for outdated
dependents or dependents with broken linkage!
You can try again using:
brew postinstall ccache
==> Caveats
To install symlinks for compilers that will automatically use
ccache, prepend this directory to your PATH:
/usr/local/opt/ccache/libexec
If this is an upgrade and you have previously added the symlinks to
your PATH, you may need to modify it to the path specified above so
it points to the current version.
NOTE: ccache can prevent some software from compiling.
ALSO NOTE: The brew command, by design, will never use ccache.
==> Summary
๐บ /usr/local/Cellar/ccache/4.8: 75 files, 1.4MB
==> Caveats
==> ccache
To install symlinks for compilers that will automatically use
ccache, prepend this directory to your PATH:
/usr/local/opt/ccache/libexec
If this is an upgrade and you have previously added the symlinks to
your PATH, you may need to modify it to the path specified above so
it points to the current version.
NOTE: ccache can prevent some software from compiling.
ALSO NOTE: The brew command, by design, will never use ccache.
Warning: The process '/usr/local/bin/brew' failed with exit code 1
`I'm not sure if this is by design (of brew) or avoidable, but I know it's annoying as it's the only annotation left in the workflow.
If set cache_dir to another place,it will make restore cache never success.
Example:
- name: Set up ccache
uses: Chocobo1/setup-ccache-action@v1
with:
ccache_options: |
cache_dir=${{ env.workspace }}/.ccache
So I think it should configure ccache before restore cache.
Hi choco ๐,
this week I have set up the ccache
for all my Windows msvc toolchains, it has 100% cache hits and now I want to also set up the ccache for my Windows msvc related GitHub actions.
The following doesn't work, it quits with the Warning: "windows_compile_environment=" is not supported. No operation...
:
- name: ccache install ๐ฅณ
run: |
choco install ccache -y
- name: ccache setup ๐บ
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
install_ccache: false
update_packager_index: false
ccache_options: |
compression = false
max_size = 1G
I don't ask for full msvc support, even the install_ccache
may not work.
Would be good to normally continue if the windows_compile_environment
is empty or windows_compile_environment=msvc
.
I have tried following inside the Windows-2019
GitHub action's image, I'm posting here notes to make it easier for you:
ccache --set-config xx=yy
works out of the box if the ccache
is already installed.ccache.conf
file at $env:APPDATA/ccache/ccache.conf
(~/AppData/Roaming/ccache)ccache.exe
at C:\ProgramData\chocolatey\bin\ccache.exe
and it's on the system pathI think it would be enough to make it work inside the Windows-2019/2022
images.
Here is my cmake code that fixes/allows 100% ccache hits, it simply disables precompiled headers and replaces /Zi
compiler option with the /Z7
in CMAKE_<C|CXX>_FLAGS_<CONFIG>
flags.
The Cmake defaults to /Zi
so it has 100% ccache misses because ccache doesn't support /Zi
but it works great with the /Z7
compiler option. And also ccache doesn't support precompiled headers on Windows msvc.
The action always fails on ubuntu-18.04.
Example run:
https://github.com/AllSeeingEyeTolledEweSew/libtorrent/runs/3711450909?check_suite_focus=true
The error seems to be:
/usr/bin/ccache --show-config
/usr/bin/ccache: unrecognized option '--show-config'
Usage:
...
Subject says it all. I would offer a PR but alas I know almost nothing about JavaScript or how to properly perform this update :-(
I don't think there should be any timestamp in the cached file: It complicates the action's code as it has to lookup and cleanup, it still pollutes the cache, but what is this effort actually good for? Why would anyone want to keep old revisions of the ccache? It's a cache...
setup-ccache-action/src/main.ts
Line 120 in acabebe
IMO, this should be an info printout, not a warning. I'd like to be able to just use this action in a job that runs on all OSes, and have it be a no-op where not supported, rather than using conditionals to avoid the warning.
The warning creates an alert annotation in the workflow. For example: https://github.com/arvidn/libtorrent/actions/runs/1274732824
In the "PR checks" part of the actions UI, these annotations are surfaced with an exclamation mark -- See https://github.com/arvidn/libtorrent/pull/6484/checks
It appears that warnings are generally used where action/intervention is required.
Hi ๐๐ผ
Thanks for maintaining this nice action!
Since a couple of days ago, we are experiencing some problems on macOS runners, where the action fails to install ccache via brew.
More precisely, it fails with the following warning
/usr/local/bin/brew install ccache
Error: $HOME must be set to run brew.
See https://github.com/cda-tum/mqt-core/actions/runs/5809540441/job/15748518266#step:3:168 for an example run that fails.
Some googling brings up Homebrew/brew#15833, which describes that a change has been introduced quite recently and $HOME
needs to be specified now.
What I suspect is happening is that the process that the brew
command is running in does not have access to the $HOME
env variable that is automatically set by GitHub Actions. A potential solution could be to just pass that variable through here:
setup-ccache-action/src/main.ts
Lines 87 to 90 in cfe5395
I'll happily submit a PR if you feel that that might be a proper solution.
Hi @Chocobo1, today all my ccache actions calls started failing, it's a first time I see any problem with this action.
Here is the link to the failed action.
It fails with this error:
Error: Cache upload failed because file read failed with ESPIPE: invalid seek, read
at ReadStream.<anonymous> (/home/runner/work/_actions/Chocobo1/setup-ccache-action/v1/dist/webpack:/@Chocobo1/setup-ccache-action/node_modules/@actions/cache/lib/internal/cacheHttpClient.js:180:1)
Do your ccache actions work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.