On Thu, 2024-02-01 at 08:15 +0000, Robin H. Johnson wrote:
> TL;DR:
> I'd like to propose a change where packages should NOT install their
> tests to ${D} by default.

That sounds like reverting a lot of effort that has been cleaned up all
over the past years.

>  Such an install may optionally enabled with
> USE=test, which should be decoupled from FEATURES=test.

This would prevent us from detecting files accidentally left over by
FEATURES=test, as ago does right now.  A few times this was actually
helpful in identifying packages whose test suites wrote temporary files
into site-packages directory, and they effectively ended up being
installed.

>  Or depending on
> the color of the bikeshed, we add something new like USE=install-tests.
> 
> Background:
> Python packages install a number of _test.py files, and related .pyc
> files. The files are generally useful for running tests after the
> package is installed, and may have additional testing dependencies that
> are not installed via RDEPEND.

This is not really relevant.  This is the case of optional runtime
dependencies (i.e. you don't have to have them installed when installing
the test suite in question), and per policy PG-0001 these can be
expressed using postinst messages or likewise.

> As an example, on the livegui install media, these files take 100MB+
> before squashfs compression.
> 
> Some users MAY wish to verify that a package continues to function
> correctly, and they should have the USE=test dependencies available at
> runtime, and the tests installed.
> 
> Such post-install testing may also require other files to be present, to
> configure the test suite runs.

I suppose you are referring to dev-lang/python here.  Unfortunately,
removing tests from it is a non-trivial problem.  As I've mentioned to
you before, there are packages that actually import modules form the
test directory.

Remember that Gentoo has a policy of following upstream, and this policy
is specifically targeted towards developers who expect Gentoo to
be a good baseline environment for developing packages.  By explicitly
diverging from upstream default install by default, we are effectively
creating an incompatible Python environment and requiring users to go
through extra steps to restore upstream compatibility.

What's worse, Python development is often done via virtual environments.
For regular Python packages, all kinds of Gentoo divergence can be
easily "reverted" by installing the upstream packages inside the virtual
environment.  However, this isn't the case for dev-lang/python itself --
by stripping it down we're effectively creating virtual environments
that are not fully functional and whose functionality cannot be restored
without actually rebuilding dev-lang/python.

On top of that, as you are also perfectly aware, stripping down tests is
often non-trivial and either requires complex patches (we are talking of
modifying the build system not to install something), or ugly hacks (we
are talking about having Python install and compile modules, and
removing them afterwards).

Finally, "requiring other files to be present" effectively means adding
USE dependencies.  This is going to be a lot of effort, considering that
effectively developers would have to run without test suites installed
to detect missing dependencies, and then rebuild dev-lang/python every
time they are about to run tests in a package that actually requires
these files.

Overall, I don't believe you've provided sufficient rationale to justify
diverging from upstream, adding significant complexity to ebuilds
and adding a lot of additional work to package maintainers who will be
responsible for ensuring the correctness of package installations
and USE dependencies.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to