Hello everyone, just became aware of this bug due to https://salsa.debian.org/debian/sbuild/-/merge_requests/71
I would like to explain why I would prefer sbuild to default to --no-clean and ask if I'm missing something. >> Other than that, can we run "dh clean" inside the chroot? > What would that accomplish? Running dh clean inside the chroot will remove the need to run it outside. > At the point where the .dsc is unpacked inside the > chroot, it already is clean. You need a clean unpacked source directory, so > that you can build a .dsc so that it can be copied into the chroot. So this > cleaning has to happen on the outside. I don't know why it has to happen outside, why can't sbuild run dh clean even when the input is a .dsc? >> Today this doesn't always work, because sbuild wants to "dh clean" outside >> the chroot. > that is correct. But it could be said that this is still not a bug because you > are using sbuild wrong. ;) I agree that it's not a bug, but I think it would greatly improve the usability of sbuild by making it simpler. Today, a person using sbuild needs to either A) Default to --no-clean-source, B) Install build-dependencies whenever there are errors when building a package, cluttering the host system. Both of these things require the person to also know about this detail. WIth --no-clean-source by default, there's no need to ever bother with it, and that's what we recommend to mentees in the Debian Brasil community. > - cleaning on the inside is pointless because it would not avoid having to > clean on the outside If you clean it on the inside, you allow sbuild to have --no-clean-source by default. >> I can make --no-clean the default in my config, I suppose. > Beware that this will lead to broken packages if you did make the wrong > changes. That's why it's not the default. I guess this is where I'm likely missing something, considering the following things: 1) sbuild calls dh clean inside the chroot even when a .dsc is provided 2) sbuild defaults to --no-clean-source What type of change can one make to a package which will lead to any type of issue? As far as I know, running dh clean twice can't cause any issues. Changes outside of the scope of dh_clean are not related to this issue as it won't matter whether dh_clean is even run. I can't think of any scenario where this can lead to issues. I do acknowledge that this might lead to dh_clean being called twice, if the user calls dh_clean when creating the dsc, but that doesn't seem to be an issue. If really needed, sbuild could provide a parameter that lets the user control whether dh clean is run inside (defaulting to true). This way sbuild becomes much more "standalone", while still allowing users to choose the other behavior. Cheers, -- Samuel Henrique <samueloph>

