[Haskell-cafe] Cabal revision online form silently converts file to Windows line endings, breaking patches

Joachim Durchholz jo at durchholz.org
Mon May 13 16:21:31 UTC 2019


Actually this is much, much worse than annoying: All attempts to 
checksum or diff files modified in this way will have to take line-end 
differences into account, which will be a neverending source of bugs, 
and as every unexpected behaviour may make people miss a security issue, 
it's also a source of exploits (likely to become more interesting as 
Haskell gets into high-value niches).

Just my 2 cents from the sideline :-)

Am 13.05.19 um 16:29 schrieb Dan Burton:
> Two thoughts:
> 1. this is annoying and I wish it didn't do this
> 2. one workaround would be to always fetch v0 of the patch, and 
> maintain/generate custom versions of the patches equivalent to each 
> revision as needed.
> 
> -- Dan Burton
> 
> 
> On Sun, May 12, 2019 at 7:22 PM Niklas Hambüchen <mail at nh2.me 
> <mailto:mail at nh2.me>> wrote:
> 
>     I noticed that if you use Hackage's online Cabal file editor, it
>     changes all your \n line endings to \r\n.
> 
>     This breaks all patches written against upstream .cabal files.
> 
>     For example, if I write a patch against `cachix-0.2.0` git repo's
>     .cabal file, I can no longer apply it to whatever revisions of it
>     Hackage has, even if there's no real conflict.
> 
>     Here's a reproduction (I changed only 1 line in the editor, and it
>     shows the whole file as changed):
> 
>          diff -u <(curl
>     https://hackage.haskell.org/package/AesonBson-0.2.0/revision/0.cabal) <(curl
>     https://hackage.haskell.org/package/AesonBson-0.2.0/revision/1.cabal)
> 
>     I found this especially problematic for nixpkgs, where patching
>     packages is a common practice.
>     _______________________________________________
>     Haskell-Cafe mailing list
>     To (un)subscribe, modify options or view archives go to:
>     http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>     Only members subscribed via the mailman list are allowed to post.
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
> 



More information about the Haskell-Cafe mailing list