pkgcheck icon indicating copy to clipboard operation
pkgcheck copied to clipboard

[New Check]: Detect likely-broken virtx use (nonfatal)

Open thesamesam opened this issue 7 months ago • 0 comments

Is there an existing such new check request for this?

  • [x] I have searched the existing issues

Explain

I sometimes see test failures being accidentally ignored when virtualx.eclass is in use, because

src_test() {
    virtx default
}

... will ignore any failures from default.

This is also covered in the Python guide:

Explicit || die is only necessary when overriding python_test and running epytest inside a nonfatal. The virtx command runs its arguments via a nonfatal. The default python_test implementation created by distutils_enable_tests accounts for this. In other contexts, epytest will die on its own.

Note that there's some trickiness here. We can't always complain about nonfatal without die, see https://github.com/gentoo/portage/pull/911.

Examples

  • dev-lang/tk ignores test failures in its src_test at https://github.com/gentoo/gentoo/blob/f88391e1348142b7b0d25c49d29c71e7031b763c/dev-lang/tk/tk-8.6.16.ebuild#L103
multilib_src_test() {
	CI=1 virtx emake test
}
  • dev-python/tikzplotlib, fixed in c81c9f363c84d88bc8221276dfa79c6f30004c19
  • dev-python/qtawesome, fixed in 7abd100b81820f3780ffe521a35ae78f22c0f2d7
  • app-text/nfoview, fixed in 9b6edb1bbe2f8f12c824e707fd199a983fbfd9ed

Output message

VirtualxNonfatalMissingDie

Documentation

virtx uses nonfatal, meaning that failures are ignored by default. Direct use of virtx should usually be accompanied by a die.

Result level

None

thesamesam avatar Jul 13 '25 04:07 thesamesam