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

Niklas Hamb├╝chen mail at nh2.me
Sun May 12 23:21:53 UTC 2019

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.

More information about the Haskell-Cafe mailing list