On 8/18/23 14:42, Julian Gilbey wrote:
I'm sure I'm not the only one who received a whole bunch of bugs
entitled "Fails to build source after successful build" last weekend.
There was one theme common to most of them: the presence of a
*.egg-info directory which was not cleaned by debian/rules clean.
I know the bug report said that this policy is currently under
discussion
As much as I know, there's no controversy: this really is a bug in
packages. However, the discussion in d-devel has shown it's a minor
issue, as everyone has switch to use Git for packaging.
, but I did get thinking about it. I imagine that this
particular directory should be the responsibility of dh-python to
clean up, but it may not be sensible to always delete *.egg-info
directories, as they may be present in the orig.tar.gz file.
They should not. If you're packaging from pypi, you should switch to
using upstream VCS (most Python modules are in github). Otherwise, one
possibility is to manually (well, through debian/watch) remove the
egg-info from the orig.tar.gz.
One
could handle it by manually adding this directory to debian/clean in
each package
I used to add this to all of my packages:
$ cat debian/source/options
extend-diff-ignore = "^[^/]*[.]egg-info/"
This works, and actually fixes the above mentioned bugs. However, as I
didn't want to have a single remaining instance of this bad clean-up, I
have setup my sbuild to check on it. The config is over here:
https://wiki.debian.org/zigo/mysbuild#A.2BAH4-.2F.sbuildrc
See the $external_commands thingy. This does a diff between the source
package, and the result after build + clean. It does report files from
the egg-info. Therefore, I did add rm -rf *.egg-info in all affected
packages, so I can continue to use the $external_commands checks. I
would strongly recommend every DD to do the same thing.
Yes, we can have dh-python to do the work, but IMO, the only thing it
should be doing, is rm -rf *.egg-info, and error out if the egg-info is
within the orig tarball, as this should not happen, IMO.
Now, I still think this is a minor issue... :)
Cheers,
Thomas Goirand (zigo)