I'd like to be able to run make cleans between builds, and ccache would make this much simpler since I wouldn't need to recompile everything every time
I haven't found any information about it being used at all, the wiki mentions that some systems might need it as a requirement for compilation, but I've been checking the output of ccache -s and no new files are put into the cache directory during builds.
You can utilize git to check in the build tree to your own local branch and use "git commit" to create snapshots for the different build phases. Then use "git checkout <commit-id>" to revert a particular stage.
Another possible way is to create a snapshot volume for the build tree and then take a snapshot whenever you are happy with a particular part in the build process which you then can revert back to.
The above requires that you make a temporary change in a build script in order to pause at a suitable point where you want to make a snapshot or commit changes to your local git branch.
The toolchain has it's own version of gcc, it's own libraries, etc. You need to
go into that copy of gcc and do all the things that you did in your main
version, including setting up ccache slaves with the correct environment
(obviously using different ports so you don't mix the LEDE crossbuild ccache
environment with your main ccache environment.
There's a compile error now. It also looks like you can manually set the CONFIG_CCACHE flag without having to set it in menuconfig.
CONFIG_CCACHE=y make -j1 V=sa
ccache: error: Could not find compiler "mips-openwrt-linux-musl-gcc" in PATH
Now i've tried to manually set the PATH when running make
PATH="/home/mesrc/lede-project/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl/bin:$PATH" CONFIG_CCACHE=y make -j1 V=sa
But it's still the same problem. From the error output I can see that the ccache binary isn't finding the compiler binaries in the PATH and manually setting the compiler path in via the PATH variable doesn't get picked up by the build system
Have any of you guys gotten a successful build while using ccache?
Trust me this will be beneficial for everyone, a fully cached build is WAY faster even when doing make cleans in between. I use ccache when compiling the linux kernel and android builds and the difference is light and day
Don't think there was anything special about setting the environment up to use ccache; i.e. I don't remember rebuilding the toolchain specifically to use the cache(but it has been a while since I set things up). If your environment can build successfully without, than with should not be any different except of course installing/configuring ccache for your OS, and turning on that attribute.
Hi! Note that it uses its own copy of ccache, with the cached files in-tree, so you need to CCACHE_DIR=staging_dir/host/ccache ccache -s
or, to be picky, CCACHE_DIR=staging_dir/host/ccache staging_dir/host/bin/ccache -s
to see the stats. Plain "ccache -s" will show the stats for ~/.ccache, which is not updated.
For when it's biulding the toolchain instead, CCACHE_DIR=$(echo staging_dir/toolchain-*)/ccache ccache -s
and for compilations for the target, CCACHE_DIR=$(echo staging_dir/target-*)/ccache ccache -s