public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFC: Block ebuilds installing tests to ${D} by default
Date: Thu, 01 Feb 2024 22:03:57 +0100	[thread overview]
Message-ID: <9cd24274a8502f92e20fff640c19a63560bfdc4c.camel@gentoo.org> (raw)
In-Reply-To: <robbat2-20240201T075952-136355609Z@orbis-terrarum.net>

[-- Attachment #1: Type: text/plain, Size: 3865 bytes --]

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

  parent reply	other threads:[~2024-02-01 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  8:15 [gentoo-dev] RFC: Block ebuilds installing tests to ${D} by default Robin H. Johnson
2024-02-01 19:44 ` Mike Gilbert
2024-02-01 21:03 ` Michał Górny [this message]
2024-02-01 21:38   ` Eli Schwartz
2024-02-01 21:52     ` Mike Gilbert
2024-02-01 22:06       ` Eli Schwartz
2024-02-01 23:07 ` Andreas K. Huettel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cd24274a8502f92e20fff640c19a63560bfdc4c.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox