Author Topic: CCache on Windows  (Read 659 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2773
CCache on Windows
« on: April 21, 2020, 05:49:14 pm »
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...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: CCache on Windows
« Reply #1 on: April 21, 2020, 07:34:14 pm »
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!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2773
Re: CCache on Windows
« Reply #2 on: April 22, 2020, 03:53:44 pm »
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...

Buy better computer, it is less hassle than using ccache :)
This is  sadly  not an alternative at the moment....
« Last Edit: April 22, 2020, 03:55:44 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: CCache on Windows
« Reply #3 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...
(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!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2773
Re: CCache on Windows
« Reply #4 on: April 22, 2020, 09:40:15 pm »
The target command line is
Code: [Select]
ccache gcc $other parameters$
So i enter
Code: [Select]
ccache.exe gccin the toolchain executable name

The problem is that codeblocks checks if the compiler is existent with wxFileExists($ENTRY_IN_TOOLCHAINEXECUTABLE$) where i put
Code: [Select]
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 ' '
Code: [Select]
ccache.exeNow this check works and all compiles fine. Codeblocks compiles without problems. I used it on linux quite a lot....

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: CCache on Windows
« Reply #5 on: April 22, 2020, 09:58:00 pm »
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.

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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12739
    • Travis build status
Re: CCache on Windows
« Reply #6 on: April 22, 2020, 10:02:34 pm »
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!]

Offline sherylbrock

  • Single posting newcomer
  • *
  • Posts: 1
Re: CCache on Windows
« Reply #7 on: July 14, 2020, 07:59:16 am »
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
Sheryl~