[Bug 277204] *: ports misusing WITH_CCACHE_BUILD and NO_CCACHE

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 22 12:31:17 GMT 2024


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277204

--- Comment #5 from Gleb Popov <arrowd at FreeBSD.org> ---
(In reply to Benjamin Takacs from comment #4)
There are several concepts interleaved here, let me explain.

* Feature is a sort of OPTION but general enough to be applied to **any** port.
DEBUG is an example of a Feature, because almost every port can be build in the
"debug" mode.

In Ports Framework Features are implemented as .mk files placed in Mk/Features/
subdir, just like Uses are placed into Mk/Uses/. The Mk/bsd.ccache.mk file
probably predates introduction of Mk/Features, but serves the same purpose.

So, moving just bsd.ccache.mk to Features/ would solve all the issues you
outlined, but it is still a step in right direction, as it makes the framework
more consistent.

* Mk/Features/ also provide a unified interface for both users and port
developers.

If a Feature is called FOO an user can put WITH_FOO=yes or WITHOUT_FOO=yes into
the make.conf or make command line to enable or disable the Feature globally.
WITH_FOO_PORTS and WITHOUT_FOO_PORTS allows for enabling/disabling a Feature
for a given set of ports.

With https://reviews.freebsd.org/D43949 landed it will become possible for
WITH_FOO_PORTS to cancel WITHOUT_FOO and vice versa.

* Features are not expected to be self-contained. Take a look at
Mk/Features/lto.mk - it only sets some variables that are later gets consumed
by Uses and the rest of Framework. In the same way, a Uses may be taught to
look for some variables that might be set by an enabled feature.

So to fix the "order" problem we first should clearlt understand how enable
ccache machinery for Autotools, CMake, Meson, etc. and finally if it is
possible to do in a general way. Then just extend corresponding Uses to support
a new feature.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kde-freebsd mailing list