[Bug 264454] Do not build TEST_DEPENDS in case NO_TEST is set and do not run tests

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 06 Jun 2022 10:19:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264454

--- Comment #7 from Stefan Eßer <se@FreeBSD.org> ---
(In reply to Tomoaki AOKI from comment #5)

> make fetch-recursive currently forces downloading of TEST_DEPENDS.
> This can consume excessive disk space.

But why are you using these *-recursive targets at all?

They are useful if you have off-line (air-gapped) systems and you want to fetch
files or provide packages for use on them.

In that case you want to have all possibly relevant distribution files and
packages included, just in case you want to "make test" on this system that has
no access to the Internet.

I really do not understand why you are using these commands to perform port
upgrades or other package management tasks.

We have tools that optimize the upgrades, e.g. portmaster or portupgrade. These
do exactly what is required, and in an optimized way (e.g. fetch just the
distribution files that will be required in the background, perform only those
builds that are required, ...).

Portmaster has no dependencies (it is just a shell script), exists for some 20
years and has continuously been adapted to comply with changes in the
ports/package system. It lets you build ports and packages in just the same way
as 20 years ago, despite major changes in the ports system (e.g. the
introduction of the PKGDB and of flavors).

Try "portmaster -bgw -a" to update all down-level ports (and create packages
and package backups of the previous version, just in case). (The -bgw parameter
can of course be set as default options in the ~/.portmasterrc file.)

Try "portmaster -F -a" to just fetch required distfiles for all ports needing
updates in parallel.

Using the *-recursive targets in the way you seem top do it is a significant
waste of resources, and the port management tools mentioned above implement the
required logic to allow for efficient updates/upgrades.

There is so much missing in bsd.port.mk if you want to make it efficiently
support your use case that adding NO_TEST will just increase its complexity,
but without solving the issues you are having due to inappropriate use of this
functionality. There is no functionality to selectively build just the modified
ports this way, for example.

There are other port and package management tools, I'm mentioning portmaster
just as an example. You may prefer portupgrade, for example.

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