haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

Cannot apply patches to hmatrix because of modified line endings in Cabal revision #302

Open nh2 opened 5 years ago

nh2 commented 5 years ago

I wanted to use the patch from https://github.com/haskell-numerics/hmatrix/pull/301 on my nix-based build, but the build fails with:

Replace Cabal file with edited version from mirror://hackage/hmatrix-0.19.0.0/revision/1.cabal.
applying patch /nix/store/2lf83g48pd79lkv1gg639ivbmcjbkvvb-hmatrix-Allow-disabling-random_r-usage-manually.patch
patching file hmatrix.cabal
Hunk #1 FAILED at 36 (different line endings).
Hunk #2 FAILED at 99 (different line endings).
2 out of 2 hunks FAILED -- saving rejects to file hmatrix.cabal.rej

This is because the .cabal file was modified in https://hackage.haskell.org/package/hmatrix-0.19.0.0/revisions/ which changed all original \n line endings to \r\n, which means a patch working on hmatrix git master no longer works on hmatrix on Hackage.

This breaks my workflow.

Could you fix the cabal file on Hackage, so that the version on Hackage is the same as on Github?

Thanks!

idontgetoutmuch commented 5 years ago

This is very frustrating - I'll have to investigate what happened with line endings.

nh2 commented 5 years ago

@idontgetoutmuch Was it intended that the above commit closes this ticket?

idontgetoutmuch commented 5 years ago

Yes for reasons best known to itself, github truncated the commit message

nh2 commented 5 years ago

Well, may you reveal to me what the message was then? :grin:

idontgetoutmuch commented 5 years ago

Remove sundials as it has its own repo now. Fix

nh2 commented 5 years ago

Then it wasn't cut off, as that's what https://github.com/idontgetoutmuch/hmatrix/commit/cb09d0e99ae4f10cd2b3f3ac667df83946a9744d says.

But I don't understand how that implements the request

Could you fix the cabal file on Hackage

And the latest "revision" on https://hackage.haskell.org/package/hmatrix-0.19.0.0/revisions/ for that version still has the problem.

idontgetoutmuch commented 5 years ago

Isn't is this what you want? https://hackage.haskell.org/package/hmatrix-0.20.0.0

TBH I don't understand what you do want now I think about it.

nh2 commented 5 years ago

A new release is also good because its .cabal file will also agree with what's in the repo (for now, until somebody makes a Cabal revision via the Hackage UI, at which piont the problem wil reappear for that version as well).

However, a new release will not fix the current problems with 0.19 on Hackage, and many setups still use that.

What I originally asked (sorry for not being clear!) was

Could you fix the cabal file on Hackage

for the 0.19 version, e.g. by making a Hackage revision for that version, that has correct line endings.

idontgetoutmuch commented 5 years ago

It's not obvious how to do this. It seems I can edit the file only by using the GUI provided and I assume this saves the file with the undesirable line endings. I will ask on # hackage.

idontgetoutmuch commented 5 years ago

How about doing a sed via nix in the pre build phase (I forget what nix calls this)? I have had no response from # hackage so far.

idontgetoutmuch commented 5 years ago

Is this still causing a problem?

chreekat commented 4 years ago

For what it's worth, I would classify this as a Hackage bug rather than an HMatrix bug.