Bug 277189 - devel/cmake-core: add NO_CCACHE handle to allow disable ccache build
Summary: devel/cmake-core: add NO_CCACHE handle to allow disable ccache build
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-20 14:22 UTC by Ivan Rozhuk
Modified: 2024-02-20 20:29 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments
patch (772 bytes, patch)
2024-02-20 14:22 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2024-02-20 14:22:05 UTC
Created attachment 248637 [details]
patch

Typically WITH_CCACHE_BUILD env var used together with NO_CCACHE:

/usr/ports/Mk/bsd.ccache.mk:.  if !defined(NO_CCACHE) && defined(WITH_CCACHE_BUILD) && !${CC:M*ccache*} && \
/usr/ports/graphics/darktable/Makefile:.if "${WITH_CCACHE_BUILD}" == "yes" && !defined(NO_CCACHE)
/usr/ports/graphics/rawtherapee/Makefile:.if "${WITH_CCACHE_BUILD}" == "yes" && !defined(NO_CCACHE)
/usr/ports/lang/rust-bootstrap/Makefile:.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE)
/usr/ports/lang/rust/Makefile:.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE)
/usr/ports/misc/valentina/Makefile:.if !defined(WITH_CCACHE_BUILD) || defined(NO_CCACHE)
/usr/ports/net-im/telegram-desktop/Makefile:.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE)


This allow define NO_CCACHE in env where no ccache installed but WITH_CCACHE_BUILD set in make.conf (it depend from cmake-core) to bootstrap ccache.
Comment 1 Max Brazhnikov freebsd_committer freebsd_triage 2024-02-20 17:51:28 UTC
(In reply to Ivan Rozhuk from comment #0)
There examples are misusage of NO_CCACHE.

NO_CCACHE should only be used to mark individual port that fails build with the ccache. Quote from bsd.ccache.mk:

# Port use (special case):
#  - NO_CCACHE - disable using ccache entirely.  This is for when a port build
#                fails with ccache being used.  Typically this should be
#                temporary only.
Comment 2 Ivan Rozhuk 2024-02-20 18:32:15 UTC
This patch is for proper handle situations where ccache is disabled.
It does not set NO_CCACHE it is for handle NO_CCACHE.
Comment 3 Max Brazhnikov freebsd_committer freebsd_triage 2024-02-20 19:26:24 UTC
(In reply to Ivan Rozhuk from comment #2)
Ivan,

Thank you for your intention to improve ports. However, this patch is noop.

NO_CCACHE is not a user defined variable, it's a port variable.

Ports set NO_CCACHE when they are incompatible with ccache.
The ports framework checks whether a port defines NO_CCACHE.

cmake-core port builds fine with ccache, cmake-core port doesn't set NO_CCACHE, therefore this patch is useless at least.

There's no documentation for ccache in the Porters Handbook, but you can find short description of all CCACHE variables in Mk/bsd.ccache.mk.
If you have questions, you may ask on the maillist or via irc.

I'm closing this pr, please don't re-open it.
Comment 4 Ivan Rozhuk 2024-02-20 19:42:36 UTC
But NOCCACHE is user defined and it translated to NO_CCACHE:
.  if defined(NOCCACHE)
NO_CCACHE=	t
.  endif

So at least in this way patch is correct.
Comment 5 Max Brazhnikov freebsd_committer freebsd_triage 2024-02-20 20:15:02 UTC
(In reply to Ivan Rozhuk from comment #4)

NOCCACHE is an old deprecated name for NO_CCACHE. It is (was) a port variable.

You've been kindly asked to not start open/close war and move discussion to more appropriate place.

Please close pr yourself.

Cheers,
Max
Comment 6 Ivan Rozhuk 2024-02-20 20:29:50 UTC
(In reply to Max Brazhnikov from comment #5)

I have no more tech args, thanks!

Hope you will help with #277202.