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

Re: Bug in hlibrary.mk, with patch



I settled on the attached patch, which so far works for all packages.  Its unlikely that this will matter to anyone else, since packages long enough to trigger this bug have never been encountered.

On Wed, Jul 18, 2012 at 1:28 PM, David Fox <ddssff@gmail.com> wrote:
The real problem is that the notice function in Cabal passes its argument to a function called wraptext, so when your package name gets very long a newline is inserted in the message that hlibrary.mk doesn't expect.


On Wed, Jul 18, 2012 at 12:22 PM, David Fox <ddssff@gmail.com> wrote:
Ugh, don't use this patch.  It causes other packages to fail.


On Wed, Jul 18, 2012 at 11:00 AM, David Fox <ddssff@gmail.com> wrote:
I encountered a failure whose origins are mysterious but which is fixable with the attached patch.  There are a number of elements that combine to cause this bug:

1. The Cabal library outputs most of its progress messages to stdout rather than stderr, which means that hlibrary.mk needs to filter them out
2. The sed _expression_ that filters these messages out is not anchored, so it depends on some uncertain greedyness properties of the regex system
3. The blank line left behind by the sed _expression_ is turning into a space at the beginning of the value assigned to pkg_config.  Is this new?  I don't know.

I'm not sure which of these elements changed, but something did.  I guess I'm not even sure about that.  The symptom of this bug is messages like this:

    pkg_config=`debian/hlibrary.setup register --builddir=dist-ghc --gen-pkg-config | sed -r 's,.*: ,,'` ; \
     dh_haskell_extra_depends $pkg_config ; \
     rm $pkg_config
    Installed package description file Creating can not be found
    rm: cannot remove `Creating': No such file or directory
    rm: cannot remove `package': No such file or directory
    rm: cannot remove `registration': No such file or directory
    rm: cannot remove `file:': No such file or directory
    make: *** [debian/extra-depends] Error 1
    dpkg-buildpackage: error: debian/rules binary gave error exit status 2


-david




Attachment: haskell-devscripts.diff
Description: Binary data


Reply to: