Bug 1853122 - heads-up: hedgewars-1.0.0 fails to build with Haskell network-3
Summary: heads-up: hedgewars-1.0.0 fails to build with Haskell network-3
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: hedgewars
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-02 03:14 UTC by Jens Petersen
Modified: 2020-11-30 15:28 UTC (History)
4 users (show)

Fixed In Version: hedgewars-1.0.0-9.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-30 15:28:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
hedgewars-1.0.0-server-network3.patch (6.09 KB, patch)
2020-07-02 04:03 UTC, Jens Petersen
no flags Details | Diff

Description Jens Petersen 2020-07-02 03:14:59 UTC
Description of problem:
I am working now on updating Fedora's Haskell packages to
ghc-8.8 and Stackage LTS 16.  In particular this means updating
the ghc-network package to major version 3 and also the new
ghc-network-bsd package which was split out from network.

Hedgewars server is using some parts of the deprecated API from network 2,
so it will need to have some changes or patch in order to build for F33.

Note that ghc-8.8 has not landed yet in Koji or Rawhide:
though you can use the ghc:8.8 module with cabal-install to test this.

Version-Release number of selected component (if applicable):
hedgewars-1.0.0
ghc-8.8.3
ghc-network-3.1.1.1
ghc-network-bsd-2.8.1.0

Steps to Reproduce:
1. fedpkg local

Actual results:
Cannot find Network module

Expected results:
to build

Additional info:
I will attach a rough untested draft patch which should make
it compile with network3 + network-bsd, but something like this
should really be pushed upstream or at least tested first.

This is an early heads-up, to give you more time to report/look into this:
I expect the Haskell rebase to land in Rawhide within about 2 weeks,
ahead of the Mass Rebuild, thanks!

Comment 1 Jens Petersen 2020-07-02 03:20:47 UTC
(Also just noting it would be better if gameServer used hedgewars-server.cabal
rather than ghc --make to build. This would avoid module ambiguities
and some of the extra cmake hoops.)

Comment 2 Jens Petersen 2020-07-02 04:03:31 UTC
Created attachment 1699592 [details]
hedgewars-1.0.0-server-network3.patch

I am not a network programmer - this may need some tweaks to work correctly.

Comment 3 Jens Petersen 2020-07-02 04:04:35 UTC
Also this change to the spec file:

modified   hedgewars.spec
@@ -20,6 +20,8 @@ Patch6:         rpath-fix.patch
 Patch8:         hedgewars-cmake-ghc8-mask.patch
 # Try to use gcc instead of clang
 Patch9:         hedgewars-clang.patch
+# Haskell network-3
+Patch10:        hedgewars-1.0.0-server-network3.patch
 
 BuildRequires:  cmake gcc-c++ fpc desktop-file-utils
 BuildRequires:  libatomic
@@ -53,6 +55,7 @@ Summary:        Standalone server for hedgewars
 Requires:       %{name}%{?_isa} = %{version}-%{release}
 BuildRequires:  ghc-stm-devel
 BuildRequires:  ghc-network-devel
+BuildRequires:  ghc-network-bsd-devel
 BuildRequires:  ghc-utf8-string-devel
 BuildRequires:  ghc-hslogger-devel
 BuildRequires:  ghc-deepseq-devel

Comment 4 Richard Shaw 2020-07-02 13:04:36 UTC
Ok, I'll take a look when I can. I have posted to the hedgewars support forum to get their input.

Also, would not a copr make it easier for test builds? You can easily craft a mock repo from it. Miro has provided those for the python updates. I really know nothing about Haskell.

Comment 5 Jens Petersen 2020-07-03 03:09:01 UTC
(In reply to Richard Shaw from comment #4)
> Ok, I'll take a look when I can. I have posted to the hedgewars support
> forum to get their input.

Thanks

> Also, would not a copr make it easier for test builds? You can easily craft
> a mock repo from it. Miro has provided those for the python updates. I
> really know nothing about Haskell.

You are right - it would help too, but basically Hedgewars is about
the only "out-of-band" Haskell package in Fedora. :)
But I would like to it do - we have over 500 packages in Fedora -
the main problem is just lack of time. :)

Comment 6 Jens Petersen 2020-07-03 03:21:50 UTC
Also if needed I can certainly help with scripting how to test this locally.
Anyway I think my patch is not too wrong, but I am not certain about all the adddress handling.

(Just for my reference: https://www.hedgewars.org/node/9167)

Comment 7 Jens Petersen 2020-07-21 06:16:28 UTC
Just another heads-up that the big Haskell update push for F33 is happening now in Rawhide.

https://bodhi.fedoraproject.org/updates/FEDORA-2020-ff060f7bec

Comment 8 Richard Shaw 2020-07-21 12:28:24 UTC
I asked for help from upstream a few weeks ago and just pinged them again.

https://www.hedgewars.org/node/9167?page=0

Comment 9 Nikolay Nikolov 2020-07-21 13:08:05 UTC
I saw they have integrated Jens Petersen's patch in their upstream mercurial repository, so I guess we should proceed with it. I'm currently preparing a patch that also fixes an unrelated build failure due to the CMAKE out-of-source build change.

Comment 10 Nikolay Nikolov 2020-07-21 15:35:26 UTC
I committed the patch and my CMAKE out-of-source build fixes. Koji scratch build here:

https://koji.fedoraproject.org/koji/taskinfo?taskID=47571435

Now I get this build error, probably due to missing dependency:

-- Found GHC: /usr/bin/ghc  
-- Looking for Haskell package containers ...
-- Looking for Haskell package containers - found
-- Looking for Haskell package vector ...
-- Looking for Haskell package vector - found
-- Looking for Haskell package bytestring ...
-- Looking for Haskell package bytestring - found
-- Looking for Haskell package network ...
-- Looking for Haskell package network - found
-- Looking for Haskell package network-bsd ...
-- Looking for Haskell package network-bsd - found
-- Looking for Haskell package time ...
-- Looking for Haskell package time - found
-- Looking for Haskell package mtl ...
-- Looking for Haskell package mtl - found
-- Looking for Haskell package sandi ...
-- Looking for Haskell package sandi - found
-- Looking for Haskell package hslogger ...
-- Looking for Haskell package hslogger - found
-- Looking for Haskell package process ...
-- Looking for Haskell package process - not found
CMake Error at cmake_modules/CheckHaskellPackageExists.cmake:44 (message):
  Haskell package 'process' required
Call Stack (most recent call first):
  gameServer/CMakeLists.txt:18 (check_haskell_package_exists)
-- Configuring incomplete, errors occurred!
See also "/builddir/build/BUILD/hedgewars-src-1.0.0/x86_64-redhat-linux-gnu/CMakeFiles/CMakeOutput.log".
See also "/builddir/build/BUILD/hedgewars-src-1.0.0/x86_64-redhat-linux-gnu/CMakeFiles/CMakeError.log".
error: Bad exit status from /var/tmp/rpm-tmp.LCsEit (%build)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.LCsEit (%build)

Comment 11 Richard Shaw 2020-07-21 15:46:04 UTC
# dnf repoquery --whatprovides ghc-devel\* | grep process
ghc-process-devel-0:1.6.5.0-102.fc32.x86_64
ghc-typed-process-devel-0:0.2.6.0-1.fc32.x86_64

# dnf repoquery --provides ghc-process-devel
Last metadata expiration check: 0:00:20 ago on Tue 21 Jul 2020 10:43:28 AM CDT.
ghc-devel(process-1.6.5.0)
ghc-process-devel = 1.6.5.0-102.fc32
ghc-process-devel(x86-64) = 1.6.5.0-102.fc32
ghc-process-static = 1.6.5.0-102.fc32
ghc-process-static(x86-64) = 1.6.5.0-102.fc32

You can add a BR for the package directly. It probably SHOULD be in the form of "ghc-devel(process)" but with the embedded version I don't think it would work. The provides would be more useful in dnf/rpm if it was in the form:

ghc-devel(process) = 1.6.5.0

Comment 12 Nikolay Nikolov 2020-07-21 18:37:25 UTC
Added BuildRequires to the package directly. Koji scratch build:

https://koji.fedoraproject.org/koji/taskinfo?taskID=47580266

Comment 13 Richard Shaw 2020-07-21 18:46:05 UTC
Looks good to me, I would go ahead and do an official build.

Comment 14 Nikolay Nikolov 2020-07-21 19:00:17 UTC
Ok, done:

https://koji.fedoraproject.org/koji/buildinfo?buildID=1544622

Comment 15 Jens Petersen 2020-07-22 05:52:24 UTC
Thanks!

Comment 16 Ben Cotton 2020-08-11 15:28:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 17 Richard Shaw 2020-11-30 15:28:11 UTC
Update is in stable, closing.


Note You need to log in before you can comment on or make changes to this bug.