darcs

Issue 2642 compile version 2.14.2 with ghc 8.8

Title compile version 2.14.2 with ghc 8.8
Priority wishlist Status resolved
Milestone 2.14.2 Resolved in 2.15.0
Superseder Nosy List dguibert_
Assigned To
Topics

Created on 2020-04-16.13:58:39 by dguibert_, last changed 2020-06-20.09:32:34 by bfrk.

Messages
msg21979 (view) Author: dguibert_ Date: 2020-04-16.13:58:36
Hi,

I try to compile darcs 2.14.2 on NixOS with ghc 8.8.
I've finally follow the "hacks" from [arch] and submit a PR to [nixos].

But to ease the packaging work, is there a chance to get a new version uploaded to hackage?

[arch] https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/darcs
[nixos] https://github.com/NixOS/nixpkgs/pull/84573
-- 
Regards, David
msg21981 (view) Author: bfrk Date: 2020-04-16.21:27:07
> I try to compile darcs 2.14.2 on NixOS with ghc 8.8.
> I've finally follow the "hacks" from [arch] and submit a PR to [nixos].
> 
> But to ease the packaging work, is there a chance to get a new version uploaded to hackage?

Porting darcs to build with ghc-8.8 is difficult because of the
MonadFail changes. We use fail in a number of internal monad
transformers. I have no idea how to fix the errors in a backward
compatible manner. If you happen to know how to do this, I would
appreciate advice.
msg21982 (view) Author: dguibert_ Date: 2020-04-18.09:57:27
The patch [monadfail] applies changes for MonadFail.

From [base]: "Control.Monad.Fail module can be imported for defining forward compatible MonadFail instances". Maybe the patch is enough for a backward compatibility.

[monadfail] https://github.com/NixOS/nixpkgs/blob/9581bdb8e922d03f15be8e1e6a5b3cba13dd2d91/pkgs/development/haskell-modules/patches/darcs-2.14.2-Compile-against-GHC-8.8.patch
[base] https://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Monad-Fail.html
msg21983 (view) Author: bfrk Date: 2020-04-19.09:15:06
>> From [base]: "Control.Monad.Fail module can be imported for
>> defining forward compatible MonadFail instances". Maybe the patch
>> is enough for a backward compatibility.
> 
> [monadfail]
> https://github.com/NixOS/nixpkgs/blob/9581bdb8e922d03f15be8e1e6a5b3cba13dd2d91/pkgs/development/haskell-modules/patches/darcs-2.14.2-Compile-against-GHC-8.8.patch

Hm, yes that may do the trick, for 2.14. Getting the HEAD to compile
with ghc-8.8 is a different matter, but that doesn't need to bother you.

Ganesh: could you take a look at this and perhaps make a new release
2.14.3? There is also a pending patch somewhere against the 2.14 branch
that I made to avoid a problem with Setup.hs.
msg21984 (view) Author: arrowd Date: 2020-04-19.13:55:12
As a downstream packager, I'm also interested in Darcs release that supports GHC 8.8.
msg21985 (view) Author: ganesh Date: 2020-04-19.14:43:15
On 19/04/2020 10:15, Ben Franksen wrote:

> Ganesh: could you take a look at this and perhaps make a new release
> 2.14.3? There is also a pending patch somewhere against the 2.14 branch
> that I made to avoid a problem with Setup.hs.

I'm a bit busy (possibly for a few more weeks) but I'll take a look when
I can. Or if you have time, maybe it'd make sense for you to try doing a
release and shake out any problems if you haven't done one before?

Cheers,

Ganesh
msg21986 (view) Author: bfrk Date: 2020-04-19.15:22:05
> Or if you have time, maybe it'd make sense for you to try doing a
> release and shake out any problems if you haven't done one before?

I haven't, which is why I asked you... I will try to get out a new
release 2.14.3 with no other changes than necessary to make things build
with ghc-8.8. I have been looking at the release script a few weeks ago
when I worked on cleaning up the Setup.hs. I think the way it works is
not appropriate for newer cabal versions and I guess I will have to make
a few changes. Please don't expect the release to be ready tomorrow.
msg21987 (view) Author: bfrk Date: 2020-04-20.20:41:26
It looks as if I can provide a version that compiles with ghc versions
from 8.2 up to 8.8, but I can't seem to get things to build with ghc-8.0
any longer.

The problem is that even though I am using cabal-install-3.2, it seems
that with ghc-8.0 it internally switches to an old cabal file parser
that does not understand the autogen-modules keyword.

I have no idea why they did that.

The more so since compilation works just fine. After it has successfully
compiled everything it fails with

setup: Error: Could not find module: Version with any suffix:
["gc","chs","hsc","x","y","ly","cpphs","hs","lhs"]

I even found a correctly generated Version.hs:

ben@juliana[1]:.../darcs/branch-2.14>find dist-newstyle -name Version.hs
dist-newstyle/build/x86_64-linux/ghc-8.0.2/darcs-2.14.2/build/autogen/Version.hs

Any ideas anyone?

I have just filed a cabal issue:

https://github.com/haskell/cabal/issues/6722
msg21988 (view) Author: bfrk Date: 2020-04-21.10:19:37
Update: the issue has been solved. I was a bit too happy to succumb to
cabal warnings (and the cabal documentation) about having to add the
Version module to other-modules and autogen-modules of the darcs
executable section. Ignoring these warnings and the hints in the
documentation, i.e. adding it only to the library section, actually
works fine with ghc versions from 8.0 up to 8.10.

(This is also what I would logically expect to work; I never understood
why cabal complains about this and I probably never will.)
msg21997 (view) Author: bfrk Date: 2020-04-26.21:21:15
I have uploaded a new release 2.14.3 as

https://hackage.haskell.org/package/darcs-2.14.3/candidate

It should now build without warnings with all ghc versions from 8.0 to 8.10.

It would be nice if you could check that it works for you.

Thanks for packaging darcs!
msg21998 (view) Author: arrowd Date: 2020-04-27.07:13:46
I confirm it works for me now. Waiting for a proper release, thanks!
msg21999 (view) Author: bfrk Date: 2020-04-27.07:21:35
Never mind the candidate. I have published the release, see

https://hackage.haskell.org/package/darcs-2.14.3
msg22000 (view) Author: bfrk Date: 2020-04-27.08:10:22
Release 2.14.3 is now published on hackage.
msg22002 (view) Author: bfrk Date: 2020-04-27.08:57:30
Unfortunately, it turned out that our license as stated in the cabal
file was wrong. This affects earlier versions as well.

We always had "GPL-2" in the cabal file, with the intention of this
meaning "GPL-2 or later". But nowadays hackage converts that to
"GPL-2.0-only" which is wrong. I cannot fix this with a hackage revision
and therefore have to make a new release 2.14.4.

Dear packagers, please wait until I have uploaded a new release 2.14.4
and use that for packaging, to avoid potential problems for projects who
are using Darcs as a library.
msg22003 (view) Author: bfrk Date: 2020-04-27.09:12:51
This is now becoming ridiculous.

I cannot upload 2.14.4. The upload candidate page responds with

darcs-2.14.4/darcs.cabal:0:0: version with tags

cabal check says

Warning: These warnings may cause trouble when distributing the package:
Warning: 'license: GPL-2.0' is not a known version of that license. The
known
versions are 2, 3. If this is not a mistake and you think it should be a
known
version then please file a ticket.
Warning: darcs.cabal:4:33: version with tags

I have posted a question on haskell-cafe and hopefully someone will be
able to show me the way out of this conundrum.
msg22004 (view) Author: bfrk Date: 2020-04-27.11:02:03
There is now a revision to 2.14.3 on hackage, that clarifies the 
license in the package description.
msg22005 (view) Author: arrowd Date: 2020-04-27.11:13:18
Reflected this in package for my distro, thanks for heads up.
msg22007 (view) Author: bfrk Date: 2020-04-28.12:07:49
> Reflected this in package for my distro, thanks for heads up.

Here is another heads up:

I have now verified that (with a single exception) the quick fixes for
the MonadFail problems really are unsound, as I had already suspected:
they make darcs crash in situations in which it should rather fail in a
normal way, printing an error message. This could only be verified in
detail after finding a way to make our shell tests run again, which was
broken due to an undocumented behavior change in shelly-1.9.

I have prepared a new release 2.14.4 which fixes these problems and will
try to get it uploaded today. I think I will also mark 2.14.3 as
deprecated / not recommended because of the above mentioned issues.

It would be nice if you could make the jump to 2.14.4 when packaging.
Sorry for the inconvenience!
msg22011 (view) Author: dguibert_ Date: 2020-05-04.11:26:47
On Sun, Apr 26, 2020 at 11:25 PM Ben Franksen <bugs@darcs.net> wrote:
> I have uploaded a new release 2.14.3 as
>
> https://hackage.haskell.org/package/darcs-2.14.3/candidate
>
> It should now build without warnings with all ghc versions from 8.0 to 8.10.
>
> It would be nice if you could check that it works for you.

Ok. I've checked. It compiles fine on NixOS with ghc 8.8 and ghc 8.10.
History
Date User Action Args
2020-04-16 13:58:39dguibert_create
2020-04-16 21:27:10bfrksetmessages: + msg21981
2020-04-18 09:57:33dguibert_setmessages: + msg21982
2020-04-19 09:15:09bfrksetmessages: + msg21983
2020-04-19 13:55:14arrowdsetmessages: + msg21984
2020-04-19 14:43:18ganeshsetmessages: + msg21985
2020-04-19 15:22:08bfrksetmessages: + msg21986
2020-04-20 20:41:29bfrksetmessages: + msg21987
2020-04-21 10:19:41bfrksetmessages: + msg21988
2020-04-26 21:21:18bfrksetmessages: + msg21997
2020-04-27 07:13:49arrowdsetmessages: + msg21998
2020-04-27 07:21:38bfrksetmessages: + msg21999
2020-04-27 08:10:24bfrksetstatus: unknown -> resolved
resolvedin: 2.15.0 -> 2.14.3
messages: + msg22000
milestone: 2.14.2 -> 2.14.3
2020-04-27 08:57:34bfrksetstatus: resolved -> unknown
messages: + msg22002
2020-04-27 09:12:55bfrksetmessages: + msg22003
2020-04-27 11:02:06bfrksetstatus: unknown -> resolved
messages: + msg22004
2020-04-27 11:13:21arrowdsetstatus: resolved -> unknown
resolvedin: 2.14.3 -> 2.15.0
messages: + msg22005
milestone: 2.14.3 -> 2.14.2
2020-04-28 12:07:52bfrksetmessages: + msg22007
2020-05-04 11:26:50dguibert_setmessages: + msg22011
2020-06-20 09:32:34bfrksetstatus: unknown -> resolved