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

Re: dh-haskell chokes on unknown files



On Sun, 08 Jan 2017 15:43:04 +0300
Dmitry Bogatov <KAction@gnu.org> wrote:

> [2017-01-04 19:48] Sven Bartscher <kritzefitz@debian.org>
> >
> > part 1     text/plain                 957
> > Greetings,
> >
> > I just noticed that dh-haskell fails to install data files declared in
> > the .cabal file with the message "Unhandled file: <data file here>".
> > While searching for the cause of this, I found that dh-haskell rejects
> > all files it doesn't know about with this message .
> >
> > While I think the failure to install data files is just a bug I could
> > quickly fix by teaching dh-haskel to handle them properly, I still like
> > to give others the opportunity to speak up before I change (yet to
> > become) core build tools.  
> 
> > I further think that handling unknown files with a failure isn't good,
> > as it is prone to fail on packages which install exotic kinds of files.
> > Just writing out a warning or completely ignoring unknown files would
> > IMO be a better solution, as it allows installing such files with
> > dh_install. But I also think that Dmitry might have had a special
> > reason for handling unknown files this way. Could you please give some
> > input on that?  
> 
> IMHO, FTBFS is better then broken package, in same vein as compile error
> is better then run error. We are haskellers, after all.

This is a good point.

> `dh_install' is irrelevant here, since dh_install installs directly into
> `debian/<debian-package>', and dh_haskell works with `debian/tmp'

dh_install can AFAIK also install from debian/tmp, that's why I
mentioned it.

> Concerning 'Unhandled file' error, when I wrote this code I classifed
> all files into 3 packages: 'bin', 'prof', 'doc'. If I encounter unknown
> file, there is no clear answer where to put it in.

It's of course true, that dh_haskell can't just magically make up a
place to install these files, but from what I have seen, it seems that
there is no way to make an exception for individual files, even though
it would be trivial to list those files in <package>.install and let
dh_install handle them. This doesn't seem to be possible right now, as
dh_haskell fails before dh_install has a chance to do anything.

I think dh_haskell should check in the .install and ignore files listed
there and trust that dh_install will handle them.

This still wouldn't cover files that have been installed
by cabal cut should not be part of a binary package. We could
probably list such ignored files somewhere so dh_haskell knows that it
doesn't need to worry about them, but that would be behaviour that is
pretty different from the rest of debhelper. (read: a solution, but
maybe someone comes up with something more elegant.)

> Probably you want to invent 4th class - 'data' exactly for such
> unhandled files?

I noticed that this wouldn't be as trivial as I thought, as it's not
clear in which package they should go. Handling them with the mechanism
I described above would probably be sufficient.

Regards
Sven

Attachment: pgpTtYRPYndQ1.pgp
Description: Digitale Signatur von OpenPGP


Reply to: