On Sat, 19 May 2018 16:36:46 +0200 Jens Reyer <[email protected]> wrote: > Package: debhelper > Version: 11.2.1 > Severity: normal > > Hi, > > I've run into this with src:wine: >
Hi, Thanks for the report. > [...] > > So Wine indeed builds fine without (fake)root, but dh_testroot returns > false, while according to dh_testroot(1) it should return successfully. > This happens because the documentation in dh_testroot(1) reflects the draft initial implementation of R³. However, there was a change that altered how dpkg and debhelper interact before the specification was announced as stable. When I implemented that change, I forgot to update the documentation in dh_testroot. The change has the advantage of decoupling debhelper from dpkg (e.g. debhelper can now implement R³ without requiring a recent enough dpkg, as dpkg will announce its support for R³). Please see #899125 for draft being proposed to debian-policy until I have fixed the documentation in debhelper. It should be up to date and reflect the current implementation. > debuild and buildd build the package just fine (but I guess they just > still use fakeroot). Am I doing something wrong here? > The reason why they work is because they invoke dpkg-buildpackage. Said command will always either use fakeroot or set the DEB_RULES_REQUIRES_ROOT environment variable. You can do either of: * Use dpkg-buildpackage (possibly with -T) * Set and export DEB_RULES_REQUIRES_ROOT manually. > Besides that, shouldn't the dh_testroot check be earlier in the dh > sequence to really make sense? > This is "complicated". From a user-ability PoV, it would be best if dh_testroot was pushed "up" in the sequence in the case where the "sub-sequences" can be inlined (which is the case here). However, dh is "just" a "dumb command scheduler" that has "no idea about what the commands do". Therefore, it does not have any logic that supports shuffling commands around automatically. Furthermore, it gets even worse (more complicated) when a subsequence *cannot* be inlined (e.g. you have an explicit build target). Here the build target is not supposed to call dh_testroot because the build target MUST NOT require root, so dh_testroot would have to know that it was "pushed up" from a binary sequence. Plus dh cannot know that the recursive call into debian/rules will call dh (it probably does, but we do not know for certain). Not to mention all of this have to survive being pushed through a "makefile barrier". etc. etc. As you can probably tell, I think implementing this is too complicated in the general case. > [...] > > Greets > jre > > [...]

