Hi lintian people, the request is, of course, not generally solvable. However, for a few buildsystems and ways to “test”, this is possible, and these should be warned about (probably at Error level even). It all begun with… The trouble here is that, with maven-debian-helper in Build-Depends and used (if pom.xml exists, it’s used), this calls “mvn test”, and Maven helpfully expands this to “mvn compile test” because the source is not yet compiled. It’s probably much more involved to do as-installed testing with Maven… but that’s for d-java@l.d.o to figure out. But some people are using this, and this should be an Error. Some other buildsystems also do this. I don’t know many, but for example some Makefile-based ones also have a “test: build” dependency. So maybe the mere presence of dh_auto_test in a testcase should also be warned about, but with a much lower severity than Error. Error should be used for these we positively know about that rebuilds are caused and that the rebuilt code is the code being tested. Perhaps specialists for other buildsystems could also be asked whether theirs do that, and errors tagged for those. Good point. I’m doing so with this. bye, //mirabilos
Hello, debhelper etc. If there was an automated way for lintian to detect these among autopkgtest dependencies, this would be a good starting point IMO. Best, Andrius
Not entirely true; sometimes, tests need to be built but hopefully against the installed code, only compiling the tests themselves. I’m not entirely sure about pointing that out as a lintian warning already. If too many packages rightfully use it, maintainers will become annoyed. On the other hand, it might serve to point people at this. Also, @builddeps@ is in the spec, even if it’s requested to be used sparingly. bye, //mirabilos
I stand corrected, such approach would indeed yield a lot of false-positives. Even dh_auto_configure appears to be used legitimately in some cases [1]. [1] https://codesearch.debian.net/search?q=path%3Adebian%2Ftests%2Fcontrol+dh_auto_configure&literal=1 Best, Andrius
dh_auto_configure is the one I’d expect to be used (with autotools). dh_auto_build is the one that raises red flags, and for *some* buildsystems dh_auto_test invokes a make/maven/whatever target that implies build if it was not built before. These uses, when it can be done reliably, should also flag. Examples for dh_auto_test: • Many Makefiles for autotools-using packages contain lines like: check: all If this is present, it should warn. But since this is not present everywhere, we can probably not warn due to too many false positives. • With Maven, calling “mvn test” will *always* build the source if it was not already built and test the just-compiled sources. Here we CAN reliably flag. bye, //mirabilos
dh_auto_configure is the one I’d expect to be used (with autotools). dh_auto_build is the one that raises red flags, and for *some* buildsystems dh_auto_test invokes a make/maven/whatever target that implies build if it was not built before. These uses, when it can be done reliably, should also flag. Examples for dh_auto_test: • Many Makefiles for autotools-using packages contain lines like: check: all If this is present, it should warn. But since this is not present everywhere, we can probably not warn due to too many false positives. • With Maven, calling “mvn test” will *always* build the source if it was not already built and test the just-compiled sources. Here we CAN reliably flag. bye, //mirabilos