On Thu, 11 Dec 2025 at 17:17:22 +0100, Paul Gevers wrote:
autopkgtest already sets several environment variables during the build, so we're considering adding one that's specific for either autopkgtest, or ci in general. "CI" comes to mind.

For what it's worth, Gitlab CI and Github Actions both set CI=true as one of their predefined environment variables, so if autopkgtest (and ideally sadt) did the same, it would be straightforward to do whatever "while running under CI" in a somewhat generic way.

The existence of AUTOPKGTEST_TMP in the environment is probably as good a way as any to detect "we are under an autopkgtest-compatible runner" more specifically than that. This is already available, and has been since 2016. (sadt also sets this.)

Neither of those provide a way to tell the difference between "built as a side-effect of autopkgtest" and "built for some other reason" for test-cases that have the needs-build restriction. Does an autopkgtest build-profile make sense for that? (autopkgtest already does set nocheck and noudeb unconditionally, and cross if appropriate.)

Matthias' original use-case was wanting to disable the non-essential parts of a binutils build (such as multilib) during autopkgtest. This could be done either via a build-profile, or by checking for AUTOPKGTEST_TMP in the environment. A build-profile would be necessary if there was a desire to disable some build-dependencies, though.

    smcv

Reply via email to