News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

CCache on Windows

Started by BlueHazzard, April 21, 2020, 05:49:14 PM

Previous topic - Next topic

BlueHazzard

Hi!
Has someone a setup for ccache and codeblocks on windows? I wonder how it can be set up, or if there are some changes needed...

oBFusCATed

Buy better computer, it is less hassle than using ccache :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

#2
With this patch it would be possible to use ccache on windows...

It basically splits the compiler command in before first space and after first space. The first part is used as the compiler, the second part is used as argument...

This would break compilation with spaces in the file name, do they exist?
A possibility would be to use a second field for "additional arguemnts" or using "" to mark the executable...
It is just an idea...

Quote from: oBFusCATed on April 21, 2020, 07:34:14 PM
Buy better computer, it is less hassle than using ccache :)
This is  sadly  not an alternative at the moment....

oBFusCATed

Generally on linux this is done by wrapping gcc/g++ in script files which execute the compiler. Have you tried this? Why doesn't it work?

I don't understand how this patch works. You'll have to provide an example what is the value before space and after space?
Have you tried it? Because ccache is funky busyness. Most of the savings in compile time are wasted debugging why it has decided that something doesn't need to be rebuilt and when it should have.

I guess the next step for you'll be to get on the unity build train...
These are non-solutions (same as pch), but backwards compatibility is king, we cannot break it...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

The target command line is
ccache gcc $other parameters$

So i enter
ccache.exe gcc
in the toolchain executable name

The problem is that codeblocks checks if the compiler is existent with wxFileExists($ENTRY_IN_TOOLCHAINEXECUTABLE$) where i put
ccache.exe gcc so this test fails, but the compilation would work

With my patch the check is only performed on the part before the first ' '
ccache.exe
Now this check works and all compiles fine. Codeblocks compiles without problems. I used it on linux quite a lot....

[edit:]
QuoteHave you tried this? Why doesn't it work?
No... this makes things more obscure... I would to prefer not..

oBFusCATed

I've used ccache in the past and it was a disaster. Then I've stopped using it.
Please don't apply this patch... it doesn't make sense.

Quote from: BlueHazzard on April 22, 2020, 09:40:15 PM
No... this makes things more obscure... I would to prefer not..
Why? What is obscure by naming your executables ccache-gcc.bat and ccache-g++.bat ? It is pretty clear what is going on.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

Also how does ccache interact with pch? If you edit some sdk header you'll have to rebuild everything anyway, so you won't win anything in compile time.

It seems the interaction is bad https://ccache.dev/manual/3.7.9.html#_precompiled_headers by the looks of it C::B's build would either fail or fallback to a compiler, because we don't do any of these things.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

sherylbrock

Quote from: oBFusCATed on April 22, 2020, 07:19:06 PM
Generally on linux this is done by wrapping gcc/g++ in script files which execute the compiler. Have you tried this? Why doesn't it work?

I don't understand how this patch works. You'll have to provide an example what is the value before space and after space?
Have you tried it? Because ccache is funky busyness. Most of the savings in compile time are wasted debugging why it has decided that something doesn't need to be rebuilt and when it should have.

I guess the next step for you'll be to get on the unity build train...
These are non-solutions (same as pch), but backwards compatibility is king, we cannot break it...

Thank you so much for your guide oBFusCATed...

Regards
Shey