[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: nocheck (don't run) vs nodoc (don't build)



On Wed, 26 Apr 2023 at 18:59:46 +0200, Christian Kastner wrote:
> Policy 4.9.1 states that (emphases mine):
>   * "[nocheck] says not to *run* any build-time test suite"
>   * "[nodoc] says to skip any *build* steps"
> 
> My reading with regards to 'nocheck' was that where tests were available
> and needed to be built, then they should always be built, just not run.
> 
> A typical example might be a C library package that builds those tests
> and ships them as autopkgtests, maybe even in a dedicated package.
> 
> I thought this line of reasoning was sound, but then I remembered the
> 'nodoc' tag and now I am no longer sure. Maybe I'm taking the 'nocheck'
> description too literally.

With RFC 2119 terms, my opinion would be:

- packages built with the nocheck option SHOULD NOT run tests
- the nocheck option SHOULD NOT alter the contents of any binary package
- packages built with the nocheck option MAY avoid building the tests at
  all, but only if that doesn't change the binary packages

The nocheck option (in Policy) is related to the nocheck build-profile
(not part of Policy). https://wiki.debian.org/BuildProfileSpec documents
that DEB_BUILD_PROFILES=nocheck SHOULD NOT change either the contents of
any binary package or the set of binary packages that are compiled, and
also documents that DEB_BUILD_PROFILES=nocheck MUST be accompanied by
DEB_BUILD_OPTIONS=nocheck.

For the use-case of choosing whether to build tests and ship them
in a .deb for autopkgtest or manual testing, we have the noinsttest
build-profile ("Disable binary packages consisting entirely of automated
tests, manual tests, example/demo programs and test tools").

For example, see dbus, which uses GLib in many of its automated tests,
but not in its production code. It build-depends on

    libglib2.0-dev <!nocheck> <!noinsttest>

which means it usually needs GLib, but if it is built with *both* nocheck
and noinsttest (meaning don't run build-time tests, *and* don't build
dbus-tests_*.deb for later use by autopkgtest) then GLib isn't required.

    smcv


Reply to: