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

Re: [Request for review] assembly-stats



Hi Nilesh,

On Tue, Mar 09, 2021 at 11:54:49PM +0530, Nilesh Patra wrote:
> Currently assembly-stats fails to cross-build from source because the build forces compilation of test files, while its test dependency libgtest-dev is annotated with <!nocheck>

I think that building unittests in the presence of a nocheck option or
profile is suboptimal, but it is not a bug itself. However, failing to
build unittests with the nocheck option, because gtest is annotated
<!nocheck> is a bug. Such a bug should also happen for a native build
that sets both the nocheck option and profile, e.g. via
DEB_BUILD_OPTIONS=nocheck sbuild --profiles=nocheck ... If that happens
to fail, I usually report a separate bug at severity important and tag
it ftbfs (i.e. a native build failure).

There are two ways to fix this issue. One is dropping the <!nocheck>
annotation and the better option is the one you are proposing here.

> It also uses DEB_BUILD_GNU_TYPE in d/rules which is wrong. I've attempted a fix, and would really like and appreciate a review before I report a bug and commit this in salsa as well.

Your patch looks good.

> +override_dh_auto_configure:
> +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
> +	dh_auto_configure -- -DBUILD_TESTS=ON
> +else
> +	dh_auto_configure -- -DBUILD_TESTS=OFF
> +endif

I tend to prefer the following variant, because it is less repetitive:

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)

Both work equally well.

Helmut


Reply to: