Page MenuHomeFreeBSD

Mk/bsd.ccache.mk: Make cmake support more flexible
ClosedPublic

Authored by madpilot on Apr 4 2025, 1:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 26, 6:36 AM
Unknown Object (File)
Fri, Nov 21, 4:46 AM
Unknown Object (File)
Wed, Nov 19, 11:18 PM
Unknown Object (File)
Wed, Nov 12, 1:45 AM
Unknown Object (File)
Thu, Nov 6, 3:25 AM
Unknown Object (File)
Wed, Nov 5, 7:13 AM
Unknown Object (File)
Wed, Nov 5, 12:58 AM
Unknown Object (File)
Tue, Nov 4, 11:19 PM
Subscribers

Details

Summary

With commit R11:56538adacf53391307f687155be3fc787a95f40b to ports, I noticed an issue with poudriere, I was not able to disble using ccache for single ports (depending on cmake) by defining NO_CCACHE, looks like this commit ignores that varaible.

I also noticed that the commit hardcodes "ccache" as a binary name.

My patch puts the stanza in the general conditional so it is enabled only when ccache is being actually used. I'm also making the value use the variable CCACHE_BIN, which could be configured by the user.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

madpilot created this revision.
This revision is now accepted and ready to land.Apr 6 2025, 3:52 AM
diizzy added inline comments.
Mk/bsd.ccache.mk
112

From what I can tell by CMake's documentation this is an invalid option.
https://cmake.org/cmake/help/latest/envvar/CMAKE_LANG_COMPILER_LAUNCHER.html

Mk/bsd.ccache.mk
112

Sorry I don't understand, you mean the CPP variant is invalid?

It is not perfectly clear from the documentation page you link, but it is quite possible. Some other code I saw using this made me think it was valid though.

I'm asking just to understand, no problem in dropping this line from my patch.

Remove invalid cmake option.

This revision now requires review to proceed.Apr 6 2025, 2:02 PM

remove invalid cmake option

Sorry, I pushed a completely unrelated diff I'm still working on, I should have fixed it now.

madpilot marked 2 inline comments as done.
madpilot removed subscribers: imp, ae, melifaro, glebius.

I'd like to commit this patch, since it is fixing a an issue (avoid -DCMAKE_C_COMPILER_LAUNCHER=ccache being added when defining NO_CCACHE), but am missing portmgr approval. Who could I ask for intervention?

Given the "recent" breakage of various things I'd like at least to see a run with and without ccmake enabled withs ports that interracts with it already in various ways. `grep -ir CCACHE --include "Makefile" /usr/ports/` gives you an idea of what ports I'm referring to.

Given the "recent" breakage of various things I'd like at least to see a run with and without ccmake enabled withs ports that interracts with it already in various ways. `grep -ir CCACHE --include "Makefile" /usr/ports/` gives you an idea of what ports I'm referring to.

I performed two builds as requested, with poudriere bulk for a list of ports from the command line you indicated, with no difference, but I forgot the -t flag to poudriere-bulk, so I'm running it again and then I'll send a link to build logs.

This is the list of ports I'm testing on:

security/botan3
java/openjdk22
devel/ninja
devel/cmake-core
graphics/darktable
graphics/digikam
graphics/rawtherapee
ports-mgmt/poudriere
www/node22
lang/rust
games/simutrans

@diizzy I've tested with the ports indicated in my previous message, both with and then without the patch.

You can download an archive with the poudriere logs from the two runs at [1].

The first run (earlier timestamp) is the run with my patch applied, the later one is without the patch.

[1] http://www.madpilot.net/~mad/ccache-test.tzst

Looks reasonable. portmgr@ could you approve the patch?

This revision is now accepted and ready to land.Sep 18 2025, 1:05 PM